File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
storm/trident/topology/state Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -357,4 +357,15 @@ public static byte[] toByteArray(ByteBuffer buffer) {
357
357
buffer .get (ret , 0 , ret .length );
358
358
return ret ;
359
359
}
360
+
361
+ public static boolean exceptionCauseIsInstanceOf (Class klass , Throwable throwable ) {
362
+ Throwable t = throwable ;
363
+ while (t != null ) {
364
+ if (klass .isInstance (t )) {
365
+ return true ;
366
+ }
367
+ t = t .getCause ();
368
+ }
369
+ return false ;
370
+ }
360
371
}
Original file line number Diff line number Diff line change 1
1
package storm .trident .topology .state ;
2
2
3
+ import backtype .storm .utils .Utils ;
3
4
import org .apache .zookeeper .KeeperException ;
4
5
5
6
import java .util .HashSet ;
@@ -103,11 +104,10 @@ public void cleanupBefore(long txid) {
103
104
} catch (RuntimeException e ) {
104
105
// Ignore NoNodeExists exceptions because when sync() it may populate _curr with stale data since
105
106
// zookeeper reads are eventually consistent.
106
- if (!( e . getCause () instanceof KeeperException .NoNodeException )) {
107
+ if (!Utils . exceptionCauseIsInstanceOf ( KeeperException .NoNodeException . class , e )) {
107
108
throw e ;
108
109
}
109
110
}
110
-
111
111
}
112
112
}
113
113
You can’t perform that action at this time.
0 commit comments