cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [3/5] git commit: fix NPE
Date Thu, 23 May 2013 16:25:03 GMT
fix NPE


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/57e6888e
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/57e6888e
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/57e6888e

Branch: refs/heads/trunk
Commit: 57e6888e6aa8cc726fadb4087fe0cb77853c12eb
Parents: 2d0dff7
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu May 23 11:24:35 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu May 23 11:24:46 2013 -0500

----------------------------------------------------------------------
 .../cassandra/db/commitlog/CommitLogReplayer.java  |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/57e6888e/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
index e1fefa1..6b401fb 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
@@ -80,7 +80,8 @@ public class CommitLogReplayer
             ReplayPosition rp = ReplayPosition.getReplayPosition(cfs.getSSTables());
 
             // but, if we've truncted the cf in question, then we need to need to start replay
after the truncation
-            ReplayPosition truncatedAt = truncationPositions.get(cfs.metadata.cfId).left;
+            Pair<ReplayPosition, Long> truncateRecord = truncationPositions.get(cfs.metadata.cfId);
+            ReplayPosition truncatedAt = truncateRecord == null ? null : truncateRecord.left;
             if (truncatedAt != null)
                 rp = replayPositionOrdering.max(Arrays.asList(rp, truncatedAt));
 


Mime
View raw message