Class TmpFileSegmentWriteOutMedium
- java.lang.Object
-
- org.apache.druid.segment.writeout.TmpFileSegmentWriteOutMedium
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,SegmentWriteOutMedium
public final class TmpFileSegmentWriteOutMedium extends Object implements SegmentWriteOutMedium
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closer
getCloser()
Returns a closer of this SegmentWriteOutMedium, which is closed in this SegmentWriteOutMedium's close() method.SegmentWriteOutMedium
makeChildWriteOutMedium()
Creates a 'child' version of theSegmentWriteOutMedium
, which can be optionally closed, independent of thisSegmentWriteOutMedium
but otherwise shares the same configuration.WriteOutBytes
makeWriteOutBytes()
Creates a new emptyWriteOutBytes
, attached to this SegmentWriteOutMedium.
-
-
-
Method Detail
-
makeWriteOutBytes
public WriteOutBytes makeWriteOutBytes() throws IOException
Description copied from interface:SegmentWriteOutMedium
Creates a new emptyWriteOutBytes
, attached to this SegmentWriteOutMedium. When this SegmentWriteOutMedium is closed, the returned WriteOutBytes couldn't be used anymore.- Specified by:
makeWriteOutBytes
in interfaceSegmentWriteOutMedium
- Throws:
IOException
-
makeChildWriteOutMedium
public SegmentWriteOutMedium makeChildWriteOutMedium() throws IOException
Description copied from interface:SegmentWriteOutMedium
Creates a 'child' version of theSegmentWriteOutMedium
, which can be optionally closed, independent of thisSegmentWriteOutMedium
but otherwise shares the same configuration. This allows callers using a sharedSegmentWriteOutMedium
but which control the complete lifecycle of theWriteOutBytes
which 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 whenCloseable.close()
is called, if not called explicitly prior to closing this medium.- Specified by:
makeChildWriteOutMedium
in interfaceSegmentWriteOutMedium
- Throws:
IOException
-
getCloser
public Closer getCloser()
Description copied from interface:SegmentWriteOutMedium
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.- Specified by:
getCloser
in interfaceSegmentWriteOutMedium
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-