You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2017/02/09 06:17:42 UTC

[1/2] storm git commit: Convert NoNodeException to KeyNotFoundException in getNimbodesWithLatestSequenceNumberOfBlob

Repository: storm
Updated Branches:
  refs/heads/1.0.x-branch cc8b5f88b -> 5e5f9f1ae


Convert NoNodeException to KeyNotFoundException in getNimbodesWithLatestSequenceNumberOfBlob

* since callers are able to handle KeyNotFoundException but not NoNodeException


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/9bbab350
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/9bbab350
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/9bbab350

Branch: refs/heads/1.0.x-branch
Commit: 9bbab350b827ca80adfb30c51e0382d1a4dc5d3c
Parents: cc8b5f8
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Wed Feb 8 13:59:39 2017 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Thu Feb 9 15:10:47 2017 +0900

----------------------------------------------------------------------
 .../jvm/org/apache/storm/blobstore/BlobStoreUtils.java   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/9bbab350/storm-core/src/jvm/org/apache/storm/blobstore/BlobStoreUtils.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/blobstore/BlobStoreUtils.java b/storm-core/src/jvm/org/apache/storm/blobstore/BlobStoreUtils.java
index 473984a..8a17d36 100644
--- a/storm-core/src/jvm/org/apache/storm/blobstore/BlobStoreUtils.java
+++ b/storm-core/src/jvm/org/apache/storm/blobstore/BlobStoreUtils.java
@@ -30,6 +30,7 @@ import org.apache.storm.utils.ZookeeperAuthInfo;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.thrift.transport.TTransportException;
 import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.KeeperException.NoNodeException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -72,7 +73,15 @@ public class BlobStoreUtils {
 
     // Check for latest sequence number of a key inside zookeeper and return nimbodes containing the latest sequence number
     public static Set<NimbusInfo> getNimbodesWithLatestSequenceNumberOfBlob(CuratorFramework zkClient, String key) throws Exception {
-        List<String> stateInfoList = zkClient.getChildren().forPath("/blobstore/" + key);
+        List<String> stateInfoList;
+        try {
+            stateInfoList = zkClient.getChildren().forPath("/blobstore/" + key);
+        } catch (KeeperException.NoNodeException e) {
+            // there's a race condition with a delete: blobstore
+            // this should be thrown to the caller to indicate that the key is invalid now
+            throw new KeyNotFoundException(key);
+        }
+
         Set<NimbusInfo> nimbusInfoSet = new HashSet<NimbusInfo>();
         int latestSeqNumber = getLatestSequenceNumber(stateInfoList);
         LOG.debug("getNimbodesWithLatestSequenceNumberOfBlob stateInfo {} version {}", stateInfoList, latestSeqNumber);


[2/2] storm git commit: Merge branch 'fix-nonodeexception-getNimbodesWithLatestSequenceNumberOfBlob-1.0.x' into 1.0.x-branch

Posted by ka...@apache.org.
Merge branch 'fix-nonodeexception-getNimbodesWithLatestSequenceNumberOfBlob-1.0.x' into 1.0.x-branch


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/5e5f9f1a
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/5e5f9f1a
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/5e5f9f1a

Branch: refs/heads/1.0.x-branch
Commit: 5e5f9f1ae9641b839c83b11748b19a4cbe8bcf49
Parents: cc8b5f8 9bbab35
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Thu Feb 9 15:17:32 2017 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Thu Feb 9 15:17:32 2017 +0900

----------------------------------------------------------------------
 .../jvm/org/apache/storm/blobstore/BlobStoreUtils.java   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------