public class TupleCopier extends DataTypeCopier
... TupleCopier input2OutputCopier = new TupleCopier(inputSchema, outputSchema, true); while (true) { outputTuple.clear(); input2OutputCopier.copyTuple(getInputTuple(), outputTuple); sendOutput(port, outputTuple); }
Tuple.clone()
Modifier and Type | Class and Description |
---|---|
static class |
TupleCopier.Options
Options for this TupleCopier
|
Constructor and Description |
---|
TupleCopier(Schema sourceSchema,
Schema destSchema,
boolean strict)
Create the TupleCopier.
|
TupleCopier(Schema sourceSchema,
Schema destSchema,
EnumSet<TupleCopier.Options> options)
Create the TupleCopier.
|
Modifier and Type | Method and Description |
---|---|
(package private) List<?> |
copyList(List<?> sourceList)
Copy the given list
|
void |
copyTuple(Tuple sourceTuple,
Tuple destTuple)
Copy the fields from the sourceTuple to the destTuple.
|
copyField, copyList, createCopier
public TupleCopier(Schema sourceSchema, Schema destSchema, boolean strict) throws TupleException
sourceSchema
- The schema of the source TupledestSchema
- The schema of the destination tuplestrict
- set to true will throw exceptions if schema fields do not match by name and type. Set
to false and the TupleCopier will copy only fields that match by name and type.TupleException
- with strict on if the fields do not match by name and typepublic TupleCopier(Schema sourceSchema, Schema destSchema, EnumSet<TupleCopier.Options> options) throws TupleException
sourceSchema
- The schema of the source TupledestSchema
- The schema of the destination tupleoptions
- options from TupleCopier.Options
TupleException
- with strict on if the fields do not match by name and typepublic void copyTuple(Tuple sourceTuple, Tuple destTuple) throws TupleException
sourceTuple
- the source tupledestTuple
- the cleared destination tupleTupleException
- on field copy errorsList<?> copyList(List<?> sourceList) throws TupleException
DataTypeCopier
copyList
in class DataTypeCopier
sourceList
- the list to copyTupleException
- on errorCopyright © 2015–2018 Cloud Software Group, Inc.. All rights reserved.