Thanks Kishore.  "zkClient.setZkSerializer(new ZNRecordSerializer())"
solved the problem.


On Mon, Jun 6, 2016 at 6:32 PM, kishore g <g.kish...@gmail.com> wrote:
> zkClient.setStreamingSerializer(new ZNRecordSerialiazer()) something like
> that.
>
> On Mon, Jun 6, 2016 at 6:00 PM, Neutron sharc <neutronsh...@gmail.com>
> wrote:
>
>> Hi the team,
>>
>> I want to read this znode to get partitions assigned to a dead participant:
>> "<cluster name>/INSTANCES/<participant name>/CURRENTSTATES/<session
>> id>/<resource name>"
>>
>> I use this code snippet to read:
>>
>> accessor = new ZkBaseDataAccessor<ZNRecord>(zkClient);
>> String path = xxxxx;
>> ZNRecord record = accessor.get(path, null, AccessOption.PERSISTENT);
>>
>> Immediately at get() I got the following exception about invalid
>> stream header.  What's the "right" way to access that znode?  Thanks!
>>
>> [ERROR 2016-06-06 16:43:22,214
>> com.hcd.hcdadmin.InstancePropertyAccessor:115] failed to read znode
>> /shawn1/INSTANCES/node5_pp1/CURRENTSTATES/10000029c4a143b/Pool0
>> org.I0Itec.zkclient.exception.ZkMarshallingError:
>> java.io.StreamCorruptedException: invalid stream header: 7B0A2020
>> at
>> org.I0Itec.zkclient.serialize.SerializableSerializer.deserialize(SerializableSerializer.java:37)
>> at
>> org.apache.helix.manager.zk.BasicZkSerializer.deserialize(BasicZkSerializer.java:41)
>> at org.apache.helix.manager.zk.ZkClient.deserialize(ZkClient.java:231)
>> at org.apache.helix.manager.zk.ZkClient.readData(ZkClient.java:247)
>> at org.I0Itec.zkclient.ZkClient.readData(ZkClient.java:761)
>> at
>> org.apache.helix.manager.zk.ZkBaseDataAccessor.get(ZkBaseDataAccessor.java:322)
>> at
>> com.hcd.hcdadmin.InstancePropertyAccessor.getReplicas(InstancePropertyAccessor.java:103)
>> at
>> com.hcd.hcdadmin.InstancePropertyAccessor.main(InstancePropertyAccessor.java:139)
>> Caused by: java.io.StreamCorruptedException: invalid stream header:
>> 7B0A2020
>> at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:808)
>> at java.io.ObjectInputStream.<init>(ObjectInputStream.java:301)
>> at
>> org.I0Itec.zkclient.serialize.SerializableSerializer.deserialize(SerializableSerializer.java:31)
>> ... 7 more
>>

Reply via email to