You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by dh...@apache.org on 2016/07/27 18:08:21 UTC

[1/2] incubator-beam git commit: Closes #728

Repository: incubator-beam
Updated Branches:
  refs/heads/master 4c0e11e50 -> ddd57d8b9


Closes #728


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

Branch: refs/heads/master
Commit: ddd57d8b94ee13a4fa7ef22968cd266b6f9d4f27
Parents: 4c0e11e d1238eb
Author: Dan Halperin <dh...@google.com>
Authored: Wed Jul 27 11:08:12 2016 -0700
Committer: Dan Halperin <dh...@google.com>
Committed: Wed Jul 27 11:08:12 2016 -0700

----------------------------------------------------------------------
 .../apache/beam/sdk/coders/CoderRegistry.java   | 29 ++++++++++----------
 1 file changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------



[2/2] incubator-beam git commit: CoderRegistry: make deprecated method private

Posted by dh...@apache.org.
CoderRegistry: make deprecated method private

This was part of the public API signature in Dataflow, but need not be in Beam.

Also remove a few unneeded publics in the same file.


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

Branch: refs/heads/master
Commit: d1238eb4eb3aae571121221e2a0b93268f8ac45f
Parents: 4c0e11e
Author: Dan Halperin <dh...@google.com>
Authored: Mon Jul 25 17:12:01 2016 -0700
Committer: Dan Halperin <dh...@google.com>
Committed: Wed Jul 27 11:08:12 2016 -0700

----------------------------------------------------------------------
 .../apache/beam/sdk/coders/CoderRegistry.java   | 29 ++++++++++----------
 1 file changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/d1238eb4/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java
index 50e4422..d9b988b 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -73,11 +74,13 @@ import javax.annotation.Nullable;
  *       the default {@code Coder} type. The {@link Coder} class must satisfy the requirements
  *       of {@link CoderProviders#fromStaticMethods}.
  *   <li>Fallback: A fallback {@link CoderProvider} is used to attempt to provide a {@link Coder}
- *       for any type. By default, this is {@link SerializableCoder#PROVIDER}, which can provide
- *       a {@link Coder} for any type that is serializable via Java serialization. The fallback
- *       {@link CoderProvider} can be get and set via {@link #getFallbackCoderProvider()}
- *       and {@link #setFallbackCoderProvider}. Multiple fallbacks can be chained together using
- *       {@link CoderProviders#firstOf}.
+ *       for any type. By default, there are two chained fallback coders:
+ *       {@link ProtoCoder#coderProvider}, which can provide a coder to efficiently serialize any
+ *       Protocol Buffers message, and then {@link SerializableCoder#PROVIDER}, which can provide a
+ *       {@link Coder} for any type that is serializable via Java serialization. The fallback
+ *       {@link CoderProvider} can be get and set respectively using
+ *       {@link #getFallbackCoderProvider()} and {@link #setFallbackCoderProvider}. Multiple
+ *       fallbacks can be chained together using {@link CoderProviders#firstOf}.
  * </ol>
  */
 public class CoderRegistry implements CoderProvider {
@@ -366,7 +369,8 @@ public class CoderRegistry implements CoderProvider {
    * providing a {@code Coder<T>} for a type {@code T}, then the registry will attempt to create
    * a {@link Coder} using this {@link CoderProvider}.
    *
-   * <p>By default, this is set to {@link SerializableCoder#PROVIDER}.
+   * <p>By default, this is set to the chain of {@link ProtoCoder#coderProvider()} and
+   * {@link SerializableCoder#PROVIDER}.
    *
    * <p>See {@link #getFallbackCoderProvider}.
    */
@@ -383,6 +387,8 @@ public class CoderRegistry implements CoderProvider {
     return fallbackCoderProvider;
   }
 
+  /////////////////////////////////////////////////////////////////////////////
+
   /**
    * Returns a {@code Map} from each of {@code baseClass}'s type parameters to the {@link Coder} to
    * use by default for it, in the context of {@code subClass}'s specialization of
@@ -413,11 +419,8 @@ public class CoderRegistry implements CoderProvider {
    * @param baseClass the base type, a parameterized class
    * @param knownCoders a map corresponding to the set of known {@link Coder Coders} indexed by
    * parameter name
-   *
-   * @deprecated this method is not part of the public interface and will be made private
    */
-  @Deprecated
-  public <T> Map<Type, Coder<?>> getDefaultCoders(
+  private <T> Map<Type, Coder<?>> getDefaultCoders(
       Class<? extends T> subClass,
       Class<T> baseClass,
       Map<Type, ? extends Coder<?>> knownCoders) {
@@ -525,8 +528,6 @@ public class CoderRegistry implements CoderProvider {
   }
 
 
-  /////////////////////////////////////////////////////////////////////////////
-
   /**
    * Thrown when a {@link Coder} cannot possibly encode a type, yet has been proposed as a
    * {@link Coder} for that type.
@@ -535,13 +536,13 @@ public class CoderRegistry implements CoderProvider {
     private Coder<?> coder;
     private Type type;
 
-    public IncompatibleCoderException(String message, Coder<?> coder, Type type) {
+    IncompatibleCoderException(String message, Coder<?> coder, Type type) {
       super(message);
       this.coder = coder;
       this.type = type;
     }
 
-    public IncompatibleCoderException(String message, Coder<?> coder, Type type, Throwable cause) {
+    IncompatibleCoderException(String message, Coder<?> coder, Type type, Throwable cause) {
       super(message, cause);
       this.coder = coder;
       this.type = type;