gyfora commented on a change in pull request #103:
URL: https://github.com/apache/bahir-flink/pull/103#discussion_r553367688
##########
File path:
flink-connector-kudu/src/main/java/org/apache/flink/connectors/kudu/streaming/KuduSink.java
##########
@@ -97,6 +97,21 @@ public void invoke(IN value) throws Exception {
}
}
+ /**
+ * new invoke api
+ * @param value input
+ * @param context runtime context
+ * @throws Exception
+ */
+ @Override
+ public void invoke(IN value, Context context) throws Exception {
Review comment:
Code duplication, this should invoke the other method or vice versa
##########
File path:
flink-connector-kudu/src/main/java/org/apache/flink/connectors/kudu/table/utils/KuduTableUtils.java
##########
@@ -79,10 +80,19 @@ public static KuduTableInfo createTableInfo(String
tableName, TableSchema schema
ColumnSchemasFactory schemasFactory = () ->
toKuduConnectorColumns(columns, keyColumns);
List<String> hashColumns = getHashColumns(props);
int replicas =
Optional.ofNullable(props.get(KuduTableFactory.KUDU_REPLICAS)).map(Integer::parseInt).orElse(1);
+ // if hash partitions nums not exists,default 1;
+ int hashPartitionNums =
Optional.ofNullable(props.get(KUDU_HASH_PARTITION_NUMS)).map(Integer::parseInt).orElse(3);
+ // if table owner is null,default 'admin';
+ String tableOwner =
Optional.ofNullable(props.get(KUDU_TABLE_OWNER)).orElse("admin");
+
+ PartialRow lowerRow = new PartialRow(new
Schema(schemasFactory.getColumnSchemas()));
+ PartialRow upper = new PartialRow(new
Schema(schemasFactory.getColumnSchemas()));
+
CreateTableOptionsFactory optionsFactory = () -> new
CreateTableOptions()
.setNumReplicas(replicas)
- .addHashPartitions(hashColumns, replicas * 2);
+ .addHashPartitions(hashColumns, hashPartitionNums)
Review comment:
Why did we change the default from replicas * 2 to hardcoded 3?
----------------------------------------------------------------
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]