dcapwell commented on code in PR #3743:
URL: https://github.com/apache/cassandra/pull/3743#discussion_r1917519897
##########
src/java/org/apache/cassandra/index/accord/ParticipantsJournalIndex.java:
##########
@@ -108,42 +111,57 @@ public enum RegisterStatus
private volatile boolean initBuildStarted = false;
private volatile RegisterStatus registerStatus = RegisterStatus.PENDING;
- public RouteIndex(ColumnFamilyStore baseCfs, IndexMetadata indexMetadata)
+ public ParticipantsJournalIndex(ColumnFamilyStore baseCfs, IndexMetadata
indexMetadata)
{
- if
(!SchemaConstants.ACCORD_KEYSPACE_NAME.equals(baseCfs.getKeyspaceName()))
- throw new IllegalArgumentException("Route index is only allowed
for accord commands table; given " + baseCfs().metadata());
- if (!AccordKeyspace.COMMANDS.equals(baseCfs.name))
- throw new IllegalArgumentException("Route index is only allowed
for accord commands table; given " + baseCfs().metadata());
-
- TableMetadata tableMetadata = baseCfs.metadata();
- Pair<ColumnMetadata, IndexTarget.Type> target =
TargetParser.parse(tableMetadata, indexMetadata);
- if
(!AccordKeyspace.CommandsColumns.participants.name.equals(target.left.name))
- throw new IllegalArgumentException("Attempted to index the wrong
column; needed " + AccordKeyspace.CommandsColumns.participants.name + " but
given " + target.left.name);
-
- if (target.right != IndexTarget.Type.VALUES)
- throw new IllegalArgumentException("Attempted to index " +
AccordKeyspace.CommandsColumns.participants.name + " with index type " +
target.right + "; only " + IndexTarget.Type.VALUES + " is supported");
+ validateTargets(baseCfs, indexMetadata);
this.baseCfs = baseCfs;
+ // type is only IndexTarget.Type.VALUES
+ this.record = AccordKeyspace.JournalColumns.record;
Review Comment:
done
--
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]