ptupitsyn commented on code in PR #7091:
URL: https://github.com/apache/ignite-3/pull/7091#discussion_r2606324968
##########
modules/core/src/main/java/org/apache/ignite/internal/table/partition/HashPartition.java:
##########
@@ -32,10 +32,16 @@ public HashPartition(int partitionId) {
this.partitionId = partitionId;
}
- public int partitionId() {
+ @Override
+ public long id() {
return partitionId;
}
+ @Deprecated(since = "3.2", forRemoval = true)
Review Comment:
This class is not in the public API so we can just remove the old thing.
##########
.idea/codeStyles/Project.xml:
##########
@@ -42,7 +42,7 @@
</value>
</option>
</AndroidXmlCodeStyleSettings>
- <JSCodeStyleSettings>
+ <JSCodeStyleSettings version="0">
Review Comment:
Should we revert those entire file? Not sure what those changes mean.
##########
modules/api/src/main/java/org/apache/ignite/table/partition/PartitionDistribution.java:
##########
@@ -0,0 +1,135 @@
+/*
+ * 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.table.partition;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import org.apache.ignite.network.ClusterNode;
+import org.apache.ignite.table.Tuple;
+import org.apache.ignite.table.mapper.Mapper;
+
+/**
+ * The partition distribution provides the ability to obtain information about
table partitions.
+ * This interface can be used to get all partitions of a table, the location
of the primary replica of a partition,
+ * the partition for a specific table key.
+ */
+public interface PartitionDistribution {
+ /**
+ * Asynchronously gets a list with all partitions.
+ *
+ * @return Future with list with all partitions.
+ */
+ CompletableFuture<List<Partition>> partitionsAsync();
+
+ /**
+ * Gets a list with all partitions.
+ *
+ * @return List with all partitions.
+ */
+ List<Partition> partitions();
+
+ /**
+ * Asynchronously gets map with all partitions and their locations as of
the time of the call.
+ *
+ * <p>Note: This assignment may become outdated if a re-assigment happens
on the cluster.
+ *
+ * @return Future with map from partition to cluster node where primary
replica of the partition is located as of the time of the call.
+ */
+ CompletableFuture<Map<Partition, ClusterNode>> primaryReplicasAsync();
+
+ /**
+ * Asynchronously gets all partitions hosted by the specified node as a
primary replica.
+ *
+ * @return Future with list with all partitions hosted by the specified
node as a primary replica.
+ */
+ CompletableFuture<List<Partition>> primaryReplicasAsync(ClusterNode node);
+
+ /**
+ * Gets map with all partitions and their locations as of the time of the
call.
+ *
+ * <p>Note: This assignment may become outdated if a re-assigment happens
on the cluster.
+ *
+ * @return Map from partition to cluster node where primary replica of the
partition is located as of the time of the call.
+ */
+ Map<Partition, ClusterNode> primaryReplicas();
+
+ /**
+ * Gets all partitions hosted by the specified node as a primary replica.
Review Comment:
```suggestion
* Gets all partitions hosted by the specified node as a primary replica
as of the time of the call.
*
* <p>Note: This assignment may become outdated if a re-assigment
happens on the cluster.
```
--
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]