in twill-core/src/main/java/org/apache/twill/internal/TwillContainerLauncher.java [179:197]
protected void instanceNodeUpdated(NodeData nodeData) {
if (nodeData == null || nodeData.getData() == null) {
LOG.warn("Instance node was updated but data is null.");
return;
}
try {
Gson gson = new Gson();
JsonElement json = gson.fromJson(new String(nodeData.getData(), Charsets.UTF_8), JsonElement.class);
if (json.isJsonObject()) {
JsonElement data = json.getAsJsonObject().get("data");
if (data != null) {
this.liveData = gson.fromJson(data, ContainerLiveNodeData.class);
LOG.info("Container LiveNodeData updated: " + new String(nodeData.getData(), Charsets.UTF_8));
}
}
} catch (Throwable t) {
LOG.warn("Error deserializing updated instance node data", t);
}
}