public class MultiWriter extends DataWriter
DataWriter
.Modifier and Type | Class and Description |
---|---|
static class |
MultiWriter.AvailableCapacityWriteStrategy
Writes each record to a single writer by choosing the one with the
highest available capacity (
DataWriter.available() If all writers
have identical capacities, this strategy behaves like
MultiWriter.RoundRobinWriteStrategy and writes to each writer in turn. |
static class |
MultiWriter.ReplicateCloneWriteStrategy
Writes a clone (to prevent side effects) of each record to all writers.
|
static class |
MultiWriter.ReplicateWriteStrategy
Writes each record to all writers.
|
static class |
MultiWriter.RoundRobinWriteStrategy
Divides records evenly between all writers by cycling through the list
and writing each record to a single writer in turn.
|
static class |
MultiWriter.WriteStrategy |
DataEndpoint.State
Modifier and Type | Field and Description |
---|---|
static MultiWriter.WriteStrategy |
REPLICATE
|
static MultiWriter.WriteStrategy |
REPLICATE_CLONE
|
lastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEY
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZE
id, log, name, TIMESTAMP_FORMAT
Constructor and Description |
---|
MultiWriter() |
MultiWriter(DataWriter... sinks) |
MultiWriter(MultiWriter.WriteStrategy writeStrategy) |
Modifier and Type | Method and Description |
---|---|
MultiWriter |
add(DataWriter... sinks) |
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException . |
void |
close()
Indicates that this endpoint has finished reading or writing.
|
DataEndpoint |
get(int index) |
int |
getCount() |
MultiWriter.WriteStrategy |
getWriteStrategy() |
void |
open()
Makes this endpoint ready for reading or writing.
|
MultiWriter |
remove(DataWriter sink) |
MultiWriter |
removeAllDataSink() |
MultiWriter |
setWriteStrategy(MultiWriter.WriteStrategy writeStrategy) |
protected void |
writeImpl(Record record)
Overridden by subclasses to write the specified record to this
DataWriter . |
available, getNestedEndpoint, getNestedWriter, getRootEndpoint, getRootWriter, write
decrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toString
addElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription
public static final MultiWriter.WriteStrategy REPLICATE
public static final MultiWriter.WriteStrategy REPLICATE_CLONE
public MultiWriter()
public MultiWriter(MultiWriter.WriteStrategy writeStrategy)
public MultiWriter(DataWriter... sinks)
public MultiWriter.WriteStrategy getWriteStrategy()
public MultiWriter setWriteStrategy(MultiWriter.WriteStrategy writeStrategy)
public MultiWriter add(DataWriter... sinks)
public int getCount()
public MultiWriter remove(DataWriter sink)
public MultiWriter removeAllDataSink()
public DataEndpoint get(int index)
public void open() throws DataException
DataEndpoint
open
in class DataEndpoint
DataException
public void close() throws DataException
DataEndpoint
close
in class DataEndpoint
DataException
protected void writeImpl(Record record) throws Throwable
DataWriter
DataWriter
.writeImpl
in class DataWriter
Throwable
public DataException addExceptionProperties(DataException exception)
Endpoint
DataException
. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties
in class DataWriter
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.