Github user d2r commented on a diff in the pull request: https://github.com/apache/storm/pull/1642#discussion_r76459256 --- Diff: storm-core/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java --- @@ -164,21 +164,18 @@ public Assignment assignmentInfo(String stormId, Runnable callback) { } @Override - public Map assignmentInfoWithVersion(String stormId, Runnable callback) { - Map map = new HashMap(); + public VersionedData<Assignment> assignmentInfoWithVersion(String stormId, Runnable callback) { if (callback != null) { assignmentInfoWithVersionCallback.put(stormId, callback); } Assignment assignment = null; Integer version = 0; - Map dataWithVersionMap = stateStorage.get_data_with_version(ClusterUtils.assignmentPath(stormId), callback != null); - if (dataWithVersionMap != null) { - assignment = ClusterUtils.maybeDeserialize((byte[]) dataWithVersionMap.get(IStateStorage.DATA), Assignment.class); - version = (Integer) dataWithVersionMap.get(IStateStorage.VERSION); - } - map.put(IStateStorage.DATA, assignment); - map.put(IStateStorage.VERSION, version); - return map; + VersionedData<byte[]> dataWithVersion = stateStorage.get_data_with_version(ClusterUtils.assignmentPath(stormId), callback != null); + if (dataWithVersion != null) { + assignment = ClusterUtils.maybeDeserialize((byte[]) dataWithVersion.getData(), Assignment.class); --- End diff -- VersionedData is generic, so we can remove the cast to byte[]
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---