pratyakshsharma commented on a change in pull request #1453: HUDI-644 kafka 
connect checkpoint provider
URL: https://github.com/apache/incubator-hudi/pull/1453#discussion_r399224698
 
 

 ##########
 File path: 
hudi-utilities/src/test/java/org/apache/hudi/utilities/sources/checkpoint/TestCheckPointProvider.java
 ##########
 @@ -0,0 +1,73 @@
+/*
+ * 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.hudi.utilities.sources.checkpoint;
+
+import org.apache.hudi.common.HoodieCommonTestHarness;
+import org.apache.hudi.common.model.HoodieTestUtils;
+import org.apache.hudi.common.util.FSUtils;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.File;
+
+import static org.junit.Assert.assertEquals;
+
+public class TestCheckPointProvider extends HoodieCommonTestHarness {
+  private FileSystem fs = null;
+  private String topicPath = null;
+
+  @Before
+  public void init() {
+    // Prepare directories
+    initPath();
+    topicPath = basePath + "/topic1";
+    final Configuration hadoopConf = HoodieTestUtils.getDefaultHadoopConf();
+    fs = FSUtils.getFs(basePath, hadoopConf);
+    new File(topicPath).mkdirs();
+  }
+
+  @Test
+  public void testKafkaConnectHdfsProvider() throws Exception {
+    // create regular kafka connect hdfs dirs
+    new File(topicPath + "/year=2016/month=05/day=01/").mkdirs();
+    new File(topicPath + "/year=2016/month=05/day=02/").mkdirs();
+    // kafka connect tmp folder
+    new File(topicPath + "/TMP").mkdirs();
+    // tmp file that being written
+    new File(topicPath + "/TMP/" + "topic1+0+301+400.parquet").createNewFile();
+    // regular parquet files
+    new File(topicPath + "/year=2016/month=05/day=01/"
+        + "topic1+0+100+200.parquet").createNewFile();
 
 Review comment:
   Is this some standard format of these files maintained by kafka-connect? 
Like {topic}.{partition}.{lowerOffset}.{upperOffset}.parquet? Can you share 
some documentation of this, if it is so? Basically I would like to understand 
these files. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to