Class ReadWriteCache
java.lang.Object
org.apache.druid.metadata.segment.cache.ReadWriteCache
- All Implemented Interfaces:
DatasourceSegmentCache,DatasourceSegmentMetadataReader,DatasourceSegmentMetadataWriter
Cache with standard read/write locking.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstop()Stops this cache.<T> TwithReadLock(com.google.common.base.Supplier<T> action) <T> TwithWriteLock(com.google.common.base.Supplier<T> action) voidwithWriteLock(ReadWriteCache.Action action) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.metadata.segment.DatasourceSegmentMetadataReader
findExistingSegmentIds, findHighestUnusedSegmentId, findPendingSegmentIds, findPendingSegmentIdsWithExactInterval, findPendingSegments, findPendingSegmentsOverlapping, findPendingSegmentsWithExactInterval, findSegment, findSegments, findSegmentsWithSchema, findUnusedSegments, findUsedSegment, findUsedSegmentIdsOverlapping, findUsedSegments, findUsedSegmentsOverlappingAnyOf, findUsedSegmentsPlusOverlappingAnyOfMethods inherited from interface org.apache.druid.metadata.segment.DatasourceSegmentMetadataWriter
deleteAllPendingSegments, deletePendingSegments, deletePendingSegments, deletePendingSegmentsCreatedIn, deleteSegments, insertPendingSegment, insertPendingSegments, insertSegments, insertSegmentsWithMetadata, markAllSegmentsAsUnused, markSegmentAsUnused, markSegmentsAsUnused, markSegmentsWithinIntervalAsUnused, updateSegmentPayload
-
Constructor Details
-
ReadWriteCache
public ReadWriteCache(boolean fair)
-
-
Method Details
-
stop
public void stop()Stops this cache. Any subsequent read/write action performed on this cache will throw a defensive DruidException. -
withWriteLock
-
withWriteLock
public <T> T withWriteLock(com.google.common.base.Supplier<T> action) -
withReadLock
public <T> T withReadLock(com.google.common.base.Supplier<T> action)
-