/** * Go thrift gzip serializer */ public static <T> T deserialize(byte[] serialized, Class<T> clazz) { /** * @@@ JStorm disable the thrift.gz.serializer */ // return serializationDelegate.deserialize(serialized, clazz); return (T) javaDeserialize(serialized); }
@Override public T deserialize(byte[] b) { if (b != null) return (T) Utils.javaDeserialize(b); else return null; } }
private IBatchBolt newTransactionalBolt() { return Utils.javaDeserialize(_boltSer, IBatchBolt.class); } }
protected Object deserialize(byte[] data) { return Utils.javaDeserialize(data); } }
@Override public void revert(BatchId id, byte[] commitResult) { LOG.info("Receive BatchId " + id); BatchId failedId = (BatchId) Utils.javaDeserialize(commitResult); if (!failedId.equals(id)) { LOG.info("Deserialized error " + id); } } }
@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 += ", failed to read"; LOG.error(errMsg); throw new IOException(errMsg); } Object ret; try { ret = Utils.javaDeserialize(bconf); } catch (Exception e) { errMsg += ", failed to serialize the data"; LOG.error(errMsg); throw new IOException(errMsg); } return ret; }
@Override public Object get(String key) { for (Entry<Integer, ColumnFamilyHandle> entry : windowHandlers.entrySet()) { try { byte[] data = ttlDB.get(entry.getValue(), key.getBytes()); if (data != null) { try { return Utils.javaDeserialize(data); } catch (Exception e) { LOG.error("Failed to deserialize obj of " + key); ttlDB.remove(entry.getValue(), key.getBytes()); return null; } } } catch (Exception ignored) { } } return null; }
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; }
public static Map read_nimbus_topology_conf(String topologyId, BlobStore blobStore) throws IOException, KeyNotFoundException { return Utils.javaDeserialize(blobStore.readBlob(master_stormconf_key(topologyId)), Map.class); }
public static StormTopology read_nimbus_topology_code(String topologyId, BlobStore blobStore) throws IOException, KeyNotFoundException { return Utils.javaDeserialize(blobStore.readBlob(master_stormcode_key(topologyId)), StormTopology.class); }
value = Utils.javaDeserialize(valueByte); } catch (Exception e) { LOG.error("Failed to deserialize obj of " + new String(keyByte));
private Map<Object, Object> deserializeLatestVersion() throws IOException { String latestPath = _vs.mostRecentVersionPath(); Long latestVersion = _vs.mostRecentVersion(); Map<Object, Object> result = new HashMap<>(); while (latestPath != null) { byte[] serialized = FileUtils.readFileToByteArray(new File(latestPath)); if (serialized.length == 0) { LOG.warn("LocalState file '{}' contained no data, skip this state", latestPath); latestPath = _vs.mostRecentVersionPath(latestVersion - 1); latestVersion = _vs.mostRecentVersion(latestVersion - 1); } else { result = (Map<Object, Object>) Utils.javaDeserialize(serialized); break; } } return result; }
CustomStreamGrouping g = (CustomStreamGrouping) Utils.javaDeserialize(obj); int myTaskId = topologyContext.getThisTaskId(); String componentId = topologyContext.getComponentId(myTaskId);
/** * Go thrift gzip serializer */ public static <T> T deserialize(byte[] serialized, Class<T> clazz) { /** * @@@ JStorm disable the thrift.gz.serializer */ // return serializationDelegate.deserialize(serialized, clazz); return (T) javaDeserialize(serialized); }
private IBatchBolt newTransactionalBolt() { return Utils.javaDeserialize(_boltSer, IBatchBolt.class); } }
protected Object deserialize(byte[] data) { return Utils.javaDeserialize(data); } }
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; }
public static Map read_nimbus_topology_conf(String topologyId, BlobStore blobStore) throws IOException, KeyNotFoundException { return Utils.javaDeserialize(blobStore.readBlob(master_stormconf_key(topologyId)), Map.class); }
public static StormTopology read_nimbus_topology_code(String topologyId, BlobStore blobStore) throws IOException, KeyNotFoundException { return Utils.javaDeserialize(blobStore.readBlob(master_stormcode_key(topologyId)), StormTopology.class); }
private Map<Object, Object> deserializeLatestVersion() throws IOException { String latestPath = _vs.mostRecentVersionPath(); Long latestVersion = _vs.mostRecentVersion(); Map<Object, Object> result = new HashMap<Object, Object>(); while (latestPath != null) { byte[] serialized = FileUtils.readFileToByteArray(new File(latestPath)); if (serialized.length == 0) { LOG.warn("LocalState file '{}' contained no data, skip this state", latestPath); latestPath = _vs.mostRecentVersionPath(latestVersion - 1); latestVersion = _vs.mostRecentVersion(latestVersion - 1); } else { result = (Map<Object, Object>) Utils.javaDeserialize(serialized); break; } } return result; }