public class TupleCopier
extends java.lang.Object
... 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,
java.util.EnumSet<TupleCopier.Options> options)
Create the TupleCopier.
|
Modifier and Type | Method and Description |
---|---|
protected static java.util.List<?> |
copyList(com.streambase.sb.DataTypeCopier fieldCopier,
CompleteDataType destType,
java.util.List<?> sourceList)
a common method to do the list coping
|
void |
copyTuple(Tuple sourceTuple,
Tuple destTuple)
Copy the fields from the sourceTuple to the destTuple.
|
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, java.util.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 errorsprotected static java.util.List<?> copyList(com.streambase.sb.DataTypeCopier fieldCopier, CompleteDataType destType, java.util.List<?> sourceList) throws TupleException
fieldCopier
- the field copierdestType
- the dest typesourceList
- the source listTupleException