Java Code Examples for backtype.storm.utils.Utils#deserialize()

The following examples show how to use backtype.storm.utils.Utils#deserialize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DBBolt.java    From jstorm with Apache License 2.0 5 votes vote down vote up
@Override
public void revert(BatchId id, byte[] commitResult) {
    CommitedValue commitedValue = Utils.deserialize(commitResult, CommitedValue.class);
    if (commitedValue == null) {
        LOG.warn("Failed to deserialize commited value");
        return;
    }

    revertQueue.offer(commitedValue);
}
 
Example 2
Source File: ZkTool.java    From jstorm with Apache License 2.0 5 votes vote down vote up
public static String getData(DistributedClusterState zkClusterState,
                             String path) throws Exception {
    byte[] data = zkClusterState.get_data(path, false);
    if (data == null || data.length == 0) {
        return null;
    }

    Object obj = Utils.deserialize(data, null);
    return obj.toString();
}