avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fo...@apache.org
Subject [avro] branch master updated: AVRO-2515: Expand access of ProtobufData methods (#612)
Date Thu, 22 Aug 2019 11:23:59 GMT
This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new bce00d9  AVRO-2515: Expand access of ProtobufData methods (#612)
bce00d9 is described below

commit bce00d9c4a44f66c6906e66cde21938935c00fc5
Author: Teodor Kostov <terusus@gmail.com>
AuthorDate: Thu Aug 22 13:23:53 2019 +0200

    AVRO-2515: Expand access of ProtobufData methods (#612)
    
    Chandged from private to public getSchema(FieldDescriptor) and
    getNamespace(FileDescriptor, Descriptor).
    
    The utility methods that deal with the conversion from Protobuf message
    descriptor to an Avro schema are now exposed on a more granular level.
    This will alow the library clients to use this functionality and not
    reinvent it. This will also help with extending the base functionality.
    For example, adding protobuf meta information to the schema as
    properties.
---
 .../protobuf/src/main/java/org/apache/avro/protobuf/ProtobufData.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lang/java/protobuf/src/main/java/org/apache/avro/protobuf/ProtobufData.java b/lang/java/protobuf/src/main/java/org/apache/avro/protobuf/ProtobufData.java
index da00535..5c403bb 100644
--- a/lang/java/protobuf/src/main/java/org/apache/avro/protobuf/ProtobufData.java
+++ b/lang/java/protobuf/src/main/java/org/apache/avro/protobuf/ProtobufData.java
@@ -226,7 +226,7 @@ public class ProtobufData extends GenericData {
     }
   }
 
-  private String getNamespace(FileDescriptor fd, Descriptor containing) {
+  public String getNamespace(FileDescriptor fd, Descriptor containing) {
     FileOptions o = fd.getOptions();
     String p = o.hasJavaPackage() ? o.getJavaPackage() : fd.getPackage();
     String outer = "";
@@ -268,7 +268,7 @@ public class ProtobufData extends GenericData {
 
   private static final Schema NULL = Schema.create(Schema.Type.NULL);
 
-  private Schema getSchema(FieldDescriptor f) {
+  public Schema getSchema(FieldDescriptor f) {
     Schema s = getNonRepeatedSchema(f);
     if (f.isRepeated())
       s = Schema.createArray(s);


Mime
View raw message