belliottsmith commented on code in PR #1951:
URL: https://github.com/apache/cassandra/pull/1951#discussion_r1014510569
##########
src/java/org/apache/cassandra/service/accord/AccordPartialCommand.java:
##########
@@ -244,26 +129,23 @@ public int hashCode()
public static Version fromByte(byte b)
{
- switch (b)
- {
- case 0:
- return VERSION_0;
- default:
- throw new IllegalArgumentException();
- }
+ if (b == 0)
+ return VERSION_0;
+ throw new IllegalArgumentException();
}
}
- public void serialize(T command, DataOutputPlus out, Version version)
throws IOException
+ public void serialize(AccordPartialCommand command, DataOutputPlus
out, Version version) throws IOException
Review Comment:
Should be resolved
##########
src/java/org/apache/cassandra/service/accord/AccordPartialCommand.java:
##########
@@ -244,26 +129,23 @@ public int hashCode()
public static Version fromByte(byte b)
{
- switch (b)
- {
- case 0:
- return VERSION_0;
- default:
- throw new IllegalArgumentException();
- }
+ if (b == 0)
+ return VERSION_0;
+ throw new IllegalArgumentException();
}
}
- public void serialize(T command, DataOutputPlus out, Version version)
throws IOException
+ public void serialize(AccordPartialCommand command, DataOutputPlus
out, Version version) throws IOException
{
out.write(version.version);
CommandSerializers.txnId.serialize(command.txnId(), out,
version.msg_version);
- CommandSerializers.status.serialize(command.status(), out,
version.msg_version);
- serializeNullable(command.txn(), out, version.msg_version,
CommandSerializers.txn);
serializeNullable(command.executeAt(), out, version.msg_version,
CommandSerializers.timestamp);
+ CommandSerializers.status.serialize(command.status(), out,
version.msg_version);
+ serializeNullable(command.kind(), out, version.msg_version,
CommandSerializers.kind);
+ CollectionSerializer.serializeCollection(CommandSerializers.txnId,
command.deps, out, version.msg_version);
}
- public ByteBuffer serialize(T command)
+ public ByteBuffer serialize(AccordPartialCommand command)
Review Comment:
Should be resolved
##########
src/java/org/apache/cassandra/service/accord/db/AccordData.java:
##########
@@ -47,35 +49,50 @@
public class AccordData extends AbstractKeyIndexed<FilteredPartition>
implements Data, Result, Iterable<FilteredPartition>
{
- private static final long EMPTY_SIZE = ObjectSizes.measureDeep(new
AccordData());
+ private static final long EMPTY_SIZE = ObjectSizes.measureDeep(new
AccordData(Collections.emptyList()));
private static PartitionKey getKey(FilteredPartition partition)
{
return new PartitionKey(partition.metadata().id,
partition.partitionKey());
}
- public AccordData()
+ public static class Builder
Review Comment:
Should be resolved
--
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]