You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/11/22 09:40:01 UTC

[GitHub] [cassandra] blambov commented on a diff in pull request #2020: CASSANDRA-18044

blambov commented on code in PR #2020:
URL: https://github.com/apache/cassandra/pull/2020#discussion_r1029092025


##########
src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java:
##########
@@ -376,25 +377,45 @@ public static CommitLogPosition firstNotCovered(Collection<IntervalSet<CommitLog
         public static ReplayFilter create()
         {
             // If no replaylist is supplied an empty array of strings is used to replay everything.
-            if (System.getProperty("cassandra.replayList") == null)
+
+            String replayList = CassandraRelevantProperties.COMMIT_LOG_REPLAY_LIST.getString();
+
+            if (replayList == null)
                 return new AlwaysReplayFilter();
 
             Multimap<String, String> toReplay = HashMultimap.create();
-            for (String rawPair : System.getProperty("cassandra.replayList").split(","))
+            for (String rawPair : replayList.split(","))
             {
                 String[] pair = StringUtils.split(rawPair.trim(), '.');
-                if (pair.length != 2)
-                    throw new IllegalArgumentException("Each table to be replayed must be fully qualified with keyspace name, e.g., 'system.peers'");
 
-                Keyspace ks = Schema.instance.getKeyspaceInstance(pair[0]);
+                if (pair.length > 2)
+                    throw new IllegalStateException(String.format("cassandra.replayList property contain an item which is not " +
+                                                    "in format 'keyspace' or 'keyspace.table' but it is '%s'",
+                                                    String.join(".", pair)));
+
+                String keyspaceName = pair[0];
+
+                Keyspace ks = Schema.instance.getKeyspaceInstance(keyspaceName);
                 if (ks == null)
-                    throw new IllegalArgumentException("Unknown keyspace " + pair[0]);
-                ColumnFamilyStore cfs = ks.getColumnFamilyStore(pair[1]);
-                if (cfs == null)
-                    throw new IllegalArgumentException(String.format("Unknown table %s.%s", pair[0], pair[1]));
+                    throw new IllegalArgumentException("Unknown keyspace " + keyspaceName);
+
+                if (pair.length == 1)
+                {
+                    for (ColumnFamilyStore cfs : ks.getColumnFamilyStores())
+                        toReplay.put(keyspaceName, cfs.name);
+                }
+                else
+                {
+                    ColumnFamilyStore cfs = ks.getColumnFamilyStore(pair[1]);
+                    if (cfs == null)
+                        throw new IllegalArgumentException(String.format("Unknown table %s.%s", keyspaceName, pair[1]));
 
-                toReplay.put(pair[0], pair[1]);
+                    toReplay.put(keyspaceName, pair[1]);
+                }
             }
+
+            logger.info("Tables going to be replayed: {}", toReplay.asMap().toString());

Review Comment:
   The message does not sound right, maybe `Tables to be replayed`?



-- 
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.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org