skoppu22 commented on a change in pull request #1428:
URL: https://github.com/apache/cassandra/pull/1428#discussion_r798548178



##########
File path: 
src/java/org/apache/cassandra/db/virtual/GossipStateTransitionsTable.java
##########
@@ -0,0 +1,145 @@
+/*
+ * 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.db.virtual;
+
+import java.util.Date;
+
+import org.apache.cassandra.db.marshal.InetAddressType;
+import org.apache.cassandra.db.marshal.Int32Type;
+import org.apache.cassandra.db.marshal.TimestampType;
+import org.apache.cassandra.db.marshal.UTF8Type;
+import org.apache.cassandra.dht.LocalPartitioner;
+import org.apache.cassandra.gms.GossipStateTransition;
+import org.apache.cassandra.gms.Gossiper;
+import org.apache.cassandra.schema.TableMetadata;
+
+/**
+ * A {@link VirtualTable} that returns the {@code 
max_gossip_state_transitions_size} most recent gossip state
+ * transitions. The table only considers peers in the ring (it doesn't track 
transitions for evicted peers).
+ *
+ * <p>The {@code max_gossip_state_transitions_size} property can be configured 
in the {@code cassandra.yaml}
+ * configuration file.
+ */
+final class GossipStateTransitionsTable extends AbstractVirtualTable
+{
+    public static final String TABLE_NAME = "gossip_state_transitions";
+    public static final String TABLE_COMMENT = "recent gossip state 
transitions";
+
+    private static final String ADDRESS = "address";
+    private static final String PORT = "port";
+    private static final String TIMESTAMP = "timestamp";
+    private static final String HOSTNAME = "hostname";
+    private static final String GENERATION = "generation";
+    private static final String HEARTBEAT = "heartbeat";
+
+    // Fields coming from @org.apache.cassandra.gms.ApplicationState
+    private static final String STATUS = "status";

Review comment:
       (Optional) As these names are already part of ApplicationState enum, 
can't we just reuse the same enum here ?




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