本文整理汇总了Java中backtype.storm.utils.Utils.javaDeserialize方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.javaDeserialize方法的具体用法?Java Utils.javaDeserialize怎么用?Java Utils.javaDeserialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backtype.storm.utils.Utils
的用法示例。
在下文中一共展示了Utils.javaDeserialize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readLocalObject
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
/**
* stormconf has mergered into clusterconf
*
* @param topologyId
* @param readFile
* @return
* @throws IOException
*/
@SuppressWarnings("unchecked")
public static Object readLocalObject(String topologyId, String readFile) throws IOException {
String errMsg = "Failed to get topology configuration of " + topologyId + " file:" + readFile;
byte[] bconf = FileUtils.readFileToByteArray(new File(readFile));
if (bconf == null) {
errMsg += ", due to failed to read";
LOG.error(errMsg);
throw new IOException(errMsg);
}
Object ret = null;
try {
ret = Utils.javaDeserialize(bconf);
} catch (Exception e) {
errMsg += ", due to failed to serialized the data";
LOG.error(errMsg);
throw new IOException(errMsg);
}
return ret;
}
示例2: revert
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
@Override
public void revert(BatchId id, byte[] commitResult) {
LOG.info("Receive BatchId " + id);
BatchId failedId = (BatchId)Utils.javaDeserialize(commitResult);
if (failedId.equals(id) == false) {
LOG.info("Deserialized error " + id);
}
}
示例3: isIdentityPartition
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
private static boolean isIdentityPartition(PartitionNode n) {
Grouping g = n.thriftGrouping;
if(g.is_set_custom_serialized()) {
CustomStreamGrouping csg = (CustomStreamGrouping) Utils.javaDeserialize(g.get_custom_serialized(), Serializable.class);
return csg instanceof IdentityGrouping;
}
return false;
}
示例4: newTransactionalBolt
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
private IBatchBolt newTransactionalBolt() {
return Utils.javaDeserialize(_boltSer, IBatchBolt.class);
}