Class TmpFileSegmentWriteOutMedium

  • All Implemented Interfaces:
    Closeable, AutoCloseable, SegmentWriteOutMedium

    public final class TmpFileSegmentWriteOutMedium
    extends Object
    implements SegmentWriteOutMedium
    Builds segment write out medium objects that are based on temporary files. Some analysis of usage of these objects shows that they periodically get used for very small things, where the overhead of creating a tmp file is actually very large. It would be best to go back and look at usages and try to make them lazy such that they only actually use a medium when they need it. But, in an attempt to get some benefits, we "shim" in the laziness by returning a heap-based WriteOutBytes that only falls back to making a tmp file when it actually fills up.