shanthoosh commented on a change in pull request #1079: SAMZA-2250: Support 
large job models in standalone.
URL: https://github.com/apache/samza/pull/1079#discussion_r296917710
 
 

 ##########
 File path: samza-core/src/main/java/org/apache/samza/zk/ZkMetadataStore.java
 ##########
 @@ -64,25 +79,50 @@ public void init() {
    */
   @Override
   public byte[] get(String key) {
-    return zkClient.readData(getZkPathForKey(key), true);
+    byte[] aggregatedZNodeValues = new byte[0];
+    for (int segmentIndex = 0;; ++segmentIndex) {
+      String zkPath = getZkPath(key, segmentIndex);
+      byte[] zNodeValue = zkClient.readData(zkPath, true);
+      if (zNodeValue == null) {
+        break;
+      }
+      aggregatedZNodeValues = Bytes.concat(aggregatedZNodeValues, zNodeValue);
+    }
+    if (aggregatedZNodeValues.length > 0) {
+      byte[] value = ArrayUtils.subarray(aggregatedZNodeValues, 0, 
aggregatedZNodeValues.length - CHECKSUM_SIZE_IN_BYTES);
+      byte[] checkSum = ArrayUtils.subarray(aggregatedZNodeValues, 
aggregatedZNodeValues.length - CHECKSUM_SIZE_IN_BYTES, 
aggregatedZNodeValues.length);
+      byte[] expectedChecksum = getCRCChecksum(value);
+      if (!Arrays.equals(checkSum, expectedChecksum)) {
+        String exceptionMessage = String.format("Expected checksum: %s of 
value: %s did not match the actual checksum: %s",
 
 Review comment:
   Fixed the nitpick.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to