dcapwell commented on code in PR #2339:
URL: https://github.com/apache/cassandra/pull/2339#discussion_r1202799599


##########
src/java/org/apache/cassandra/service/accord/AccordConfigurationService.java:
##########
@@ -20,30 +20,53 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 
-import com.google.common.base.Preconditions;
+import javax.annotation.concurrent.GuardedBy;
 
 import accord.api.ConfigurationService;
 import accord.local.Node;
 import accord.topology.Topology;
+import org.apache.cassandra.gms.ApplicationState;
+import org.apache.cassandra.gms.Gossiper;
+import org.apache.cassandra.gms.IEndpointStateChangeSubscriber;
+import org.apache.cassandra.gms.VersionedValue;
+import org.apache.cassandra.locator.InetAddressAndPort;
+import org.apache.cassandra.service.StorageService;
 
 /**
  * Currently a stubbed out config service meant to be triggered from a dtest
  */
 public class AccordConfigurationService implements ConfigurationService
 {
     private final Node.Id localId;
-    private final List<Listener> listeners = new ArrayList<>();
+    private final List<Listener> listeners = new CopyOnWriteArrayList<>();
+    @GuardedBy("this")
     private final List<Topology> epochs = new ArrayList<>();
 
     public AccordConfigurationService(Node.Id localId)
     {
         this.localId = localId;
         epochs.add(Topology.EMPTY);
+
+        // TODO (replace with TCM): Need to know when an epoch is known on the 
peers, so use gossip until TCM is ready
+        Gossiper.instance.register(new IEndpointStateChangeSubscriber()

Review Comment:
   should be deleted in https://issues.apache.org/jira/browse/CASSANDRA-18444



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