tkalkirill commented on code in PR #2772:
URL: https://github.com/apache/ignite-3/pull/2772#discussion_r1392288220
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/schema/PartitionCommandsMarshaller.java:
##########
@@ -25,11 +25,16 @@
* representation of the object.
*/
public interface PartitionCommandsMarshaller extends Marshaller {
+ /**
+ * Used instead of a required catalog version when there is no requirement.
+ */
+ int NO_VERSION_REQUIRED = -1;
+
/**
* Reads required catalog version from the provided buffer.
*
* @param raw Buffer to read from.
- * @return Catalog version. {@code 0} if version is not required for the
given command.
+ * @return Catalog version. {@code -1} if version is not required for the
given command.
Review Comment:
U cau use {@value #NO_VERSION_REQUIRED}
##########
modules/network-api/src/main/java/org/apache/ignite/network/annotations/Transient.java:
##########
@@ -24,7 +24,7 @@
/**
* Annotation for methods of {@link Transferable} interface, that makes
generated serializer/deserializer ignore the property.
- */
+ *///TODO DEVNOTES
Review Comment:
I think I forgot to indicate the ticket or something like that
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/command/CatalogVersionAware.java:
##########
@@ -25,4 +25,9 @@ public interface CatalogVersionAware {
* Returns version that the Catalog must have locally for the node to be
allowed to accept this command via replication.
*/
int requiredCatalogVersion();
+
+ /**
+ * Setter for the required catalog version. Should be used with caution.
Only object's creator should call it.
+ */
+ void requiredCatalogVersion(int version);
Review Comment:
Ok
##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java:
##########
@@ -452,9 +459,12 @@ public <R> CompletableFuture<R> run(Command cmd) {
Function<Peer, ActionRequest> requestFactory;
if (cmd instanceof WriteCommand) {
+ byte[] commandBytes = commandsMarshaller.marshall(cmd);
+
requestFactory = targetPeer -> factory.writeActionRequest()
.groupId(groupId)
- .command((WriteCommand) cmd)
+ .command(commandBytes)
+ .deserializedCommand((WriteCommand) cmd)
Review Comment:
Maybe we can add more? for example, "so that the local node does not
desiralize the command several times".
--
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]