alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: 
Backup page store manager, initial
URL: https://github.com/apache/ignite/pull/6554#discussion_r341230600
 
 

 ##########
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/RequestSnapshotMessage.java
 ##########
 @@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.ignite.internal.processors.cache.persistence.snapshot;
+
+import java.io.Externalizable;
+import java.nio.ByteBuffer;
+import java.util.Map;
+import org.apache.ignite.internal.GridDirectMap;
+import org.apache.ignite.internal.util.GridIntList;
+import org.apache.ignite.internal.util.GridLongList;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import 
org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
+import org.apache.ignite.plugin.extensions.communication.MessageReader;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
+
+/**
+ *
+ */
+public class RequestSnapshotMessage implements Message {
+    /** Snapshot request message type (value is {@code 177}). */
+    public static final short TYPE_CODE = 177;
+
+    /** Serialization version. */
+    private static final long serialVersionUID = 0L;
+
+    /** Unique snapshot message name. */
+    private String snpName;
+
+    /** Map of requested partitions to be snapshotted. */
+    @GridDirectMap(keyType = Integer.class, valueType = GridLongList.class)
+    private Map<Integer, GridIntList> parts;
+
+    /**
+     * Empty constructor required for {@link Externalizable}.
+     */
+    public RequestSnapshotMessage() {
+        // No-op.
+    }
+
+    /**
+     * @param snpName Unique snapshot message name.
+     * @param parts Map of requested partitions to be snapshotted.
+     */
+    public RequestSnapshotMessage(
+        String snpName,
+        Map<Integer, GridIntList> parts
+    ) {
+        assert parts != null && !parts.isEmpty();
+
+        this.snpName = snpName;
+        this.parts = U.newHashMap(parts.size());
+
+        for (Map.Entry<Integer, GridIntList> e : parts.entrySet())
+            this.parts.put(e.getKey(), e.getValue().copy());
+    }
+
+    /**
+     * @return Unique snapshot message name.
 
 Review comment:
   `Unique snapshot name.`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to