public class MostAvailableSizeStorageLocationSelectorStrategy extends Object implements StorageLocationSelectorStrategy
StorageLocation selector strategy that selects a segment cache location that has most free space
among the available storage locations.| Constructor and Description |
|---|
MostAvailableSizeStorageLocationSelectorStrategy(List<StorageLocation> storageLocations) |
| Modifier and Type | Method and Description |
|---|---|
Iterator<StorageLocation> |
getLocations()
Finds the best ordering of the
StorageLocations to load a DataSegment according to
the location selector strategy. |
String |
toString() |
public MostAvailableSizeStorageLocationSelectorStrategy(List<StorageLocation> storageLocations)
public Iterator<StorageLocation> getLocations()
StorageLocationSelectorStrategyStorageLocations to load a DataSegment according to
the location selector strategy. This method returns an iterator instead of a single best location. The
caller is responsible for iterating over the locations and calling StorageLocation.reserve(java.lang.String, org.apache.druid.timeline.DataSegment)
method. This is because a single location may be problematic like failed disk or might become unwritable for
whatever reasons.
This method can be called by different threads and so should be thread-safe.getLocations in interface StorageLocationSelectorStrategyStorageLocations from which the callers can iterate and pick a location.Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.