Source:
private void mergeDRTupleStreamInfoToZK(JSONObject jsonObj, VoltLogger log) throws JSONException { JSONObject stateInfoMap; long clusterCreateTime = VoltDB.instance().getClusterCreateTime(); assert (!jsonObj.has("clusterCreateTime") || (clusterCreateTime == jsonObj.getLong("clusterCreateTime"))); jsonObj.put("clusterCreateTime", clusterCreateTime); if (jsonObj.has("drTupleStreamStateInfo")) { stateInfoMap = jsonObj.getJSONObject("drTupleStreamStateInfo"); } else { stateInfoMap = new JSONObject(); jsonObj.put("drTupleStreamStateInfo", stateInfoMap); } for (Map.Entry<Integer, TupleStreamStateInfo> e : m_drTupleStreamInfo.entrySet()) { final String partitionId = e.getKey().toString(); DRLogSegmentId partitionStateInfo; if (e.getKey() != MpInitiator.MP_INIT_PID) { partitionStateInfo = e.getValue().partitionInfo; } else { partitionStateInfo = e.getValue().replicatedInfo; } JSONObject existingStateInfo = stateInfoMap.optJSONObject(partitionId); boolean addEntry = false; if (existingStateInfo == null) { addEntry = true; } else if (partitionStateInfo.drId > existingStateInfo.getLong("sequenceNumber")) { addEntry = true; log.error("Found a mismatch in dr sequence numbers for partition " + partitionId + " the DRId should be the same at all replicas, but one had " + existingStateInfo.getLong("sequenceNumber") + " and the local node reported " + partitionStateInfo.drId); } if (addEntry) { JSONObject stateInfo = new JSONObject(); stateInfo.put("sequenceNumber", partitionStateInfo.drId); stateInfo.put("spUniqueId", partitionStateInfo.spUniqueId); stateInfo.put("mpUniqueId", partitionStateInfo.mpUniqueId); stateInfo.put("drVersion", e.getValue().drVersion); stateInfoMap.put(partitionId, stateInfo); } } }

Target:
private void mergeDRTupleStreamInfoToZK(JSONObject jsonObj, VoltLogger log) throws JSONException { JSONObject stateInfoMap; long clusterCreateTime = VoltDB.instance().getClusterCreateTime(); assert (!jsonObj.has("clusterCreateTime") || (clusterCreateTime == jsonObj.getLong("clusterCreateTime"))); jsonObj.put("clusterCreateTime", clusterCreateTime); if (jsonObj.has("drTupleStreamStateInfo")) { stateInfoMap = jsonObj.getJSONObject("drTupleStreamStateInfo"); } else { stateInfoMap = new JSONObject(); jsonObj.put("drTupleStreamStateInfo", stateInfoMap); } for (Map.Entry<Integer, TupleStreamStateInfo> e : m_drTupleStreamInfo.entrySet()) { final String partitionId = e.getKey().toString(); DRLogSegmentId partitionStateInfo; if (e.getKey() != MpInitiator.MP_INIT_PID) { partitionStateInfo = e.getValue().partitionInfo; } else { partitionStateInfo = e.getValue().replicatedInfo; } JSONObject existingStateInfo = stateInfoMap.optJSONObject(partitionId); boolean addEntry = false; if (existingStateInfo == null) { addEntry = true; } else if (partitionStateInfo.drId != existingStateInfo.getLong("sequenceNumber")) { addEntry = true; log.error("Found a mismatch in dr sequence numbers for partition " + partitionId + " the DRId should be the same at all replicas, but one node had " + DRLogSegmentId.getDebugStringFromDRId(existingStateInfo.getLong("sequenceNumber")) + " and the local node reported " + DRLogSegmentId.getDebugStringFromDRId(partitionStateInfo.drId)); } if (addEntry) { JSONObject stateInfo = new JSONObject(); stateInfo.put("sequenceNumber", partitionStateInfo.drId); stateInfo.put("spUniqueId", partitionStateInfo.spUniqueId); stateInfo.put("mpUniqueId", partitionStateInfo.mpUniqueId); stateInfo.put("drVersion", e.getValue().drVersion); stateInfoMap.put(partitionId, stateInfo); } } }