This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch STORM-4069
in repository https://gitbox.apache.org/repos/asf/storm.git

commit 3b1cb827ea8d350b17b3da9d91272c1edec6e683
Author: Richard Zowalla <[email protected]>
AuthorDate: Fri Aug 9 19:52:14 2024 +0200

    STORM-4069 - java.lang.ClassCastException for Trident-based Topology
---
 .../apache/storm/trident/topology/MasterBatchCoordinator.java    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git 
a/storm-client/src/jvm/org/apache/storm/trident/topology/MasterBatchCoordinator.java
 
b/storm-client/src/jvm/org/apache/storm/trident/topology/MasterBatchCoordinator.java
index 6b595e486..9f53de1b5 100644
--- 
a/storm-client/src/jvm/org/apache/storm/trident/topology/MasterBatchCoordinator.java
+++ 
b/storm-client/src/jvm/org/apache/storm/trident/topology/MasterBatchCoordinator.java
@@ -232,9 +232,12 @@ public class MasterBatchCoordinator extends BaseRichSpout {
     private Long getStoredCurrTransaction() {
         Long ret = INIT_TXID;
         for (TransactionalState state : states) {
-            Long curr = (Long) state.getData(CURRENT_TX);
-            if (curr != null && curr.compareTo(ret) > 0) {
-                ret = curr;
+            final Object o = state.getData(CURRENT_TX);
+            if (o instanceof Number) {
+                final Long curr = ((Number) o).longValue();
+                if(curr.compareTo(ret) > 0) {
+                    ret = curr;
+                }
             }
         }
         return ret;

Reply via email to