Permalink
Browse files

formatting tweaks, small fix to loader

  • Loading branch information...
zznate
zznate committed Jul 8, 2011
1 parent 28d18d1 commit bfe6a73d1c0a012cc1e3b3015c48bb69a1cddf75
@@ -89,18 +89,18 @@ public Integer call() throws Exception {
// parse
npanxxLine = new NpanxxLine(row);
//
- mutator.addInsertion(npanxxLine.getNpa()+npanxxLine.getNxx(), "Npanxx", HFactory.createStringColumn("city", npanxxLine.getCity()));
- mutator.addInsertion(npanxxLine.getNpa()+npanxxLine.getNxx(), "Npanxx", HFactory.createStringColumn("lat", Double.toString(npanxxLine.getLat())));
- mutator.addInsertion(npanxxLine.getNpa()+npanxxLine.getNxx(), "Npanxx", HFactory.createStringColumn("lng", Double.toString(npanxxLine.getLng())));
- mutator.addInsertion(npanxxLine.getNpa()+npanxxLine.getNxx(), "Npanxx", HFactory.createStringColumn("state", npanxxLine.getState()));
+ String key = npanxxLine.getNpa()+npanxxLine.getNxx();
+ mutator.addInsertion(key, "Npanxx", HFactory.createStringColumn("city", npanxxLine.getCity()));
+ mutator.addInsertion(key, "Npanxx", HFactory.createStringColumn("lat", Double.toString(npanxxLine.getLat())));
+ mutator.addInsertion(key, "Npanxx", HFactory.createStringColumn("lng", Double.toString(npanxxLine.getLng())));
+ mutator.addInsertion(key, "Npanxx", HFactory.createStringColumn("state", npanxxLine.getState()));
if ( count % 250 == 0 ) {
mutator.execute();
mutator.discardPendingMutations();
}
count++;
}
mutator.execute();
- // TODO Auto-generated method stub
log.info("found count {}", count);
return Integer.valueOf(count);
}
@@ -112,7 +112,6 @@ public Integer call() throws Exception {
NpanxxLine(String line) {
vals = line.split("\\s");
- //log.info("found vals: {}", vals[0]);
}
String getNpa() {
@@ -58,11 +58,10 @@ public static void main(String[] args) {
log.error("Problem executing command:",e);
}
}
- // NOTE: you can uncomment this line to leave the JVM running.
+ // NOTE: you can comment out this line to leave the JVM running.
// This will allow you to look at JMX statistics of what you just
// did and get a feel for Hector's JMX integration.
tutorialCluster.getConnectionManager().shutdown();
- System.exit(0);
}

0 comments on commit bfe6a73

Please sign in to comment.