SegmentedFile.Builder (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.io.util

## Class SegmentedFile.Builder

- java.lang.Object
- - org.apache.cassandra.io.util.SegmentedFile.Builder

- All Implemented Interfaces:
    java.lang.AutoCloseable
  Direct Known Subclasses:
    BufferedPoolingSegmentedFile.Builder, BufferedSegmentedFile.Builder, CompressedSegmentedFile.Builder, MmappedSegmentedFile.Builder
  Enclosing class:
    SegmentedFile

      public abstract static class SegmentedFile.Builder
      extends java.lang.Object
      implements java.lang.AutoCloseable

  Collects potential segmentation points in an underlying file, and builds a SegmentedFile to represent it.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Builder()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `addPotentialBoundary(long boundary)` Adds a position that would be a safe place for a segment boundary in the file.
    `void` | `close()`
    `java.lang.Throwable` | `close(java.lang.Throwable accumulate)`
    `protected abstract SegmentedFile` | `complete(ChannelProxy channel, long overrideLength)` Called after all potential boundaries have been added to apply this Builder to a concrete file on disk.
    `SegmentedFile` | `complete(java.lang.String path)`
    `SegmentedFile` | `complete(java.lang.String path, long overrideLength)`
    `void` | `deserializeBounds(java.io.DataInput in)`
    `void` | `serializeBounds(java.io.DataOutput out)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Builder

          public Builder()

  - ### Method Detail

    - #### addPotentialBoundary

          public abstract void addPotentialBoundary(long boundary)

      Adds a position that would be a safe place for a segment boundary in the file. For a block/row based file format, safe boundaries are block/row edges.
      Parameters:
        `boundary` - The absolute position of the potential boundary in the file.

    - #### complete

          protected abstract SegmentedFile complete(ChannelProxy channel,
                                                    long overrideLength)

      Called after all potential boundaries have been added to apply this Builder to a concrete file on disk.
      Parameters:
        `channel` - The channel to the file on disk.

    - #### complete

          public SegmentedFile complete(java.lang.String path)

    - #### complete

          public SegmentedFile complete(java.lang.String path,
                                        long overrideLength)

    - #### serializeBounds

          public void serializeBounds(java.io.DataOutput out)
                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### deserializeBounds

          public void deserializeBounds(java.io.DataInput in)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### close

          public java.lang.Throwable close(java.lang.Throwable accumulate)

    - #### close

          public void close()

      Specified by:
        `close` in interface `java.lang.AutoCloseable`

Copyright © 2018 The Apache Software Foundation