From 38b946c2762d10f547de3e6c2b0676d3f7dfbd54 Mon Sep 17 00:00:00 2001 From: chenheng Date: Tue, 6 Sep 2016 11:02:18 +0800 Subject: [PATCH] HBASE-16562 ITBLL should fail to start if misconfigured --- .../hbase/test/IntegrationTestBigLinkedList.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java index 2d828f4e6ca..366fc025856 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java @@ -678,6 +678,17 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase { Integer width = (args.length < 4) ? null : Integer.parseInt(args[3]); Integer wrapMultiplier = (args.length < 5) ? null : Integer.parseInt(args[4]); Integer numWalkers = (args.length < 6) ? null : Integer.parseInt(args[5]); + + long wrap = (long)width*wrapMultiplier; + if (wrap < numNodes && numNodes % wrap != 0) { + /** + * numNodes should be a multiple of width*wrapMultiplier. + * If numNodes less than wrap, wrap will be set to be equal with numNodes, + * See {@link GeneratorMapper#setup(Mapper.Context)} + * */ + System.err.println(USAGE); + return 1; + } return run(numMappers, numNodes, tmpOutput, width, wrapMultiplier, numWalkers); } catch (NumberFormatException e) { System.err.println("Parsing generator arguments failed: " + e.getMessage());