aratno commented on code in PR #2660:
URL: https://github.com/apache/cassandra/pull/2660#discussion_r1313472684


##########
src/java/org/apache/cassandra/repair/AsymmetricRemoteSyncTask.java:
##########
@@ -39,14 +39,14 @@
  */
 public class AsymmetricRemoteSyncTask extends SyncTask implements 
CompletableRemoteSyncTask
 {
-    public AsymmetricRemoteSyncTask(RepairJobDesc desc, InetAddressAndPort to, 
InetAddressAndPort from, List<Range<Token>> differences, PreviewKind 
previewKind)
+    public AsymmetricRemoteSyncTask(SharedContext.RepairContext ctx, 
RepairJobDesc desc, InetAddressAndPort to, InetAddressAndPort from, 
List<Range<Token>> differences, PreviewKind previewKind)
     {
-        super(desc, to, from, differences, previewKind);
+        super(ctx, desc, to, from, differences, previewKind);
     }
 
     public void startSync()
     {
-        InetAddressAndPort local = FBUtilities.getBroadcastAddressAndPort();
+        InetAddressAndPort local = ctx.broadcastAddressAndPort();

Review Comment:
   Now it seems like the broadcast address is for the "context" - I'd find this 
clearer if it was `ctx.localBroadcastAddressAndPort`.



##########
src/java/org/apache/cassandra/db/ColumnFamilyStore.java:
##########
@@ -555,6 +555,7 @@ public ColumnFamilyStore(Keyspace keyspace,
         }
         writeHandler = new CassandraTableWriteHandler(this);
         streamManager = new CassandraStreamManager(this);
+        // TODO (now): support mock?

Review Comment:
   Still want to address before merge?



##########
test/unit/org/apache/cassandra/utils/CassandraGenerators.java:
##########
@@ -101,6 +102,11 @@ public final class CassandraGenerators
     private static final Gen<Integer> NETWORK_PORT_GEN = 
SourceDSL.integers().between(0, 0xFFFF);
     private static final Gen<Boolean> BOOLEAN_GEN = SourceDSL.booleans().all();
 
+    /**
+     * Similar to {@link Generators#IDENTIFIER_GEN} but uses a bounds of 48 as 
keyspace has a smaller restrcition than other identifieres

Review Comment:
   ```suggestion
        * Similar to {@link Generators#IDENTIFIER_GEN} but uses a bound of 48 
as keyspace has a smaller restriction than other identifiers
   ```



##########
src/java/org/apache/cassandra/repair/StreamingRepairTask.java:
##########
@@ -77,10 +80,10 @@ public StreamingRepairTask(RepairJobDesc desc, 
InetAddressAndPort initiator, Ine
     public void run()
     {
         logger.info("[streaming task #{}] Performing {}streaming repair of {} 
ranges with {}", desc.sessionId, asymmetric ? "asymmetric " : "", 
ranges.size(), dst);
-        long start = approxTime.now();
+        long start = approxTime.now(); // TODO (now): mock

Review Comment:
   There are a few of these TODOs



##########
src/java/org/apache/cassandra/config/SharedContext.java:
##########
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+import java.util.Random;
+import java.util.function.Supplier;
+
+import org.apache.cassandra.concurrent.ExecutorFactory;
+import org.apache.cassandra.concurrent.ExecutorPlus;
+import org.apache.cassandra.concurrent.ScheduledExecutorPlus;
+import org.apache.cassandra.concurrent.ScheduledExecutors;
+import org.apache.cassandra.concurrent.Stage;
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.gms.FailureDetector;
+import org.apache.cassandra.gms.Gossiper;
+import org.apache.cassandra.gms.IFailureDetector;
+import org.apache.cassandra.gms.IGossiper;
+import org.apache.cassandra.locator.IEndpointSnitch;
+import org.apache.cassandra.locator.InetAddressAndPort;
+import org.apache.cassandra.net.MessageDelivery;
+import org.apache.cassandra.net.MessagingService;
+import org.apache.cassandra.repair.IValidationManager;
+import org.apache.cassandra.repair.StreamExecutor;
+import org.apache.cassandra.repair.TableRepairManager;
+import org.apache.cassandra.repair.ValidationManager;
+import org.apache.cassandra.service.ActiveRepairService;
+import org.apache.cassandra.streaming.StreamPlan;
+import org.apache.cassandra.utils.Clock;
+import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.utils.MBeanWrapper;
+
+public interface SharedContext

Review Comment:
   Makes sense, can you put something like this in a comment? SharedContext is 
an ambiguous name on its own.



##########
test/unit/accord/utils/DefaultRandom.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package accord.utils;
+
+import java.util.Random;
+
+public class DefaultRandom extends Random implements RandomSource

Review Comment:
   Why extend Random and not just delegate to it for implementing RandomSource? 
Extending exposes more API than strictly necessary.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to