From hdfs-issues-return-279659-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Fri Aug 23 12:02:02 2019 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 A637E180637 for ; Fri, 23 Aug 2019 14:02:02 +0200 (CEST) Received: (qmail 19379 invoked by uid 500); 23 Aug 2019 12:02:01 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 19367 invoked by uid 99); 23 Aug 2019 12:02:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Aug 2019 12:02:01 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 0A054E00CD for ; Fri, 23 Aug 2019 12:02:01 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 70CCC780A67 for ; Fri, 23 Aug 2019 12:02:00 +0000 (UTC) Date: Fri, 23 Aug 2019 12:02:00 +0000 (UTC) From: "ASF GitHub Bot (Jira)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (HDDS-2022) Add additional freon tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDDS-2022?focusedWorklogId=300252&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-300252 ] ASF GitHub Bot logged work on HDDS-2022: ---------------------------------------- Author: ASF GitHub Bot Created on: 23/Aug/19 12:01 Start Date: 23/Aug/19 12:01 Worklog Time Spent: 10m Work Description: adoroszlai commented on pull request #1341: HDDS-2022. Add additional freon tests URL: https://github.com/apache/hadoop/pull/1341#discussion_r317094661 ########## File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java ########## @@ -0,0 +1,325 @@ +/** + * 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.hadoop.ozone.freon; + +import java.io.IOException; +import java.io.InputStream; +import java.net.InetSocketAddress; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.hadoop.hdds.conf.OzoneConfiguration; +import org.apache.hadoop.ipc.Client; +import org.apache.hadoop.ipc.ProtobufRpcEngine; +import org.apache.hadoop.ipc.RPC; +import org.apache.hadoop.net.NetUtils; +import org.apache.hadoop.ozone.OmUtils; +import org.apache.hadoop.ozone.client.OzoneClient; +import org.apache.hadoop.ozone.client.OzoneClientFactory; +import org.apache.hadoop.ozone.client.OzoneVolume; +import org.apache.hadoop.ozone.om.exceptions.OMException; +import org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes; +import org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolClientSideTranslatorPB; +import org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolPB; +import org.apache.hadoop.security.UserGroupInformation; + +import com.codahale.metrics.ConsoleReporter; +import com.codahale.metrics.MetricRegistry; +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.lang3.RandomStringUtils; +import org.apache.ratis.protocol.ClientId; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import picocli.CommandLine.Option; +import picocli.CommandLine.ParentCommand; + +/** + * Base class for simplified performance tests. + */ +public class BaseFreonGenerator { + + private static final Logger LOG = + LoggerFactory.getLogger(BaseFreonGenerator.class); + + private static final int CHECK_INTERVAL_MILLIS = 1000; + + private static final String DIGEST_ALGORITHM = "MD5"; + + private static final Pattern ENV_VARIABLE_IN_PATTERN = + Pattern.compile("__(.+?)__"); + + @ParentCommand + private Freon freonCommand; + + @Option(names = {"-n", "--number-of-tests"}, + description = "Number of the generated objects.", + defaultValue = "1000") + private long testNo = 1000; + + @Option(names = {"-t", "--threads", "--thread"}, + description = "Number of threads used to execute", + defaultValue = "10") + private int threadNo; + + @Option(names = {"-f", "--fail-at-end"}, + description = "If turned on, all the tasks will be executed even if " + + "there are failures.") + private boolean failAtEnd; + + @Option(names = {"-p", "--prefix"}, + description = "Unique identifier of the test execution. Usually used as" + + " a prefix of the generated object names. If empty, a random name" + + " will be generated", + defaultValue = "") + private String prefix = ""; + + private MetricRegistry metrics = new MetricRegistry(); + + private ExecutorService executor; + + private AtomicLong successCounter; + + private AtomicLong failureCounter; + + private long startTime; + + private PathSchema pathSchema; + + /** + * The main logic to execute a test generator. + * + * @param provider creates the new steps to execute. + */ + public void runTests(TaskProvider provider) { + + executor = Executors.newFixedThreadPool(threadNo); + + ProgressBar progressBar = + new ProgressBar(System.out, testNo, successCounter::get); + progressBar.start(); + + startTime = System.currentTimeMillis(); + //schedule the execution of all the tasks. + for (int i = 0; i < testNo; i++) { + executor.execute(() -> { + try { + + //in case of an other failed test, we shouldn't execute more tasks. + if (!failAtEnd && failureCounter.get() > 0) { + return; + } + + provider.executeNextTask(successCounter.get()); Review comment: ```suggestion provider.executeNextTask(attemptCounter.getAndIncrement()); ``` ---------------------------------------------------------------- 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 Issue Time Tracking ------------------- Worklog Id: (was: 300252) Time Spent: 0.5h (was: 20m) > Add additional freon tests > -------------------------- > > Key: HDDS-2022 > URL: https://issues.apache.org/jira/browse/HDDS-2022 > Project: Hadoop Distributed Data Store > Issue Type: Improvement > Components: Tools > Reporter: Elek, Marton > Assignee: Elek, Marton > Priority: Major > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > Freon is a generic load generator tool for ozone (ozone freon) which supports multiple generation pattern. > As of now only the random-key-generator is implemented which uses ozone rpc client. > It would be great to add additional tests: > * Test key generation via s3 interface > * Test key generation via the hadoop fs interface > * Test key reads (validation) > * Test OM with direct RPC calls -- This message was sent by Atlassian Jira (v8.3.2#803003) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org