@Override public int run(String[] args) throws Exception { if (args.length != 2) { throw new IllegalArgumentException( "Usage : " + MRTester.class.getName() + " <table1> <table2>"); } String user = getAdminPrincipal(); AuthenticationToken pass = getAdminToken(); String table1 = args[0]; String table2 = args[1]; Job job = Job.getInstance(getConf(), this.getClass().getSimpleName() + "_" + System.currentTimeMillis()); job.setJarByClass(this.getClass()); job.setInputFormatClass(AccumuloMultiTableInputFormat.class); AccumuloMultiTableInputFormat.setConnectorInfo(job, user, pass); InputTableConfig tableConfig1 = new InputTableConfig(); InputTableConfig tableConfig2 = new InputTableConfig(); Map<String,InputTableConfig> configMap = new HashMap<>(); configMap.put(table1, tableConfig1); configMap.put(table2, tableConfig2); AccumuloMultiTableInputFormat.setInputTableConfigs(job, configMap); AccumuloMultiTableInputFormat.setZooKeeperInstance(job, getCluster().getClientConfig()); job.setMapperClass(TestMapper.class); job.setMapOutputKeyClass(Key.class); job.setMapOutputValueClass(Value.class); job.setOutputFormatClass(NullOutputFormat.class); job.setNumReduceTasks(0); job.waitForCompletion(true); return job.isSuccessful() ? 0 : 1; }
AccumuloMultiTableInputFormat.setInputTableConfigs(job, configs); job.setInputFormatClass(AccumuloMultiTableInputFormat.class);