dcapwell commented on code in PR #3877:
URL: https://github.com/apache/cassandra/pull/3877#discussion_r1945326224
##########
src/java/org/apache/cassandra/db/virtual/AccordVirtualTables.java:
##########
@@ -21,28 +21,104 @@
import java.util.Collections;
import java.util.List;
+import accord.api.ConfigurationService;
+import accord.topology.TopologyManager;
+import accord.utils.async.AsyncResult;
import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.cql3.statements.schema.CreateTableStatement;
+import org.apache.cassandra.db.marshal.LongType;
+import org.apache.cassandra.dht.LocalPartitioner;
import org.apache.cassandra.schema.TableMetadata;
+import org.apache.cassandra.service.accord.AccordService;
public class AccordVirtualTables
{
- private AccordVirtualTables() {}
+ private static final String SUCCESS = "success";
+
+ private AccordVirtualTables()
+ {
+ }
public static Collection<VirtualTable> getAll(String keyspace)
{
if (!DatabaseDescriptor.getAccordTransactionsEnabled())
return Collections.emptyList();
- return List.of(
+ return List.of(new EpochTable(keyspace)
);
}
- private static TableMetadata parse(String keyspace, String comment, String
query)
+ private static TableMetadata.Builder parse(String keyspace, String query)
{
return CreateTableStatement.parse(query, keyspace)
- .comment(comment)
- .kind(TableMetadata.Kind.VIRTUAL)
- .build();
+ .kind(TableMetadata.Kind.VIRTUAL);
+ }
+
+ public static class EpochTable extends AbstractVirtualTable
+ {
+ public EpochTable(String keyspace)
+ {
+ super(parse(keyspace, "CREATE TABLE accord_epoch (\n" +
+ " epoch bigint PRIMARY KEY,\n" +
+ " ready_metadata text,\n" +
+ " ready_coordinate text,\n" +
+ " ready_data text,\n" +
+ " ready_reads text,\n" +
+ " ready boolean,\n" +
+ ")")
+ .partitioner(new LocalPartitioner(LongType.instance))
Review Comment:
wondering if i should reverse this, that way the newer epochs are first?
--
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]