From common-commits-return-94549-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Tue May 28 02:23:53 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 E6D27180638 for ; Tue, 28 May 2019 04:23:52 +0200 (CEST) Received: (qmail 93263 invoked by uid 500); 28 May 2019 02:23:51 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 93248 invoked by uid 99); 28 May 2019 02:23:51 -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; Tue, 28 May 2019 02:23:51 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 996D28A11E; Tue, 28 May 2019 02:23:51 +0000 (UTC) Date: Tue, 28 May 2019 02:23:51 +0000 To: "common-commits@hadoop.apache.org" Subject: [hadoop] branch trunk updated: HDDS-1534. freon should return non-zero exit code on failure. Contributed by Nilotpal Nandi. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <155901023144.13562.17449006932078553280@gitbox.apache.org> From: msingh@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: hadoop X-Git-Refname: refs/heads/trunk X-Git-Reftype: branch X-Git-Oldrev: b70d1be685c5f9d08ab39f9ea73fc0561e037c74 X-Git-Newrev: 72dd79015a00d29015bec30f1bfc7ededab6a2b1 X-Git-Rev: 72dd79015a00d29015bec30f1bfc7ededab6a2b1 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. msingh pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git The following commit(s) were added to refs/heads/trunk by this push: new 72dd790 HDDS-1534. freon should return non-zero exit code on failure. Contributed by Nilotpal Nandi. 72dd790 is described below commit 72dd79015a00d29015bec30f1bfc7ededab6a2b1 Author: Mukul Kumar Singh AuthorDate: Tue May 28 07:52:56 2019 +0530 HDDS-1534. freon should return non-zero exit code on failure. Contributed by Nilotpal Nandi. --- .../apache/hadoop/ozone/freon/RandomKeyGenerator.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java index a255342..b0461cb 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java @@ -107,7 +107,7 @@ public final class RandomKeyGenerator implements Callable { LoggerFactory.getLogger(RandomKeyGenerator.class); private boolean completed = false; - private boolean exception = false; + private Exception exception = null; @Option(names = "--numOfThreads", description = "number of threads to be launched for the run", @@ -278,7 +278,7 @@ public final class RandomKeyGenerator implements Callable { processor.awaitTermination(Integer.MAX_VALUE, TimeUnit.MILLISECONDS); completed = true; - if (exception) { + if (exception != null) { progressbar.terminate(); } else { progressbar.shutdown(); @@ -288,6 +288,9 @@ public final class RandomKeyGenerator implements Callable { validator.join(); } ozoneClient.close(); + if (exception != null) { + throw exception; + } return null; } @@ -337,7 +340,7 @@ public final class RandomKeyGenerator implements Callable { out.println(); out.println("***************************************************"); - out.println("Status: " + (exception ? "Failed" : "Success")); + out.println("Status: " + (exception != null ? "Failed" : "Success")); out.println("Git Base Revision: " + VersionInfo.getRevision()); out.println("Number of Volumes created: " + numberOfVolumesCreated); out.println("Number of Buckets created: " + numberOfBucketsCreated); @@ -577,7 +580,7 @@ public final class RandomKeyGenerator implements Callable { numberOfVolumesCreated.getAndIncrement(); volume = objectStore.getVolume(volumeName); } catch (IOException e) { - exception = true; + exception = e; LOG.error("Could not create volume", e); return; } @@ -644,13 +647,13 @@ public final class RandomKeyGenerator implements Callable { } } } catch (Exception e) { - exception = true; + exception = e; LOG.error("Exception while adding key: {} in bucket: {}" + " of volume: {}.", key, bucket, volume, e); } } } catch (Exception e) { - exception = true; + exception = e; LOG.error("Exception while creating bucket: {}" + " in volume: {}.", bucketName, volume, e); } @@ -696,7 +699,7 @@ public final class RandomKeyGenerator implements Callable { private String[] tenQuantileKeyWriteTime; private FreonJobInfo() { - this.status = exception ? "Failed" : "Success"; + this.status = exception != null ? "Failed" : "Success"; this.numOfVolumes = RandomKeyGenerator.this.numOfVolumes; this.numOfBuckets = RandomKeyGenerator.this.numOfBuckets; this.numOfKeys = RandomKeyGenerator.this.numOfKeys; --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org