mansehajsingh commented on code in PR #4:
URL: https://github.com/apache/polaris-tools/pull/4#discussion_r2041235031


##########
polaris-synchronizer/cli/src/main/java/org/apache/polaris/tools/sync/polaris/SyncPolarisCommand.java:
##########
@@ -0,0 +1,132 @@
+/*
+ * 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.polaris.tools.sync.polaris;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.IOException;
+import java.util.concurrent.Callable;
+import org.apache.polaris.core.admin.model.PrincipalWithCredentials;
+import org.apache.polaris.tools.sync.polaris.catalog.ETagService;
+import org.apache.polaris.tools.sync.polaris.catalog.NoOpETagService;
+import 
org.apache.polaris.tools.sync.polaris.options.SourceOmniPotentPrincipalOptions;
+import org.apache.polaris.tools.sync.polaris.options.SourcePolarisOptions;
+import org.apache.polaris.tools.sync.polaris.options.TargetOmnipotentPrincipal;
+import org.apache.polaris.tools.sync.polaris.options.TargetPolarisOptions;
+import 
org.apache.polaris.tools.sync.polaris.planning.AccessControlAwarePlanner;
+import org.apache.polaris.tools.sync.polaris.planning.ModificationAwarePlanner;
+import 
org.apache.polaris.tools.sync.polaris.planning.SourceParitySynchronizationPlanner;
+import org.apache.polaris.tools.sync.polaris.planning.SynchronizationPlanner;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import picocli.CommandLine;
+
[email protected](
+    name = "sync-polaris",
+    mixinStandardHelpOptions = true,
+    sortOptions = false,
+    description =
+        "Idempotent synchronization of one Polaris instance to another. 
Entities will not be removed from the source Polaris instance.")
+public class SyncPolarisCommand implements Callable<Integer> {
+
+  private final Logger consoleLog = LoggerFactory.getLogger("console-log");
+
+  @CommandLine.ArgGroup(
+      exclusive = false,
+      multiplicity = "1",
+      heading = "Source Polaris options: %n")
+  private SourcePolarisOptions sourcePolarisOptions;
+
+  @CommandLine.ArgGroup(
+      exclusive = false,
+      multiplicity = "1",
+      heading = "Target Polaris options: %n")
+  private TargetPolarisOptions targetPolarisOptions;
+
+  @CommandLine.ArgGroup(
+      exclusive = false,
+      multiplicity = "1",
+      heading = "Source Polaris Omnipotent Principal Options: %n")
+  private SourceOmniPotentPrincipalOptions sourceOmniPotentPrincipalOptions;
+
+  @CommandLine.ArgGroup(
+      exclusive = false,
+      multiplicity = "1",
+      heading = "Target Polaris Omnipotent Principal Options: %n")
+  private TargetOmnipotentPrincipal targetOmniPotentPrincipalOptions;
+
+  @CommandLine.Option(
+      names = {"--etag-file"},
+      description = "The file path of the file to retrieve and store table 
ETags from.")

Review Comment:
   The intent is to have it be pluggable by a client using the 
`PolarisSynchronizer` outside of the CLI implementation. When we started 
building this tool, we had interest for being able to plug the tool's logic 
into use cases outside of the CLI, eg. internally within a background service, 
where we could pick a different persistence store than a file.



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