dcapwell commented on code in PR #3494:
URL: https://github.com/apache/cassandra/pull/3494#discussion_r1731918446
##########
src/java/org/apache/cassandra/service/accord/AccordJournal.java:
##########
@@ -139,7 +87,23 @@ enum Status { INITIALIZED, STARTING, STARTED, TERMINATING,
TERMINATED }
public AccordJournal(AccordEndpointMapper endpointMapper, Params params)
{
File directory = new
File(DatabaseDescriptor.getAccordJournalDirectory());
- this.journal = new Journal<>("AccordJournal", directory, params,
JournalKey.SUPPORT, RECORD_SERIALIZER);
+ this.journal = new Journal<>("AccordJournal", directory, params,
JournalKey.SUPPORT, new ValueSerializer<JournalKey, Object>()
+ {
+ public int serializedSize(JournalKey key, Object value, int
userVersion)
+ {
+ throw new IllegalStateException();
+ }
+
+ public void serialize(JournalKey key, Object value, DataOutputPlus
out, int userVersion) throws IOException
+ {
+ throw new IllegalStateException();
+ }
+
+ public Object deserialize(JournalKey key, DataInputPlus in, int
userVersion) throws IOException
+ {
+ throw new IllegalStateException();
Review Comment:
nit:
```suggestion
throw new UnsupportedOperationException();
```
##########
src/java/org/apache/cassandra/service/accord/AccordJournal.java:
##########
@@ -139,7 +87,23 @@ enum Status { INITIALIZED, STARTING, STARTED, TERMINATING,
TERMINATED }
public AccordJournal(AccordEndpointMapper endpointMapper, Params params)
{
File directory = new
File(DatabaseDescriptor.getAccordJournalDirectory());
- this.journal = new Journal<>("AccordJournal", directory, params,
JournalKey.SUPPORT, RECORD_SERIALIZER);
+ this.journal = new Journal<>("AccordJournal", directory, params,
JournalKey.SUPPORT, new ValueSerializer<JournalKey, Object>()
+ {
+ public int serializedSize(JournalKey key, Object value, int
userVersion)
+ {
+ throw new IllegalStateException();
+ }
+
+ public void serialize(JournalKey key, Object value, DataOutputPlus
out, int userVersion) throws IOException
+ {
+ throw new IllegalStateException();
Review Comment:
nit:
```suggestion
throw new UnsupportedOperationException();
```
##########
src/java/org/apache/cassandra/service/accord/AccordSafeCommand.java:
##########
@@ -127,9 +129,12 @@ public Command original()
return original;
}
- public SavedCommand.SavedDiff diff()
+ public SavedCommand.Writer<TxnId> diff()
{
- return SavedCommand.diff(original, current);
+ if (current == null)
Review Comment:
doesn't this mean `preExecute` wasn't called? What about when the status is
`Uninitialised` (aka loaded a cmd we don't know)? Some code tries to filter
that, but this doesn't?
##########
src/java/org/apache/cassandra/service/accord/AccordJournal.java:
##########
@@ -139,7 +87,23 @@ enum Status { INITIALIZED, STARTING, STARTED, TERMINATING,
TERMINATED }
public AccordJournal(AccordEndpointMapper endpointMapper, Params params)
{
File directory = new
File(DatabaseDescriptor.getAccordJournalDirectory());
- this.journal = new Journal<>("AccordJournal", directory, params,
JournalKey.SUPPORT, RECORD_SERIALIZER);
+ this.journal = new Journal<>("AccordJournal", directory, params,
JournalKey.SUPPORT, new ValueSerializer<JournalKey, Object>()
+ {
+ public int serializedSize(JournalKey key, Object value, int
userVersion)
+ {
+ throw new IllegalStateException();
Review Comment:
nit:
```suggestion
throw new UnsupportedOperationException();
```
--
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]