beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhalp...@apache.org
Subject [4/5] beam git commit: [BEAM-1540] Restrict access level for Coders/Serializable classes
Date Mon, 27 Feb 2017 21:13:18 GMT
[BEAM-1540] Restrict access level for Coders/Serializable classes


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

Branch: refs/heads/master
Commit: 715b95ac584a57751c02c7f930c20b1e264fcaea
Parents: 0c857c7
Author: Ismaël Mejía <iemejia@gmail.com>
Authored: Thu Feb 23 10:09:34 2017 +0100
Committer: Dan Halperin <dhalperi@google.com>
Committed: Mon Feb 27 13:13:03 2017 -0800

----------------------------------------------------------------------
 .../apache/beam/sdk/io/hbase/HBaseMutationCoder.java |  2 +-
 .../apache/beam/sdk/io/hbase/HBaseResultCoder.java   | 15 ++++++++-------
 .../apache/beam/sdk/io/hbase/SerializableScan.java   |  2 +-
 3 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/715b95ac/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseMutationCoder.java
----------------------------------------------------------------------
diff --git a/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseMutationCoder.java
b/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseMutationCoder.java
index 356abc4..228e0b4 100644
--- a/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseMutationCoder.java
+++ b/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseMutationCoder.java
@@ -35,7 +35,7 @@ import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.Mut
  * A {@link Coder} that serializes and deserializes the {@link Mutation} objects using {@link
  * ProtobufUtil}.
  */
-public class HBaseMutationCoder extends AtomicCoder<Mutation> implements Serializable
{
+class HBaseMutationCoder extends AtomicCoder<Mutation> implements Serializable {
   private static final HBaseMutationCoder INSTANCE = new HBaseMutationCoder();
 
   private HBaseMutationCoder() {}

http://git-wip-us.apache.org/repos/asf/beam/blob/715b95ac/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseResultCoder.java
----------------------------------------------------------------------
diff --git a/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseResultCoder.java
b/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseResultCoder.java
index 8e5e128..94f324a 100644
--- a/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseResultCoder.java
+++ b/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseResultCoder.java
@@ -32,23 +32,24 @@ import org.apache.hadoop.hbase.protobuf.generated.ClientProtos;
  * A {@link Coder} that serializes and deserializes the {@link Result} objects using {@link
  * ProtobufUtil}.
  */
-public class HBaseResultCoder extends AtomicCoder<Result> implements Serializable {
-
+class HBaseResultCoder extends AtomicCoder<Result> implements Serializable {
   private static final HBaseResultCoder INSTANCE = new HBaseResultCoder();
 
+  private HBaseResultCoder() {}
+
   public static HBaseResultCoder of() {
     return INSTANCE;
   }
 
   @Override
-  public Result decode(InputStream inputStream, Coder.Context context)
-      throws IOException {
-    return ProtobufUtil.toResult(ClientProtos.Result.parseDelimitedFrom(inputStream));
+  public void encode(Result value, OutputStream outputStream, Coder.Context context)
+          throws IOException {
+    ProtobufUtil.toResult(value).writeDelimitedTo(outputStream);
   }
 
   @Override
-  public void encode(Result value, OutputStream outputStream, Coder.Context context)
+  public Result decode(InputStream inputStream, Coder.Context context)
       throws IOException {
-    ProtobufUtil.toResult(value).writeDelimitedTo(outputStream);
+    return ProtobufUtil.toResult(ClientProtos.Result.parseDelimitedFrom(inputStream));
   }
 }

http://git-wip-us.apache.org/repos/asf/beam/blob/715b95ac/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/SerializableScan.java
----------------------------------------------------------------------
diff --git a/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/SerializableScan.java
b/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/SerializableScan.java
index ed2ec9e..df575b0 100644
--- a/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/SerializableScan.java
+++ b/sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/SerializableScan.java
@@ -28,7 +28,7 @@ import org.apache.hadoop.hbase.protobuf.generated.ClientProtos;
 /**
  * This is just a wrapper class to serialize HBase {@link Scan}.
  */
-public class SerializableScan implements Serializable {
+class SerializableScan implements Serializable {
     private transient Scan scan;
 
     public SerializableScan(Scan scan) {


Mime
View raw message