Airblader commented on a change in pull request #15808:
URL: https://github.com/apache/flink/pull/15808#discussion_r656839951



##########
File path: 
flink-formats/flink-avro-confluent-registry/src/main/java/org/apache/flink/formats/avro/registry/confluent/ConfluentRegistryAvroDeserializationSchema.java
##########
@@ -84,14 +86,50 @@ private ConfluentRegistryAvroDeserializationSchema(
      */
     public static ConfluentRegistryAvroDeserializationSchema<GenericRecord> 
forGeneric(
             Schema schema, String url, int identityMapCapacity) {
+        return forGeneric(schema, url, identityMapCapacity, null);
+    }
+
+    /**
+     * Creates {@link ConfluentRegistryAvroDeserializationSchema} that 
produces {@link
+     * GenericRecord} using provided reader schema and looks up writer schema 
in Confluent Schema
+     * Registry.

Review comment:
       nit (and same below):
   
   ```suggestion
        * Creates {@link ConfluentRegistryAvroDeserializationSchema} that 
produces {@link
        * GenericRecord} using the provided reader schema and looks up the 
writer schema in the Confluent Schema
        * Registry.
   ```

##########
File path: 
flink-formats/flink-avro-confluent-registry/src/main/java/org/apache/flink/formats/avro/registry/confluent/ConfluentRegistryAvroDeserializationSchema.java
##########
@@ -84,14 +86,50 @@ private ConfluentRegistryAvroDeserializationSchema(
      */
     public static ConfluentRegistryAvroDeserializationSchema<GenericRecord> 
forGeneric(
             Schema schema, String url, int identityMapCapacity) {
+        return forGeneric(schema, url, identityMapCapacity, null);
+    }
+
+    /**
+     * Creates {@link ConfluentRegistryAvroDeserializationSchema} that 
produces {@link
+     * GenericRecord} using provided reader schema and looks up writer schema 
in Confluent Schema
+     * Registry.
+     *
+     * @param schema schema of produced records
+     * @param url URL of schema registry to connect
+     * @param registryConfigs map with additional schema registry configs (for 
example SSL
+     *     properties)
+     * @return deserialized record in form of {@link GenericRecord}
+     */
+    public static ConfluentRegistryAvroDeserializationSchema<GenericRecord> 
forGeneric(
+            Schema schema, String url, @Nullable Map<String, ?> 
registryConfigs) {
+        return forGeneric(schema, url, DEFAULT_IDENTITY_MAP_CAPACITY, 
registryConfigs);
+    }
+
+    /**
+     * Creates {@link ConfluentRegistryAvroDeserializationSchema} that 
produces {@link
+     * GenericRecord} using provided reader schema and looks up writer schema 
in Confluent Schema
+     * Registry.
+     *
+     * @param schema schema of produced records
+     * @param url URL of schema registry to connect
+     * @param identityMapCapacity maximum number of cached schema versions 
(default: 1000)

Review comment:
       Why is the default documented here? How would I pass an `int` that uses 
the default?

##########
File path: 
flink-formats/flink-avro-confluent-registry/src/main/java/org/apache/flink/formats/avro/registry/confluent/ConfluentRegistryAvroDeserializationSchema.java
##########
@@ -115,7 +153,45 @@ private ConfluentRegistryAvroDeserializationSchema(
     public static <T extends SpecificRecord>
             ConfluentRegistryAvroDeserializationSchema<T> forSpecific(
                     Class<T> tClass, String url, int identityMapCapacity) {
+        return forSpecific(tClass, url, identityMapCapacity, null);
+    }
+
+    /**
+     * Creates {@link AvroDeserializationSchema} that produces classes that 
were generated from Avro
+     * schema and looks up writer schema in Confluent Schema Registry.
+     *
+     * @param tClass class of record to be produced
+     * @param url URL of schema registry to connect
+     * @param registryConfigs map with additional schema registry configs (for 
example SSL
+     *     properties)
+     * @return deserialized record
+     */
+    public static <T extends SpecificRecord>
+            ConfluentRegistryAvroDeserializationSchema<T> forSpecific(
+                    Class<T> tClass, String url, @Nullable Map<String, ?> 
registryConfigs) {
+        return forSpecific(tClass, url, DEFAULT_IDENTITY_MAP_CAPACITY, 
registryConfigs);
+    }
+
+    /**
+     * Creates {@link AvroDeserializationSchema} that produces classes that 
were generated from Avro
+     * schema and looks up writer schema in Confluent Schema Registry.
+     *
+     * @param tClass class of record to be produced
+     * @param url URL of schema registry to connect
+     * @param identityMapCapacity maximum number of cached schema versions 
(default: 1000)

Review comment:
       Same as above




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to