accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cjno...@apache.org
Subject [5/6] git commit: ACCUMULO-3143 Offline scan property is now being properly serialized. Added verification that all other booleans are being serialized.
Date Fri, 19 Sep 2014 00:38:17 GMT
ACCUMULO-3143 Offline scan property is now being properly serialized. Added verification that
all other booleans are being serialized.


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

Branch: refs/heads/1.6.1-rc1
Commit: ddd2c3bc098531d8dadee1b5142cfb80c50f4c41
Parents: 7a40f7b
Author: Corey J. Nolet <cjnolet@gmail.com>
Authored: Thu Sep 18 20:11:41 2014 -0400
Committer: Corey J. Nolet <cjnolet@gmail.com>
Committed: Thu Sep 18 20:14:30 2014 -0400

----------------------------------------------------------------------
 .../core/client/mapreduce/InputTableConfig.java |  2 ++
 .../client/mapreduce/InputTableConfigTest.java  | 20 ++++++++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ddd2c3bc/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputTableConfig.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputTableConfig.java
b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputTableConfig.java
index e59451e..fa3b7eb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputTableConfig.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputTableConfig.java
@@ -281,6 +281,7 @@ public class InputTableConfig implements Writable {
     dataOutput.writeBoolean(autoAdjustRanges);
     dataOutput.writeBoolean(useLocalIterators);
     dataOutput.writeBoolean(useIsolatedScanners);
+    dataOutput.writeBoolean(offlineScan);
   }
 
   /**
@@ -325,6 +326,7 @@ public class InputTableConfig implements Writable {
     autoAdjustRanges = dataInput.readBoolean();
     useLocalIterators = dataInput.readBoolean();
     useIsolatedScanners = dataInput.readBoolean();
+    offlineScan = dataInput.readBoolean();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/ddd2c3bc/core/src/test/java/org/apache/accumulo/core/client/mapreduce/InputTableConfigTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/InputTableConfigTest.java
b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/InputTableConfigTest.java
index 7f5c7d8..4855094 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/InputTableConfigTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/InputTableConfigTest.java
@@ -16,8 +16,6 @@
  */
 package org.apache.accumulo.core.client.mapreduce;
 
-import static org.junit.Assert.assertEquals;
-
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.DataInputStream;
@@ -29,13 +27,14 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.accumulo.core.client.IteratorSetting;
-import org.apache.accumulo.core.client.mapreduce.InputTableConfig;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.util.Pair;
 import org.apache.hadoop.io.Text;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 public class InputTableConfigTest {
   
   private InputTableConfig tableQueryConfig;
@@ -52,7 +51,20 @@ public class InputTableConfigTest {
     
     assertEquals(tableQueryConfig, actualConfig);
   }
-  
+
+  @Test
+  public void testSerialization_allBooleans() throws IOException {
+    tableQueryConfig.setAutoAdjustRanges(false);
+    tableQueryConfig.setOfflineScan(true);
+    tableQueryConfig.setUseIsolatedScanners(true);
+    tableQueryConfig.setUseLocalIterators(true);
+    byte[] serialized = serialize(tableQueryConfig);
+    InputTableConfig actualConfig = deserialize(serialized);
+
+    assertEquals(tableQueryConfig, actualConfig);
+  }
+
+
   @Test
   public void testSerialization_ranges() throws IOException {
     List<Range> ranges = new ArrayList<Range>();


Mime
View raw message