apex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Munagala Ramanath <...@datatorrent.com>
Subject Re: Setting StreamCodec properties
Date Tue, 26 Apr 2016 11:06:22 GMT
Is the tuple itself not aware of the key fields ? I'm thinking about the
file in Malhar:


and the *MachineInfoStreamCodec* in it.


On Tue, Apr 26, 2016 at 3:48 AM, Bhupesh Chawda <bhupesh@datatorrent.com>

> Hi,
> I am trying to write a stream codec to set on the input port of an
> operator which is partitioned.
> The use case is to route incoming tuples to the operator partitions such
> that the tuple with the same key goes to the same partition.
> However, the tuple key fields are known only to the operator. Is there a
> way I can use this information to construct the StreamCodec such that the
> getPartition() method of the codec returns the hashcode of the tuple key
> field.
> If this is not possible, then is there a way I can have properties in the
> Stream codec and set them externally similar to operator properties?
> Thanks.
> ~Bhupesh

View raw message