accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/6] git commit: ACCUMULO-3015 Ensure table name is serialized in RangeInputSplit.
Date Fri, 25 Jul 2014 04:17:44 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.5.2-SNAPSHOT 641d42cd1 -> f848178e7
  refs/heads/1.6.1-SNAPSHOT f08bbfee2 -> ceb1a74d0
  refs/heads/master c45315a76 -> 46ab1f616


ACCUMULO-3015 Ensure table name is serialized in RangeInputSplit.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f848178e
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f848178e
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f848178e

Branch: refs/heads/1.5.2-SNAPSHOT
Commit: f848178e7ae675f27858aa7474974fb17b19a07f
Parents: 641d42c
Author: Josh Elser <elserj@apache.org>
Authored: Fri Jul 25 00:05:56 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Jul 25 00:05:56 2014 -0400

----------------------------------------------------------------------
 .../accumulo/core/client/mapreduce/RangeInputSplit.java     | 9 +++++++++
 .../accumulo/core/client/mapreduce/RangeInputSplitTest.java | 6 ++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f848178e/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
index 05316a1..15c6185 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
@@ -144,6 +144,9 @@ public class RangeInputSplit extends InputSplit implements Writable {
   @Override
   public void readFields(DataInput in) throws IOException {
     range.readFields(in);
+    if (in.readBoolean()) {
+      table = in.readUTF();
+    }
     int numLocs = in.readInt();
     locations = new String[numLocs];
     for (int i = 0; i < numLocs; ++i)
@@ -220,6 +223,12 @@ public class RangeInputSplit extends InputSplit implements Writable {
   @Override
   public void write(DataOutput out) throws IOException {
     range.write(out);
+
+    out.writeBoolean(null != table);
+    if (null != table) {
+      out.writeUTF(table);
+    }
+
     out.writeInt(locations.length);
     for (int i = 0; i < locations.length; ++i)
       out.writeUTF(locations[i]);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f848178e/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
index 78597ac..e12090e 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
@@ -77,7 +77,8 @@ public class RangeInputSplitTest {
     setting = new IteratorSetting(100, WholeRowIterator.class);
     setting.addOption("bar", "foo");
     iterators.add(setting);
-    
+
+    split.setTable("table");
     split.setAuths(new Authorizations("foo"));
     split.setOffline(true);
     split.setIsolatedScan(true);
@@ -103,7 +104,8 @@ public class RangeInputSplitTest {
     
     Assert.assertEquals(split.getRange(), newSplit.getRange());
     Assert.assertArrayEquals(split.getLocations(), newSplit.getLocations());
-    
+
+    Assert.assertEquals(split.getTable(), newSplit.getTable());
     Assert.assertEquals(split.getAuths(), newSplit.getAuths());
     Assert.assertEquals(split.isOffline(), newSplit.isOffline());
     Assert.assertEquals(split.isIsolatedScan(), newSplit.isOffline());


Mime
View raw message