Class SplitWriter


public class SplitWriter extends DataWriter
Converts a single source DataReader into many downstream sources using one of the provided strategies.
  • Field Details

    • log

      public static final Logger log
    • DEFAULT_QUEUE_SIZE

      public static final int DEFAULT_QUEUE_SIZE
      See Also:
    • EOF

      protected static final Record EOF
  • Constructor Details

  • Method Details

    • getStrategy

      public SplitWriter.IStrategy getStrategy()
    • getTargets

      public List<SplitReader> getTargets()
      Returns the readers created by createReader(), which receive the records written to this splitter.
    • getQueueSize

      public int getQueueSize()
      Retrieves the buffer size for downstream readers of this splitter (default is 100 records).
    • setQueueSize

      public SplitWriter setQueueSize(int queueSize)
      Sets the buffer size for downstream readers of this splitter (default is 100 records).
    • createReader

      public DataReader createReader()
      Creates a reader that receives the written records according to the strategy; create all readers before writing so none miss records. The reader's queue size is fixed at creation, so call setQueueSize(int) first.
    • writeImpl

      protected void writeImpl(Record record) throws Throwable
      Description copied from class: DataWriter
      Overridden by subclasses to write the specified record to this DataWriter.

      Contract for subclasses (see also docs/authoring/DataWriter.md):

      Specified by:
      writeImpl in class DataWriter
      Throws:
      Throwable
    • open

      public void open() throws DataException
      Description copied from class: DataEndpoint
      Makes this endpoint ready for reading or writing.
      Overrides:
      open in class DataEndpoint
      Throws:
      DataException
    • close

      public void close() throws DataException
      Description copied from class: DataEndpoint
      Indicates that this endpoint has finished reading or writing.
      Overrides:
      close in class DataEndpoint
      Throws:
      DataException
    • removeClosedTargets

      public void removeClosedTargets()
      Drops closed readers from getTargets(); the round-robin strategy calls it when it reaches a closed reader.