accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JavaHokie <soozandjohny...@gmail.com>
Subject Re: AccumuloMultiTableInputFormat IllegalStatementException
Date Sat, 23 Aug 2014 05:00:04 GMT
Sure thing, here's my run method implementation:

	    Configuration configuration = new Configuration();
			
	    configuration.set("fs.defaultFS", "hdfs://127.0.0.1:8020");
            configuration.set("mapreduce.job.tracker", "localhost:54311");
            configuration.set("mapreduce.framework.name", "yarn");
            configuration.set("yarn.resourcemanager.address",
"localhost:8032");
		
		Job job = Job.getInstance(configuration);
		
		/*
		 * Set the basic stuff
		 */
		job.setJobName("TwitterJoin Query");
		job.setJarByClass(TwitterJoin.class);
		
		/*
		 * Set Mapper and Reducer Classes
		 */
		job.setMapperClass(TwitterJoinMapper.class);
		job.setReducerClass(TwitterJoinReducer.class);
		
	    /*
	     * Set the Mapper MapOutputKeyClass and MapOutputValueClass
	     */
	    job.setMapOutputKeyClass(Text.class);
	    job.setMapOutputValueClass(Text.class);
	    
	    /*
	     * Set the Reducer OutputKeyClass and OutputValueClass
	     */
	    job.setOutputKeyClass(Text.class);
	    job.setOutputValueClass(Mutation.class);
		
		/*
		 * Set InputFormat and OutputFormat classes
		 */
		job.setInputFormatClass(AccumuloMultiTableInputFormat.class);
		job.setOutputFormatClass(AccumuloOutputFormat.class);
		
		/*
		 * Configure InputFormat and OutputFormat Classes
		 */		
		Map<String,InputTableConfig> configs = new
HashMap<String,InputTableConfig>();
		
		List<Range> ranges = Lists.newArrayList(new Range("104587"),new
Range("105255"));
			
		InputTableConfig edgeConfig = new InputTableConfig();
		edgeConfig.setRanges(ranges);
		edgeConfig.setAutoAdjustRanges(true);
	
		InputTableConfig followerConfig = new InputTableConfig();
		followerConfig.setRanges(ranges);
		followerConfig.setAutoAdjustRanges(true);
		
		configs.put("following",followerConfig);
		configs.put("twitteredges",edgeConfig);

		AccumuloMultiTableInputFormat.setConnectorInfo(job,"root",new
PasswordToken("********".getBytes()));
	
AccumuloMultiTableInputFormat.setZooKeeperInstance(job,"localhost","localhost");
		AccumuloMultiTableInputFormat.setScanAuthorizations(job,new
Authorizations("private"));
		AccumuloMultiTableInputFormat.setInputTableConfigs(job, configs);
				
		AccumuloOutputFormat.setZooKeeperInstance(job,"localhost","localhost");
		AccumuloOutputFormat.setConnectorInfo(job,"root",new
PasswordToken("********".getBytes()));
		AccumuloOutputFormat.setCreateTables(job,true);
		AccumuloOutputFormat.setDefaultTableName(job,"twitteredgerollup");
		
		/*
		 * Kick off the job, wait for completion, and return applicable code
		 */
	    boolean success = job.waitForCompletion(true);
	    
	    if (success) {
	    	return 0;
	    }
	    
	    return 1;
	}



--
View this message in context: http://apache-accumulo.1065345.n5.nabble.com/AccumuloMultiTableInputFormat-IllegalStateException-tp11186p11193.html
Sent from the Users mailing list archive at Nabble.com.

Mime
View raw message