the-other-tim-brown commented on code in PR #591:
URL: https://github.com/apache/incubator-xtable/pull/591#discussion_r1899846884
##########
xtable-core/src/test/java/org/apache/xtable/conversion/TestConversionController.java:
##########
@@ -396,6 +522,17 @@ private SyncResult buildSyncResult(SyncMode syncMode,
Instant lastSyncedInstant)
.build();
}
+ private SyncResult buildSyncResult(
+ SyncMode syncMode, Instant lastSyncedInstant, Duration duration) {
+ return SyncResult.builder()
+ .mode(syncMode)
+ .lastInstantSynced(lastSyncedInstant)
+ .syncStartTime(Instant.now().minusSeconds(duration.getSeconds()))
Review Comment:
I am a little worried this can cause some flakiness. Can we pass in the
actual start time?
##########
xtable-core/src/main/java/org/apache/xtable/catalog/ExternalCatalogConfigFactory.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.xtable.catalog;
+
+import java.util.Map;
+
+import org.apache.xtable.conversion.ExternalCatalogConfig;
+
+/** A factory class which returns {@link ExternalCatalogConfig} based on
catalogType. */
+public class ExternalCatalogConfigFactory {
+
+ public static ExternalCatalogConfig fromCatalogType(
+ String catalogType, String catalogId, Map<String, String> properties) {
+ // TODO: Choose existing implementation based on catalogType.
+ String catalogSyncClientImpl = "";
Review Comment:
Can we use a ServiceLoader like we are currently doing for
`ConversionTargetFactory`?
--
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]