- 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
Constructors Constructor Description SimulatePartitions()
SimulatePartitions(String path, RecordTextSchema<?> schema)
SimulatePartitions(String path, RecordTokenType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
compose(DeferredCompositionContext ctx)
Compose the body of this operator.protected void
computeMetadata(StreamingMetadataContext ctx)
Implementations must adhere to all of the contracts specified byStreamingOperator.computeMetadata(com.pervasive.datarush.operators.StreamingMetadataContext)
.String
getFieldDelimiter()
String
getFieldSeparator()
boolean
getHeader()
int
getMaxParallelism()
RecordPort
getOutput()
Gets the record port providing the output data from the source.String
getPath()
RecordTextSchema<?>
getSchema()
void
setFieldDelimiter(String delimiter)
void
setFieldSeparator(String separator)
void
setHeader(boolean enabled)
void
setMaxParallelism(int maxParallelism)
void
setPath(String path)
void
setSchema(RecordTextSchema<?> schema)
void
setType(RecordTokenType type)
-
Methods inherited from class com.pervasive.datarush.operators.DeferredCompositeOperator
computeOutputTypes
-
Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.pervasive.datarush.operators.LogicalOperator
disableParallelism, getInputPorts, getOutputPorts
-
-
-
-
Constructor Detail
-
SimulatePartitions
public SimulatePartitions()
-
SimulatePartitions
public SimulatePartitions(String path, RecordTokenType type)
-
SimulatePartitions
public SimulatePartitions(String path, RecordTextSchema<?> schema)
-
-
Method Detail
-
setType
public void setType(RecordTokenType type)
-
getFieldDelimiter
public String getFieldDelimiter()
-
setFieldDelimiter
public void setFieldDelimiter(String delimiter)
-
getFieldSeparator
public String getFieldSeparator()
-
setFieldSeparator
public void setFieldSeparator(String separator)
-
getHeader
public boolean getHeader()
-
setHeader
public void setHeader(boolean enabled)
-
getSchema
public RecordTextSchema<?> getSchema()
-
setSchema
public void setSchema(RecordTextSchema<?> schema)
-
getOutput
public RecordPort getOutput()
Description copied from interface:RecordSourceOperator
Gets the record port providing the output data from the source.- Specified by:
getOutput
in interfaceRecordSourceOperator
- Specified by:
getOutput
in interfaceSourceOperator<RecordPort>
- Returns:
- the output port for the source
-
setPath
public void setPath(String path)
-
getPath
public String getPath()
-
getMaxParallelism
public int getMaxParallelism()
-
setMaxParallelism
public void setMaxParallelism(int maxParallelism)
-
computeMetadata
protected void computeMetadata(StreamingMetadataContext ctx)
Description copied from class:DeferredCompositeOperator
Implementations 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:
computeMetadata
in classDeferredCompositeOperator
- Parameters:
ctx
- the context
-
compose
protected void compose(DeferredCompositionContext ctx)
Description copied from class:DeferredCompositeOperator
Compose 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:
compose
in classDeferredCompositeOperator
- Parameters:
ctx
- the context
- Instantiate and configure sub-operators, adding them to the provided context via
the method
-
-