mjsax commented on code in PR #18778:
URL: https://github.com/apache/kafka/pull/18778#discussion_r1940564999


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopologyBuilder.java:
##########
@@ -655,21 +622,32 @@ public final <KIn, VIn> void addGlobalStore(final String 
sourceName,
                                                 final String processorName,
                                                 final ProcessorSupplier<KIn, 
VIn, Void, Void> stateUpdateSupplier,
                                                 final boolean 
reprocessOnRestore) {
-        ApiUtils.checkSupplier(stateUpdateSupplier);
+        verifyName(sourceName);
+
+        Objects.requireNonNull(topic, "topic cannot be null");
+        validateTopicNotAlreadyRegistered(topic);
+
+        verifyName(processorName);
+        if (sourceName.equals(processorName)) {
+            throw new TopologyException("sourceName and processorName must be 
different.");
+        }
+
         final Set<StoreBuilder<?>> stores = stateUpdateSupplier.stores();
         if (stores == null || stores.size() != 1) {
             throw new IllegalArgumentException(
-                    "Global stores must pass in suppliers with exactly one 
store but got " +
-                            (stores != null ? stores.size() : 0));
+                "Global stores must pass in suppliers with exactly one store 
but got " +
+                    (stores != null ? stores.size() : 0));
         }
         final StoreFactory storeFactory =
-                StoreBuilderWrapper.wrapStoreBuilder(stores.iterator().next());
-        validateGlobalStoreArguments(sourceName,

Review Comment:
   This method is only called once. Removed it and pulled in the code. (Allow 
to use the new helper method better.)



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to