You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by md...@apache.org on 2014/03/04 20:24:42 UTC
[03/10] git commit: ACCUMULO-2233 Get ranges from cloned table
ACCUMULO-2233 Get ranges from cloned table
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4bdebdb1
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4bdebdb1
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4bdebdb1
Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 4bdebdb1e5aaec75c678d91ff6b7d53ff65e3ec0
Parents: 759582b
Author: Mike Drob <md...@cloudera.com>
Authored: Mon Mar 3 12:52:08 2014 -0500
Committer: Mike Drob <md...@cloudera.com>
Committed: Tue Mar 4 09:19:40 2014 -0500
----------------------------------------------------------------------
.../server/test/continuous/ContinuousVerify.java | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/4bdebdb1/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java
----------------------------------------------------------------------
diff --git a/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java b/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java
index 6165d2a..9441cf5 100644
--- a/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java
+++ b/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java
@@ -168,15 +168,21 @@ public class ContinuousVerify extends Configured implements Tool {
Job job = new Job(getConf(), this.getClass().getSimpleName() + "_" + System.currentTimeMillis());
job.setJarByClass(this.getClass());
+ Set<Range> ranges = null;
String clone = table;
Connector conn = null;
+
if (scanOffline) {
Random random = new Random();
clone = table + "_" + String.format("%016x", Math.abs(random.nextLong()));
ZooKeeperInstance zki = new ZooKeeperInstance(instance, zookeepers);
conn = zki.getConnector(user, pass.getBytes());
conn.tableOperations().clone(table, clone, true, new HashMap<String,String>(), new HashSet<String>());
+ ranges = conn.tableOperations().splitRangeByTablets(clone, new Range(), Integer.parseInt(maxMaps));
conn.tableOperations().offline(clone);
+ } else {
+ ranges = new ZooKeeperInstance(instance, zookeepers).getConnector(user, pass).tableOperations()
+ .splitRangeByTablets(table, new Range(), Integer.parseInt(maxMaps));
}
job.setInputFormatClass(AccumuloInputFormat.class);
@@ -189,16 +195,8 @@ public class ContinuousVerify extends Configured implements Tool {
AccumuloInputFormat.setInputInfo(job.getConfiguration(), user, pass.getBytes(), clone, authorizations);
AccumuloInputFormat.setZooKeeperInstance(job.getConfiguration(), instance, zookeepers);
AccumuloInputFormat.setScanOffline(job.getConfiguration(), scanOffline);
-
- // set up ranges
- try {
- Set<Range> ranges = new ZooKeeperInstance(instance, zookeepers).getConnector(user, pass.getBytes()).tableOperations()
- .splitRangeByTablets(table, new Range(), Integer.parseInt(maxMaps));
- AccumuloInputFormat.setRanges(job.getConfiguration(), ranges);
- AccumuloInputFormat.disableAutoAdjustRanges(job.getConfiguration());
- } catch (Exception e) {
- throw new IOException(e);
- }
+ AccumuloInputFormat.setRanges(job.getConfiguration(), ranges);
+ AccumuloInputFormat.disableAutoAdjustRanges(job.getConfiguration());
job.setMapperClass(CMapper.class);
job.setMapOutputKeyClass(LongWritable.class);