From commits-return-13945-archive-asf-public=cust-asf.ponee.io@hudi.apache.org Sun Mar 22 02:55:32 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id C2BCA18064E for ; Sun, 22 Mar 2020 03:55:31 +0100 (CET) Received: (qmail 98236 invoked by uid 500); 22 Mar 2020 02:55:31 -0000 Mailing-List: contact commits-help@hudi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hudi.apache.org Delivered-To: mailing list commits@hudi.apache.org Received: (qmail 98226 invoked by uid 99); 22 Mar 2020 02:55:31 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Mar 2020 02:55:31 +0000 From: GitBox To: commits@hudi.apache.org Subject: [GitHub] [incubator-hudi] hddong commented on a change in pull request #1424: [HUDI-697]Add unit test for ArchivedCommitsCommand Message-ID: <158484573095.18237.5496541227179528789.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Sun, 22 Mar 2020 02:55:30 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit hddong commented on a change in pull request #1424: [HUDI-697]Add unit test for ArchivedCommitsCommand URL: https://github.com/apache/incubator-hudi/pull/1424#discussion_r396048962 ########## File path: hudi-cli/src/test/java/org/apache/hudi/cli/common/HoodieTestCommitOperate.java ########## @@ -0,0 +1,71 @@ +/* + * 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.cli.common; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.hudi.avro.model.HoodieWriteStat; +import org.apache.hudi.common.model.HoodieCommitMetadata; +import org.apache.hudi.common.model.HoodieRollingStatMetadata; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * Utility methods to commit instant for test. + */ +public class HoodieTestCommitOperate { + + /** + * Converter HoodieCommitMetadata to avro format and ordered by partition. + */ + public static org.apache.hudi.avro.model.HoodieCommitMetadata commitMetadataConverterOrdered( + HoodieCommitMetadata hoodieCommitMetadata) { + return orderCommitMetadata(commitMetadataConverter(hoodieCommitMetadata)); + } + + /** + * Converter HoodieCommitMetadata to avro format. + */ + public static org.apache.hudi.avro.model.HoodieCommitMetadata commitMetadataConverter( Review comment: IMO, we can move [HoodieCommitArchiveLog$commitMetadataConverter](https://github.com/hddong/incubator-hudi/blob/Add-test-CommitsCommand/hudi-client/src/main/java/org/apache/hudi/table/HoodieCommitArchiveLog.java#L334) to `ClientUtils`, as it is a pubilce mothod now, wdyt. ---------------------------------------------------------------- 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: users@infra.apache.org With regards, Apache Git Services