Class SegmentHolder
java.lang.Object
org.apache.druid.server.coordinator.loading.SegmentHolder
- All Implemented Interfaces:
Comparable<SegmentHolder>
Represents a segment queued for a load or drop operation in a LoadQueuePeon.
Requests are naturally ordered using the COMPARE_ACTION_THEN_INTERVAL.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.common.collect.Ordering<DataSegment>Orders newest segments first (i.e. -
Constructor Summary
ConstructorsConstructorDescriptionSegmentHolder(DataSegment segment, SegmentAction action, org.joda.time.Duration requestTimeout, LoadPeonCallback callback) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCallback(LoadPeonCallback callback) intcompareTo(SegmentHolder that) booleanReturns an immutable copy of all non-null callbacks for this queued segment.inthashCode()booleanA request is considered to have timed out if the time elapsed since it was first sent to the server is greater than the configured load timeout.intbooleanisLoad()voidtoString()
-
Field Details
-
NEWEST_SEGMENT_FIRST
Orders newest segments first (i.e. segments with most recent intervals).The order is needed to ensure that:
- Round-robin assignment distributes segments belonging to same or adjacent intervals uniformly across all servers.
- Load queue prioritizes load of most recent segments, as they are presumed to contain more important data which is queried more often.
- Replication throttler has a smaller impact on replicas of newer segments.
-
-
Constructor Details
-
SegmentHolder
public SegmentHolder(DataSegment segment, SegmentAction action, org.joda.time.Duration requestTimeout, @Nullable LoadPeonCallback callback)
-
-
Method Details
-
getSegment
-
getAction
-
isLoad
public boolean isLoad() -
getChangeRequest
-
getSegmentIdentifier
-
addCallback
-
getCallbacks
Returns an immutable copy of all non-null callbacks for this queued segment. -
markRequestSentToServer
public void markRequestSentToServer() -
hasRequestTimedOut
public boolean hasRequestTimedOut()A request is considered to have timed out if the time elapsed since it was first sent to the server is greater than the configured load timeout.- See Also:
-
incrementAndGetRunsInQueue
public int incrementAndGetRunsInQueue() -
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<SegmentHolder>
-
toString
-