[
https://issues.apache.org/jira/browse/HUDI-2395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17409582#comment-17409582
]
ASF GitHub Bot commented on HUDI-2395:
--------------------------------------
vinothchandar commented on a change in pull request #3595:
URL: https://github.com/apache/hudi/pull/3595#discussion_r702008465
##########
File path:
hudi-common/src/test/java/org/apache/hudi/common/testutils/HoodieTestTable.java
##########
@@ -396,6 +536,27 @@ public String getBaseFileNameById(String fileId) {
return baseFileName(currentInstantTime, fileId);
}
+ public List<String> getEarliestFilesInPartition(String partition, int count)
throws IOException {
+ List<FileStatus> fileStatuses =
Arrays.asList(listAllFilesInPartition(partition));
+ Collections.sort(fileStatuses, new Comparator<FileStatus>() {
Review comment:
can this be less verbose, like calling .compare on the
`getModificationTime()`?
##########
File path:
hudi-common/src/test/java/org/apache/hudi/common/testutils/FileCreateUtils.java
##########
@@ -307,6 +318,13 @@ public static long getTotalMarkerFileCount(String
basePath, String partitionPath
.endsWith(String.format("%s.%s", HoodieTableMetaClient.MARKER_EXTN,
ioType))).count();
}
+ public static List<Path> getPartitionPaths(Path basePath) throws IOException
{
Review comment:
this does not belong here? in `FileCreateUtils`? its not really creating
anything
##########
File path:
hudi-common/src/test/java/org/apache/hudi/common/testutils/PartitionFileInfoMap.java
##########
@@ -0,0 +1,53 @@
+/*
+ * 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.common.testutils;
+
+import org.apache.hudi.common.util.collection.Pair;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+public class PartitionFileInfoMap {
+ Map<String, Map<String, List<Pair<String, Integer>>>> partitionToFileIdMap =
new HashMap<>();
Review comment:
this map needs to be made nicer to read?
--
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]
> Make metadata tests lean and consistent
> ---------------------------------------
>
> Key: HUDI-2395
> URL: https://issues.apache.org/jira/browse/HUDI-2395
> Project: Apache Hudi
> Issue Type: Sub-task
> Components: Testing
> Reporter: sivabalan narayanan
> Priority: Major
> Labels: pull-request-available
>
> Make metadata tests lean and consistent using HoodieTestTable.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)