Interface SegmentWriteOutMedium
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
LegacyTmpFileSegmentWriteOutMedium,OffHeapMemorySegmentWriteOutMedium,OnHeapMemorySegmentWriteOutMedium,TmpFileSegmentWriteOutMedium
SegmentWriteOutMedium is an umbrella "resource disposer" for temporary buffers (in the form of
WriteOutBytes,
obtained by calling makeWriteOutBytes() on the SegmentWriteOutMedium instance), that are used during new Druid
segment creation, and other resources (see getCloser()).
When SegmentWriteOutMedium is closed, all child WriteOutBytes couldn't be used anymore.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a closer of this SegmentWriteOutMedium, which is closed in this SegmentWriteOutMedium's close() method.Creates a 'child' version of theSegmentWriteOutMedium, which can be optionally closed, independent of thisSegmentWriteOutMediumbut otherwise shares the same configuration.Creates a new emptyWriteOutBytes, attached to this SegmentWriteOutMedium.
-
Method Details
-
makeWriteOutBytes
Creates a new emptyWriteOutBytes, attached to this SegmentWriteOutMedium. When this SegmentWriteOutMedium is closed, the returned WriteOutBytes couldn't be used anymore.- Throws:
IOException
-
makeChildWriteOutMedium
Creates a 'child' version of theSegmentWriteOutMedium, which can be optionally closed, independent of thisSegmentWriteOutMediumbut otherwise shares the same configuration. This allows callers using a sharedSegmentWriteOutMediumbut which control the complete lifecycle of theWriteOutByteswhich they require to free the backing resources when they are finished, rather than waiting untilCloseable.close()is called for this medium.The 'child' medium will be closed when
Closeable.close()is called, if not called explicitly prior to closing this medium.- Throws:
IOException
-
getCloser
Closer getCloser()Returns a closer of this SegmentWriteOutMedium, which is closed in this SegmentWriteOutMedium's close() method. Could be used to "attach" some random resources to this SegmentWriteOutMedium, to be closed at the same time.
-