public class ReferenceCountingSegment extends ReferenceCountingCloseableObject<Segment> implements SegmentReference, Overshadowable<ReferenceCountingSegment>
Segment that is also a ReferenceCountingSegment, allowing query engines that operate directly on
segments to track references so that dropping a Segment can be done safely to ensure there are no in-flight
queries.baseObject, referents| Modifier and Type | Method and Description |
|---|---|
Optional<Closeable> |
acquireReferences()
This method is expected to increment a reference count and provide a
Closeable that decrements the
reference count when closed. |
QueryableIndex |
asQueryableIndex() |
StorageAdapter |
asStorageAdapter() |
short |
getAtomicUpdateGroupSize() |
Segment |
getBaseSegment() |
org.joda.time.Interval |
getDataInterval() |
int |
getEndRootPartitionId() |
SegmentId |
getId() |
short |
getMinorVersion() |
int |
getStartRootPartitionId() |
String |
getVersion() |
boolean |
overshadows(ReferenceCountingSegment other) |
static ReferenceCountingSegment |
wrapRootGenerationSegment(Segment baseSegment) |
static ReferenceCountingSegment |
wrapSegment(Segment baseSegment,
ShardSpec shardSpec) |
close, decrement, decrementOnceCloseable, getNumReferences, increment, incrementReferenceAndDecrementOnceCloseable, isClosedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsRootPartitionpublic static ReferenceCountingSegment wrapRootGenerationSegment(Segment baseSegment)
public static ReferenceCountingSegment wrapSegment(Segment baseSegment, ShardSpec shardSpec)
@Nullable public org.joda.time.Interval getDataInterval()
getDataInterval in interface Segment@Nullable public QueryableIndex asQueryableIndex()
asQueryableIndex in interface Segment@Nullable public StorageAdapter asStorageAdapter()
asStorageAdapter in interface Segmentpublic boolean overshadows(ReferenceCountingSegment other)
overshadows in interface Overshadowable<ReferenceCountingSegment>public int getStartRootPartitionId()
getStartRootPartitionId in interface Overshadowable<ReferenceCountingSegment>public int getEndRootPartitionId()
getEndRootPartitionId in interface Overshadowable<ReferenceCountingSegment>public String getVersion()
getVersion in interface Overshadowable<ReferenceCountingSegment>public short getMinorVersion()
getMinorVersion in interface Overshadowable<ReferenceCountingSegment>public short getAtomicUpdateGroupSize()
getAtomicUpdateGroupSize in interface Overshadowable<ReferenceCountingSegment>public Optional<Closeable> acquireReferences()
ReferenceCountedObjectCloseable that decrements the
reference count when closed. This is likely just a wrapper around
ReferenceCountingCloseableObject.incrementReferenceAndDecrementOnceCloseable(), but may also include any
other associated references which should be incremented when this method is called, and decremented/released by the
closeable.
IMPORTANT NOTE: to fulfill the contract of this method, implementors must return a closeable to indicate that the
reference can be acquired, even if there is nothing to close. Implementors should avoid allowing this method or the
Closeable it creates to throw exceptions.
For callers: if this method returns non-empty, IT MUST BE CLOSED, else reference counts can potentially leak.acquireReferences in interface ReferenceCountedObjectCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.