java.lang.Object
com.pervasive.datarush.operators.AbstractLogicalOperator
com.pervasive.datarush.operators.StreamingOperator
com.pervasive.datarush.operators.DeferredCompositeOperator
com.pervasive.datarush.operators.testutils.SimulatePartitions
- All Implemented Interfaces:
LogicalOperator,RecordSourceOperator,SourceOperator<RecordPort>
public final class SimulatePartitions
extends DeferredCompositeOperator
implements RecordSourceOperator
For tests that wish to simulate a partitioned read. Will read from
files of the form "base-name/part.txt".
-
Constructor Summary
ConstructorsConstructorDescriptionSimulatePartitions(String path, RecordTextSchema<?> schema) SimulatePartitions(String path, RecordTokenType type) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCompose the body of this operator.protected voidImplementations must adhere to all of the contracts specified byStreamingOperator.computeMetadata(com.pervasive.datarush.operators.StreamingMetadataContext).booleanintGets the record port providing the output data from the source.getPath()voidsetFieldDelimiter(String delimiter) voidsetFieldSeparator(String separator) voidsetHeader(boolean enabled) voidsetMaxParallelism(int maxParallelism) voidvoidsetSchema(RecordTextSchema<?> schema) voidsetType(RecordTokenType type) Methods inherited from class com.pervasive.datarush.operators.DeferredCompositeOperator
computeOutputTypesMethods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pervasive.datarush.operators.LogicalOperator
disableParallelism, getInputPorts, getOutputPorts
-
Constructor Details
-
SimulatePartitions
public SimulatePartitions() -
SimulatePartitions
-
SimulatePartitions
-
-
Method Details
-
setType
-
getFieldDelimiter
-
setFieldDelimiter
-
getFieldSeparator
-
setFieldSeparator
-
getHeader
public boolean getHeader() -
setHeader
public void setHeader(boolean enabled) -
getSchema
-
setSchema
-
getOutput
Description copied from interface:RecordSourceOperatorGets the record port providing the output data from the source.- Specified by:
getOutputin interfaceRecordSourceOperator- Specified by:
getOutputin interfaceSourceOperator<RecordPort>- Returns:
- the output port for the source
-
setPath
-
getPath
-
getMaxParallelism
public int getMaxParallelism() -
setMaxParallelism
public void setMaxParallelism(int maxParallelism) -
computeMetadata
Description copied from class:DeferredCompositeOperatorImplementations must adhere to all of the contracts specified byStreamingOperator.computeMetadata(com.pervasive.datarush.operators.StreamingMetadataContext). In addition, DeferredCompositeOperators must declare required metadata so as to satisfy requirements of the operators that are added duringDeferredCompositeOperator.compose(com.pervasive.datarush.operators.DeferredCompositionContext).- Specified by:
computeMetadatain classDeferredCompositeOperator- Parameters:
ctx- the context
-
compose
Description copied from class:DeferredCompositeOperatorCompose the body of this operator. Implementations should do the following:- Instantiate and configure sub-operators, adding them to the provided context via
the method
OperatorComposable.add(O) - Create necessary connections via the method
OperatorComposable.connect(P, P). This includes connections from the composite's input ports to sub-operators, connections between sub-operators, and connections from sub-operators output ports to the composite's output ports
- Specified by:
composein classDeferredCompositeOperator- Parameters:
ctx- the context
- Instantiate and configure sub-operators, adding them to the provided context via
the method
-