Class Sink
java.lang.Object
org.apache.druid.segment.realtime.sink.Sink
- All Implemented Interfaces:
Iterable<FireHydrant>,Overshadowable<Sink>
-
Constructor Summary
ConstructorsConstructorDescriptionSink(org.joda.time.Interval interval, DataSchema schema, ShardSpec shardSpec, String version, AppendableIndexSpec appendableIndexSpec, int maxRowsInMemory, long maxBytesInMemory) Sink(org.joda.time.Interval interval, DataSchema schema, ShardSpec shardSpec, String version, AppendableIndexSpec appendableIndexSpec, int maxRowsInMemory, long maxBytesInMemory, List<FireHydrant> hydrants) -
Method Summary
Modifier and TypeMethodDescriptionacquireSegmentReferences(SegmentMapFunction segmentMapFn, boolean skipIncrementalSegment) Acquire references to allFireHydrantthat represent this sink.booleanbooleanfinished()booleanMarks sink as 'finished', preventing further writes.shortlongintorg.joda.time.IntervalshortintintGet column information from all theFireHydrant's.intbooleanisEmpty()booleaniterator()booleanovershadows(Sink other) swap()If currHydrant is A, creates a new index B, sets currHydrant to B and returns A.booleantoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.apache.druid.timeline.Overshadowable
containsRootPartition, hasData
-
Constructor Details
-
Sink
public Sink(org.joda.time.Interval interval, DataSchema schema, ShardSpec shardSpec, String version, AppendableIndexSpec appendableIndexSpec, int maxRowsInMemory, long maxBytesInMemory) -
Sink
public Sink(org.joda.time.Interval interval, DataSchema schema, ShardSpec shardSpec, String version, AppendableIndexSpec appendableIndexSpec, int maxRowsInMemory, long maxBytesInMemory, List<FireHydrant> hydrants)
-
-
Method Details
-
getInterval
public org.joda.time.Interval getInterval() -
getCurrHydrant
-
add
-
canAppendRow
public boolean canAppendRow() -
isEmpty
public boolean isEmpty() -
isWritable
public boolean isWritable() -
swap
If currHydrant is A, creates a new index B, sets currHydrant to B and returns A.- Returns:
- the current index after swapping in a new one
-
swappable
public boolean swappable() -
finished
public boolean finished() -
finishWriting
public boolean finishWriting()Marks sink as 'finished', preventing further writes.- Returns:
- 'true' if sink was sucessfully finished, 'false' if sink was already finished
-
getSegment
-
getNumRows
public int getNumRows() -
getNumRowsInMemory
public int getNumRowsInMemory() -
getBytesInMemory
public long getBytesInMemory() -
acquireSegmentReferences
@Nullable public List<SinkSegmentReference> acquireSegmentReferences(SegmentMapFunction segmentMapFn, boolean skipIncrementalSegment) Acquire references to allFireHydrantthat represent this sink. Returns null if they cannot all be acquired, possibly because they were closed (swapped to null) concurrently with this method being called.- Parameters:
segmentMapFn- fromDataSource.createSegmentMapFunction(Query)skipIncrementalSegment- whether in-memoryIncrementalIndexsegments should be skipped
-
getSignature
Get column information from all theFireHydrant's. -
iterator
- Specified by:
iteratorin interfaceIterable<FireHydrant>
-
toString
-
overshadows
- Specified by:
overshadowsin interfaceOvershadowable<Sink>
-
getStartRootPartitionId
public int getStartRootPartitionId()- Specified by:
getStartRootPartitionIdin interfaceOvershadowable<Sink>
-
getEndRootPartitionId
public int getEndRootPartitionId()- Specified by:
getEndRootPartitionIdin interfaceOvershadowable<Sink>
-
getVersion
- Specified by:
getVersionin interfaceOvershadowable<Sink>
-
getMinorVersion
public short getMinorVersion()- Specified by:
getMinorVersionin interfaceOvershadowable<Sink>
-
getAtomicUpdateGroupSize
public short getAtomicUpdateGroupSize()- Specified by:
getAtomicUpdateGroupSizein interfaceOvershadowable<Sink>
-