Skip to content
Permalink
Browse files
Remove unused imports (with formatting)
  • Loading branch information
ctubbsii committed Feb 18, 2016
1 parent c305d6a commit f4098d75dbd7fd5959ef5ebe7e8b3ef4be6f8c9d
Showing 1 changed file with 14 additions and 19 deletions.
@@ -25,8 +25,6 @@
import io.fluo.api.client.FluoClient;
import io.fluo.api.client.FluoFactory;
import io.fluo.api.config.FluoConfiguration;
import io.fluo.api.data.Bytes;
import io.fluo.api.data.RowColumn;
import io.fluo.core.util.AccumuloUtil;
import io.fluo.mapreduce.FluoKeyValue;
import io.fluo.mapreduce.FluoKeyValueGenerator;
@@ -50,19 +48,18 @@
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;

public class Init extends Configured implements Tool {
public class Init extends Configured implements Tool {

public static final String TRIE_STOP_LEVEL_PROP = FluoConfiguration.FLUO_PREFIX + ".stress.trie.stopLevel";
public static final String TRIE_NODE_SIZE_PROP = FluoConfiguration.FLUO_PREFIX + ".stress.trie.node.size";

public static class UniqueReducer extends Reducer<LongWritable,NullWritable,LongWritable,NullWritable>{
public static class UniqueReducer extends Reducer<LongWritable,NullWritable,LongWritable,NullWritable> {
@Override
protected void reduce(LongWritable key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {
context.write(key, NullWritable.get());
}
}


public static class InitMapper extends Mapper<LongWritable,NullWritable,Text,LongWritable> {

private int stopLevel;
@@ -91,13 +88,12 @@ protected void map(LongWritable key, NullWritable val, Context context) throws I
}
}

public static class InitCombiner extends Reducer<Text,LongWritable,Text,LongWritable>{

public static class InitCombiner extends Reducer<Text,LongWritable,Text,LongWritable> {

private LongWritable outputVal = new LongWritable();

@Override
protected void reduce(Text key, Iterable<LongWritable> values, Context context) throws IOException, InterruptedException{
protected void reduce(Text key, Iterable<LongWritable> values, Context context) throws IOException, InterruptedException {
long sum = 0;
for (LongWritable l : values) {
sum += l.get();
@@ -108,18 +104,17 @@ protected void reduce(Text key, Iterable<LongWritable> values, Context context)
}
}


public static class InitReducer extends Reducer<Text,LongWritable,Key,Value>{
public static class InitReducer extends Reducer<Text,LongWritable,Key,Value> {
private FluoKeyValueGenerator fkvg = new FluoKeyValueGenerator();

@Override
protected void reduce(Text key, Iterable<LongWritable> values, Context context) throws IOException, InterruptedException{
protected void reduce(Text key, Iterable<LongWritable> values, Context context) throws IOException, InterruptedException {
long sum = 0;
for (LongWritable l : values) {
sum += l.get();
}

fkvg.setRow(key).setColumn(Constants.COUNT_SEEN_COL).setValue(sum+"");
fkvg.setRow(key).setColumn(Constants.COUNT_SEEN_COL).setValue(sum + "");

FluoKeyValue[] kvs = fkvg.getKeyValues();
for (FluoKeyValue kv : kvs) {
@@ -141,13 +136,13 @@ public int run(String[] args) throws Exception {

int stopLevel;
int nodeSize;
try(FluoClient client = FluoFactory.newClient(props)){
try (FluoClient client = FluoFactory.newClient(props)) {
nodeSize = client.getAppConfiguration().getInt(Constants.NODE_SIZE_PROP);
stopLevel = client.getAppConfiguration().getInt(Constants.STOP_LEVEL_PROP);
}

int ret = unique(input, new Path(tmp,"nums"));
if(ret != 0)
int ret = unique(input, new Path(tmp, "nums"));
if (ret != 0)
return ret;

return buildTree(nodeSize, props, tmp, stopLevel);
@@ -157,7 +152,7 @@ private int unique(Path input, Path tmp) throws Exception {
Job job = Job.getInstance(getConf());
job.setJarByClass(Init.class);

job.setJobName(Init.class.getName()+"_unique");
job.setJobName(Init.class.getName() + "_unique");

job.setInputFormatClass(SequenceFileInputFormat.class);
SequenceFileInputFormat.addInputPath(job, input);
@@ -180,7 +175,7 @@ private int buildTree(int nodeSize, FluoConfiguration props, Path tmp, int stopL

job.setJarByClass(Init.class);

job.setJobName(Init.class.getName()+"_load");
job.setJobName(Init.class.getName() + "_load");

job.setMapOutputKeyClass(Text.class);
job.setMapOutputValueClass(LongWritable.class);
@@ -214,10 +209,10 @@ private int buildTree(int nodeSize, FluoConfiguration props, Path tmp, int stopL

boolean success = job.waitForCompletion(true);

if(success){
if (success) {
Path failPath = new Path(tmp, "failures");
fs.mkdirs(failPath);
conn.tableOperations().importDirectory(props.getAccumuloTable(), outPath.toString(),failPath.toString(), false);
conn.tableOperations().importDirectory(props.getAccumuloTable(), outPath.toString(), failPath.toString(), false);
}
return success ? 0 : 1;
}

0 comments on commit f4098d7

Please sign in to comment.