sanpwc commented on a change in pull request #348:
URL: https://github.com/apache/ignite-3/pull/348#discussion_r718555919



##########
File path: 
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java
##########
@@ -302,4 +338,151 @@ private int partId(BinaryRow row) {
                     return list;
                 });
     }
+
+    /** Partition scan publisher. */
+    private class PartitionScanPublisher implements Publisher<BinaryRow> {
+        /** {@link Publisher<BinaryRow>} that relatively notifies about 
partition rows.  */
+        private final RaftGroupService raftGrpSvc;
+
+        /** */
+        private AtomicBoolean wasSubscribed;
+
+        /**
+         * The constructor.
+         *
+         * @param raftGrpSvc {@link RaftGroupService} to run corresponding 
raft commands.
+         */
+        PartitionScanPublisher(RaftGroupService raftGrpSvc) {
+            this.raftGrpSvc = raftGrpSvc;
+            this.wasSubscribed = new AtomicBoolean(false);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void subscribe(Subscriber<? super BinaryRow> 
subscriber) {
+            if (subscriber == null)
+                throw new NullPointerException("Subscriber is null");
+
+            if (!wasSubscribed.compareAndSet(false, true))
+                subscriber.onError(new IllegalStateException("Scan publisher 
does not support multiple subscriptions."));
+
+            PartitionScanSubscription subscription = new 
PartitionScanSubscription(subscriber);
+
+            subscriber.onSubscribe(subscription);
+        }
+
+        /**
+         * Partition Scan Subscription.
+         */
+        private class PartitionScanSubscription implements Subscription {
+            /** */
+            private final Subscriber<? super BinaryRow> subscriber;
+
+            /** */
+            private final AtomicBoolean isCanceled;

Review comment:
       Fixed.




-- 
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]


Reply via email to