1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.test;
19
20 import java.io.IOException;
21 import java.security.PrivilegedExceptionAction;
22 import java.util.Arrays;
23 import java.util.Iterator;
24 import java.util.UUID;
25
26 import org.apache.commons.cli.CommandLine;
27 import org.apache.commons.logging.Log;
28 import org.apache.commons.logging.LogFactory;
29 import org.apache.hadoop.conf.Configuration;
30 import org.apache.hadoop.conf.Configured;
31 import org.apache.hadoop.fs.Path;
32 import org.apache.hadoop.hbase.Cell;
33 import org.apache.hadoop.hbase.HBaseConfiguration;
34 import org.apache.hadoop.hbase.HColumnDescriptor;
35 import org.apache.hadoop.hbase.HRegionLocation;
36 import org.apache.hadoop.hbase.HTableDescriptor;
37 import org.apache.hadoop.hbase.IntegrationTestingUtility;
38 import org.apache.hadoop.hbase.security.visibility.VisibilityTestUtil;
39 import org.apache.hadoop.hbase.testclassification.IntegrationTests;
40 import org.apache.hadoop.hbase.TableName;
41 import org.apache.hadoop.hbase.chaos.factories.MonkeyFactory;
42 import org.apache.hadoop.hbase.client.Admin;
43 import org.apache.hadoop.hbase.client.BufferedMutator;
44 import org.apache.hadoop.hbase.client.BufferedMutatorParams;
45 import org.apache.hadoop.hbase.client.ConnectionFactory;
46 import org.apache.hadoop.hbase.client.Delete;
47 import org.apache.hadoop.hbase.client.HBaseAdmin;
48 import org.apache.hadoop.hbase.client.HConnection;
49 import org.apache.hadoop.hbase.client.HConnectionManager;
50 import org.apache.hadoop.hbase.client.Put;
51 import org.apache.hadoop.hbase.client.Result;
52 import org.apache.hadoop.hbase.client.Scan;
53 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
54 import org.apache.hadoop.hbase.io.hfile.HFile;
55 import org.apache.hadoop.hbase.mapreduce.Import;
56 import org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil;
57 import org.apache.hadoop.hbase.security.User;
58 import org.apache.hadoop.hbase.security.access.AccessControlClient;
59 import org.apache.hadoop.hbase.security.access.Permission;
60 import org.apache.hadoop.hbase.security.visibility.Authorizations;
61 import org.apache.hadoop.hbase.security.visibility.CellVisibility;
62 import org.apache.hadoop.hbase.security.visibility.VisibilityClient;
63 import org.apache.hadoop.hbase.security.visibility.VisibilityController;
64 import org.apache.hadoop.hbase.util.AbstractHBaseTool;
65 import org.apache.hadoop.hbase.util.Bytes;
66 import org.apache.hadoop.io.BytesWritable;
67 import org.apache.hadoop.mapreduce.Counter;
68 import org.apache.hadoop.mapreduce.CounterGroup;
69 import org.apache.hadoop.mapreduce.Counters;
70 import org.apache.hadoop.mapreduce.Job;
71 import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
72 import org.apache.hadoop.util.Tool;
73 import org.apache.hadoop.util.ToolRunner;
74 import org.junit.Test;
75 import org.junit.experimental.categories.Category;
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99 @Category(IntegrationTests.class)
100 public class IntegrationTestBigLinkedListWithVisibility extends IntegrationTestBigLinkedList {
101
102 private static final String CONFIDENTIAL = "confidential";
103 private static final String TOPSECRET = "topsecret";
104 private static final String SECRET = "secret";
105 private static final String PUBLIC = "public";
106 private static final String PRIVATE = "private";
107 private static final String EVERYONE = "everyone";
108 private static final String RESTRICTED = "restricted";
109 private static final String GROUP = "group";
110 private static final String PREVILIGED = "previliged";
111 private static final String OPEN = "open";
112 public static String labels = CONFIDENTIAL + "," + TOPSECRET + "," + SECRET + "," + RESTRICTED
113 + "," + PRIVATE + "," + PREVILIGED + "," + GROUP + "," + OPEN + "," + PUBLIC + "," + EVERYONE;
114 private static final String COMMA = ",";
115 private static final String UNDER_SCORE = "_";
116 public static int DEFAULT_TABLES_COUNT = 3;
117 public static String tableName = "tableName";
118 public static final String COMMON_TABLE_NAME = "commontable";
119 public static final String LABELS_KEY = "LABELS";
120 public static final String INDEX_KEY = "INDEX";
121 private static User USER;
122 private static final String OR = "|";
123 private static String USER_OPT = "user";
124 private static String userName = "user1";
125
126 static class VisibilityGenerator extends Generator {
127 private static final Log LOG = LogFactory.getLog(VisibilityGenerator.class);
128
129 @Override
130 protected void createSchema() throws IOException {
131 LOG.info("Creating tables");
132
133 boolean acl = AccessControlClient.isAccessControllerRunning(ConnectionFactory
134 .createConnection(getConf()));
135 if(!acl) {
136 LOG.info("No ACL available.");
137 }
138 Admin admin = new HBaseAdmin(getConf());
139 for (int i = 0; i < DEFAULT_TABLES_COUNT; i++) {
140 TableName tableName = IntegrationTestBigLinkedListWithVisibility.getTableName(i);
141 createTable(admin, tableName, false, acl);
142 }
143 TableName tableName = TableName.valueOf(COMMON_TABLE_NAME);
144 createTable(admin, tableName, true, acl);
145 admin.close();
146 }
147
148 private void createTable(Admin admin, TableName tableName, boolean setVersion,
149 boolean acl) throws IOException {
150 if (!admin.tableExists(tableName)) {
151 HTableDescriptor htd = new HTableDescriptor(tableName);
152 HColumnDescriptor family = new HColumnDescriptor(FAMILY_NAME);
153 if (setVersion) {
154 family.setMaxVersions(DEFAULT_TABLES_COUNT);
155 }
156 htd.addFamily(family);
157 admin.createTable(htd);
158 if (acl) {
159 LOG.info("Granting permissions for user " + USER.getShortName());
160 Permission.Action[] actions = { Permission.Action.READ };
161 try {
162 AccessControlClient.grant(ConnectionFactory.createConnection(getConf()), tableName,
163 USER.getShortName(), null, null, actions);
164 } catch (Throwable e) {
165 LOG.fatal("Error in granting permission for the user " + USER.getShortName(), e);
166 throw new IOException(e);
167 }
168 }
169 }
170 }
171
172 @Override
173 protected void setMapperForGenerator(Job job) {
174 job.setMapperClass(VisibilityGeneratorMapper.class);
175 }
176
177 static class VisibilityGeneratorMapper extends GeneratorMapper {
178 BufferedMutator[] tables = new BufferedMutator[DEFAULT_TABLES_COUNT];
179
180 @Override
181 protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException,
182 InterruptedException {
183 super.setup(context);
184 }
185
186 @Override
187 protected void instantiateHTable() throws IOException {
188 for (int i = 0; i < DEFAULT_TABLES_COUNT; i++) {
189 BufferedMutatorParams params = new BufferedMutatorParams(getTableName(i));
190 params.writeBufferSize(4 * 1024 * 1024);
191 BufferedMutator table = connection.getBufferedMutator(params);
192 this.tables[i] = table;
193 }
194 }
195
196 @Override
197 protected void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)
198 throws IOException, InterruptedException {
199 for (int i = 0; i < DEFAULT_TABLES_COUNT; i++) {
200 if (tables[i] != null) {
201 tables[i].close();
202 }
203 }
204 }
205
206 @Override
207 protected void persist(org.apache.hadoop.mapreduce.Mapper.Context output, long count,
208 byte[][] prev, byte[][] current, byte[] id) throws IOException {
209 String visibilityExps = "";
210 String[] split = labels.split(COMMA);
211 for (int i = 0; i < current.length; i++) {
212 for (int j = 0; j < DEFAULT_TABLES_COUNT; j++) {
213 Put put = new Put(current[i]);
214 put.add(FAMILY_NAME, COLUMN_PREV, prev == null ? NO_KEY : prev[i]);
215
216 if (count >= 0) {
217 put.add(FAMILY_NAME, COLUMN_COUNT, Bytes.toBytes(count + i));
218 }
219 if (id != null) {
220 put.add(FAMILY_NAME, COLUMN_CLIENT, id);
221 }
222 visibilityExps = split[j * 2] + OR + split[(j * 2) + 1];
223 put.setCellVisibility(new CellVisibility(visibilityExps));
224 tables[j].mutate(put);
225 try {
226 Thread.sleep(1);
227 } catch (InterruptedException e) {
228 throw new IOException();
229 }
230 }
231 if (i % 1000 == 0) {
232
233 output.progress();
234 }
235 }
236 }
237 }
238 }
239
240 static class Copier extends Configured implements Tool {
241 private static final Log LOG = LogFactory.getLog(Copier.class);
242 private TableName tableName;
243 private int labelIndex;
244 private boolean delete;
245
246 public Copier(TableName tableName, int index, boolean delete) {
247 this.tableName = tableName;
248 this.labelIndex = index;
249 this.delete = delete;
250 }
251
252 public int runCopier(String outputDir) throws Exception {
253 Job job = null;
254 Scan scan = null;
255 job = new Job(getConf());
256 job.setJobName("Data copier");
257 job.getConfiguration().setInt("INDEX", labelIndex);
258 job.getConfiguration().set("LABELS", labels);
259 job.setJarByClass(getClass());
260 scan = new Scan();
261 scan.setCacheBlocks(false);
262 scan.setRaw(true);
263
264 String[] split = labels.split(COMMA);
265 scan.setAuthorizations(new Authorizations(split[this.labelIndex * 2],
266 split[(this.labelIndex * 2) + 1]));
267 if (delete) {
268 LOG.info("Running deletes");
269 } else {
270 LOG.info("Running copiers");
271 }
272 if (delete) {
273 TableMapReduceUtil.initTableMapperJob(tableName.getNameAsString(), scan,
274 VisibilityDeleteImport.class, null, null, job);
275 } else {
276 TableMapReduceUtil.initTableMapperJob(tableName.getNameAsString(), scan,
277 VisibilityImport.class, null, null, job);
278 }
279 job.getConfiguration().setBoolean("mapreduce.map.speculative", false);
280 job.getConfiguration().setBoolean("mapreduce.reduce.speculative", false);
281 TableMapReduceUtil.initTableReducerJob(COMMON_TABLE_NAME, null, job, null, null, null, null);
282 TableMapReduceUtil.addDependencyJars(job);
283 TableMapReduceUtil.addDependencyJars(job.getConfiguration(), AbstractHBaseTool.class);
284 TableMapReduceUtil.initCredentials(job);
285 job.setNumReduceTasks(0);
286 boolean success = job.waitForCompletion(true);
287 return success ? 0 : 1;
288 }
289
290 @Override
291 public int run(String[] arg0) throws Exception {
292
293 return 0;
294 }
295 }
296
297 static class VisibilityImport extends Import.Importer {
298 private int index;
299 private String labels;
300 private String[] split;
301
302 @Override
303 public void setup(org.apache.hadoop.mapreduce.Mapper.Context context) {
304 index = context.getConfiguration().getInt(INDEX_KEY, -1);
305 labels = context.getConfiguration().get(LABELS_KEY);
306 split = labels.split(COMMA);
307 super.setup(context);
308 }
309
310 @Override
311 protected void addPutToKv(Put put, Cell kv) throws IOException {
312 String visibilityExps = split[index * 2] + OR + split[(index * 2) + 1];
313 put.setCellVisibility(new CellVisibility(visibilityExps));
314 super.addPutToKv(put, kv);
315 }
316 }
317
318 static class VisibilityDeleteImport extends Import.Importer {
319 private int index;
320 private String labels;
321 private String[] split;
322
323 @Override
324 public void setup(org.apache.hadoop.mapreduce.Mapper.Context context) {
325 index = context.getConfiguration().getInt(INDEX_KEY, -1);
326 labels = context.getConfiguration().get(LABELS_KEY);
327 split = labels.split(COMMA);
328 super.setup(context);
329 }
330
331
332 @Override
333 protected void processKV(ImmutableBytesWritable key, Result result,
334 org.apache.hadoop.mapreduce.Mapper.Context context, Put put,
335 org.apache.hadoop.hbase.client.Delete delete) throws
336 IOException, InterruptedException {
337 String visibilityExps = split[index * 2] + OR + split[(index * 2) + 1];
338 for (Cell kv : result.rawCells()) {
339
340 if (kv == null)
341 continue;
342
343 if (delete == null) {
344 delete = new Delete(key.get());
345 }
346 delete.setCellVisibility(new CellVisibility(visibilityExps));
347 delete.deleteFamily(kv.getFamily());
348 }
349 if (delete != null) {
350 context.write(key, delete);
351 }
352 }
353 }
354
355 @Override
356 protected void addOptions() {
357 super.addOptions();
358 addOptWithArg("u", USER_OPT, "User name");
359 }
360
361 @Override
362 protected void processOptions(CommandLine cmd) {
363 super.processOptions(cmd);
364 if (cmd.hasOption(USER_OPT)) {
365 userName = cmd.getOptionValue(USER_OPT);
366 }
367
368 }
369 @Override
370 public void setUpCluster() throws Exception {
371 util = getTestingUtil(null);
372 Configuration conf = util.getConfiguration();
373 VisibilityTestUtil.enableVisiblityLabels(conf);
374 conf.set("hbase.superuser", User.getCurrent().getName());
375 conf.setBoolean("dfs.permissions", false);
376 USER = User.createUserForTesting(conf, userName, new String[] {});
377 super.setUpCluster();
378 addLabels();
379 }
380
381 static TableName getTableName(int i) {
382 return TableName.valueOf(tableName + UNDER_SCORE + i);
383 }
384
385 private void addLabels() throws Exception {
386 try {
387 VisibilityClient.addLabels(util.getConnection(), labels.split(COMMA));
388 VisibilityClient.setAuths(util.getConnection(), labels.split(COMMA), USER.getName());
389 } catch (Throwable t) {
390 throw new IOException(t);
391 }
392 }
393
394 static class VisibilityVerify extends Verify {
395 private static final Log LOG = LogFactory.getLog(VisibilityVerify.class);
396 private TableName tableName;
397 private int labelIndex;
398
399 public VisibilityVerify(String tableName, int index) {
400 this.tableName = TableName.valueOf(tableName);
401 this.labelIndex = index;
402 }
403
404 @Override
405 public int run(final Path outputDir, final int numReducers) throws Exception {
406 LOG.info("Running Verify with outputDir=" + outputDir + ", numReducers=" + numReducers);
407 PrivilegedExceptionAction<Integer> scanAction = new PrivilegedExceptionAction<Integer>() {
408 @Override
409 public Integer run() throws Exception {
410 return doVerify(outputDir, numReducers);
411 }
412 };
413 return USER.runAs(scanAction);
414 }
415
416 private int doVerify(Path outputDir, int numReducers) throws IOException, InterruptedException,
417 ClassNotFoundException {
418 job = new Job(getConf());
419
420 job.setJobName("Link Verifier");
421 job.setNumReduceTasks(numReducers);
422 job.setJarByClass(getClass());
423
424 setJobScannerConf(job);
425
426 Scan scan = new Scan();
427 scan.addColumn(FAMILY_NAME, COLUMN_PREV);
428 scan.setCaching(10000);
429 scan.setCacheBlocks(false);
430 String[] split = labels.split(COMMA);
431
432 scan.setAuthorizations(new Authorizations(split[this.labelIndex * 2],
433 split[(this.labelIndex * 2) + 1]));
434
435 TableMapReduceUtil.initTableMapperJob(tableName.getName(), scan, VerifyMapper.class,
436 BytesWritable.class, BytesWritable.class, job);
437 TableMapReduceUtil.addDependencyJars(job.getConfiguration(), AbstractHBaseTool.class);
438
439 job.getConfiguration().setBoolean("mapreduce.map.speculative", false);
440
441 job.setReducerClass(VerifyReducer.class);
442 job.setOutputFormatClass(TextOutputFormat.class);
443 TextOutputFormat.setOutputPath(job, outputDir);
444 boolean success = job.waitForCompletion(true);
445
446 return success ? 0 : 1;
447 }
448
449 @Override
450 protected void handleFailure(Counters counters) throws IOException {
451 Configuration conf = job.getConfiguration();
452 HConnection conn = HConnectionManager.getConnection(conf);
453 TableName tableName = TableName.valueOf(COMMON_TABLE_NAME);
454 CounterGroup g = counters.getGroup("undef");
455 Iterator<Counter> it = g.iterator();
456 while (it.hasNext()) {
457 String keyString = it.next().getName();
458 byte[] key = Bytes.toBytes(keyString);
459 HRegionLocation loc = conn.relocateRegion(tableName, key);
460 LOG.error("undefined row " + keyString + ", " + loc);
461 }
462 g = counters.getGroup("unref");
463 it = g.iterator();
464 while (it.hasNext()) {
465 String keyString = it.next().getName();
466 byte[] key = Bytes.toBytes(keyString);
467 HRegionLocation loc = conn.relocateRegion(tableName, key);
468 LOG.error("unreferred row " + keyString + ", " + loc);
469 }
470 }
471 }
472
473 static class VisibilityLoop extends Loop {
474 private static final int SLEEP_IN_MS = 5000;
475 private static final Log LOG = LogFactory.getLog(VisibilityLoop.class);
476 IntegrationTestBigLinkedListWithVisibility it;
477
478 @Override
479 protected void runGenerator(int numMappers, long numNodes, String outputDir, Integer width,
480 Integer wrapMultiplier, Integer numWalkers) throws Exception {
481 Path outputPath = new Path(outputDir);
482 UUID uuid = UUID.randomUUID();
483 Path generatorOutput = new Path(outputPath, uuid.toString());
484
485 Generator generator = new VisibilityGenerator();
486 generator.setConf(getConf());
487 int retCode = generator.run(numMappers, numNodes, generatorOutput, width, wrapMultiplier,
488 numWalkers);
489 if (retCode > 0) {
490 throw new RuntimeException("Generator failed with return code: " + retCode);
491 }
492 }
493
494 protected void runDelete(int numMappers, long numNodes, String outputDir, Integer width,
495 Integer wrapMultiplier, int tableIndex) throws Exception {
496 LOG.info("Running copier on table "+IntegrationTestBigLinkedListWithVisibility.getTableName(tableIndex));
497 Copier copier = new Copier(
498 IntegrationTestBigLinkedListWithVisibility.getTableName(tableIndex), tableIndex, true);
499 copier.setConf(getConf());
500 copier.runCopier(outputDir);
501 Thread.sleep(SLEEP_IN_MS);
502 }
503
504 protected void runVerify(String outputDir, int numReducers, long expectedNumNodes,
505 boolean allTables) throws Exception {
506 Path outputPath = new Path(outputDir);
507
508 if (allTables) {
509 for (int i = 0; i < DEFAULT_TABLES_COUNT; i++) {
510 LOG.info("Verifying table " + i);
511 sleep(SLEEP_IN_MS);
512 UUID uuid = UUID.randomUUID();
513 Path iterationOutput = new Path(outputPath, uuid.toString());
514 Verify verify = new VisibilityVerify(getTableName(i).getNameAsString(), i);
515 verify(numReducers, expectedNumNodes, iterationOutput, verify);
516 }
517 }
518 for (int i = 0; i < DEFAULT_TABLES_COUNT; i++) {
519 runVerifyCommonTable(outputDir, numReducers, expectedNumNodes, i);
520 }
521 }
522
523 private void runVerify(String outputDir, int numReducers, long expectedNodes, int tableIndex)
524 throws Exception {
525 long temp = expectedNodes;
526 for (int i = 0; i < DEFAULT_TABLES_COUNT; i++) {
527 if (i <= tableIndex) {
528 expectedNodes = 0;
529 } else {
530 expectedNodes = temp;
531 }
532 LOG.info("Verifying data in the table with index "+i+ " and expected nodes is "+expectedNodes);
533 runVerifyCommonTable(outputDir, numReducers, expectedNodes, i);
534 }
535 }
536
537 private void sleep(long ms) throws InterruptedException {
538 Thread.sleep(ms);
539 }
540
541 protected void runVerifyCommonTable(String outputDir, int numReducers, long expectedNumNodes,
542 int index) throws Exception {
543 LOG.info("Verifying common table with index " + index);
544 sleep(SLEEP_IN_MS);
545 Path outputPath = new Path(outputDir);
546 UUID uuid = UUID.randomUUID();
547 Path iterationOutput = new Path(outputPath, uuid.toString());
548 Verify verify = new VisibilityVerify(TableName.valueOf(COMMON_TABLE_NAME).getNameAsString(),
549 index);
550 verify(numReducers, expectedNumNodes, iterationOutput, verify);
551 }
552
553 protected void runCopier(String outputDir) throws Exception {
554 for (int i = 0; i < DEFAULT_TABLES_COUNT; i++) {
555 LOG.info("Running copier " + IntegrationTestBigLinkedListWithVisibility.getTableName(i));
556 sleep(SLEEP_IN_MS);
557 Copier copier = new Copier(IntegrationTestBigLinkedListWithVisibility.getTableName(i), i,
558 false);
559 copier.setConf(getConf());
560 copier.runCopier(outputDir);
561 }
562 }
563
564 private void verify(int numReducers, long expectedNumNodes,
565 Path iterationOutput, Verify verify) throws Exception {
566 verify.setConf(getConf());
567 int retCode = verify.run(iterationOutput, numReducers);
568 if (retCode > 0) {
569 throw new RuntimeException("Verify.run failed with return code: " + retCode);
570 }
571
572 if (!verify.verify(expectedNumNodes)) {
573 throw new RuntimeException("Verify.verify failed");
574 }
575
576 LOG.info("Verify finished with succees. Total nodes=" + expectedNumNodes);
577 }
578
579 @Override
580 public int run(String[] args) throws Exception {
581 if (args.length < 5) {
582 System.err
583 .println("Usage: Loop <num iterations> " +
584 "<num mappers> <num nodes per mapper> <output dir> " +
585 "<num reducers> [<width> <wrap multiplier>]");
586 return 1;
587 }
588 LOG.info("Running Loop with args:" + Arrays.deepToString(args));
589
590 int numIterations = Integer.parseInt(args[0]);
591 int numMappers = Integer.parseInt(args[1]);
592 long numNodes = Long.parseLong(args[2]);
593 String outputDir = args[3];
594 int numReducers = Integer.parseInt(args[4]);
595 Integer width = (args.length < 6) ? null : Integer.parseInt(args[5]);
596 Integer wrapMultiplier = (args.length < 7) ? null : Integer.parseInt(args[6]);
597 long expectedNumNodes = 0;
598
599 if (numIterations < 0) {
600 numIterations = Integer.MAX_VALUE;
601 }
602
603 for (int i = 0; i < numIterations; i++) {
604 LOG.info("Starting iteration = " + i);
605 LOG.info("Generating data");
606
607 runGenerator(numMappers, numNodes, outputDir, width, wrapMultiplier, 0);
608 expectedNumNodes += numMappers * numNodes;
609
610
611 LOG.info("Running copier");
612 sleep(SLEEP_IN_MS);
613 runCopier(outputDir);
614 LOG.info("Verifying copied data");
615 sleep(SLEEP_IN_MS);
616 runVerify(outputDir, numReducers, expectedNumNodes, true);
617 sleep(SLEEP_IN_MS);
618 for (int j = 0; j < DEFAULT_TABLES_COUNT; j++) {
619 LOG.info("Deleting data on table with index: "+j);
620 runDelete(numMappers, numNodes, outputDir, width, wrapMultiplier, j);
621 sleep(SLEEP_IN_MS);
622 LOG.info("Verifying common table after deleting");
623 runVerify(outputDir, numReducers, expectedNumNodes, j);
624 sleep(SLEEP_IN_MS);
625 }
626 }
627 return 0;
628 }
629 }
630
631 @Override
632 @Test
633 public void testContinuousIngest() throws IOException, Exception {
634
635
636 int ret = ToolRunner.run(
637 getTestingUtil(getConf()).getConfiguration(),
638 new VisibilityLoop(),
639 new String[] { "1", "1", "20000",
640 util.getDataTestDirOnTestFS("IntegrationTestBigLinkedListWithVisibility").toString(),
641 "1", "10000" });
642 org.junit.Assert.assertEquals(0, ret);
643 }
644
645 public static void main(String[] args) throws Exception {
646 Configuration conf = HBaseConfiguration.create();
647 IntegrationTestingUtility.setUseDistributedCluster(conf);
648 int ret = ToolRunner.run(conf, new IntegrationTestBigLinkedListWithVisibility(), args);
649 System.exit(ret);
650 }
651
652 @Override
653 protected MonkeyFactory getDefaultMonkeyFactory() {
654 return MonkeyFactory.getFactory(MonkeyFactory.CALM);
655 }
656
657 @Override
658 public int runTestFromCommandLine() throws Exception {
659 Tool tool = null;
660 Loop loop = new VisibilityLoop();
661 loop.it = this;
662 tool = loop;
663 return ToolRunner.run(getConf(), tool, otherArgs);
664 }
665 }