arunpandianp commented on code in PR #31902:
URL: https://github.com/apache/beam/pull/31902#discussion_r1793002713


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorker.java:
##########
@@ -482,8 +565,58 @@ public static StreamingDataflowWorker 
fromOptions(DataflowWorkerHarnessOptions o
       computationStateCache = 
computationStateCacheFactory.apply(configFetcher);
     }
 
-    return ConfigFetcherComputationStateCacheAndWindmillClient.create(
-        configFetcher, computationStateCache, windmillServer, 
windmillStreamFactory);
+    return builder
+        .setConfigFetcher(configFetcher)
+        .setComputationStateCache(computationStateCache)
+        .setWindmillServer(windmillServer)
+        .setWindmillStreamFactory(windmillStreamFactory)
+        .build();
+  }
+
+  private static boolean isDirectPathPipeline(DataflowWorkerHarnessOptions 
options) {
+    if (options.isEnableStreamingEngine() && 
options.getIsWindmillServiceDirectPathEnabled()) {
+      boolean isIpV6Enabled =
+          Optional.ofNullable(options.getDataflowServiceOptions())
+              .map(serviceOptions -> 
serviceOptions.contains(ENABLE_IPV6_EXPERIMENT))
+              .orElse(false);
+      if (isIpV6Enabled) {
+        return true;
+      }
+      LOG.warn(
+          "DirectPath is currently only supported with IPv6 networking stack. 
Defaulting to"
+              + " CloudPath.");
+    }
+    return false;
+  }
+
+  private static void validateWorkerOptions(DataflowWorkerHarnessOptions 
options) {
+    Preconditions.checkArgument(
+        options.isStreaming(),
+        "%s instantiated with options indicating batch use",
+        StreamingDataflowWorker.class.getName());
+
+    Preconditions.checkArgument(
+        !DataflowRunner.hasExperiment(options, BEAM_FN_API_EXPERIMENT),
+        "%s cannot be main() class with beam_fn_api enabled",
+        StreamingDataflowWorker.class.getSimpleName());
+  }
+
+  private static ChannelCachingStubFactory createStubFactory(
+      DataflowWorkerHarnessOptions workerOptions) {
+    Function<WindmillServiceAddress, ManagedChannel> channelFactory =
+        serviceAddress ->
+            remoteChannel(
+                serviceAddress, 
workerOptions.getWindmillServiceRpcChannelAliveTimeoutSec());
+    ChannelCache channelCache =
+        ChannelCache.create(
+            serviceAddress ->
+                // IsolationChannel will create and manage separate RPC 
channels to the same
+                // serviceAddress via calling the channelFactory, else just 
directly return the
+                // RPC channel.
+                workerOptions.getUseWindmillIsolatedChannels()

Review Comment:
   We could choose to not support this for direct path and add it later if 
needed.
   If we are keeping it, i think we need to use a different option to avoid 
confusing with the usage and rollout of the these flags in cloud path. In cloud 
path isolated channels are enabled based on this flag or job setting.



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