JNSimba commented on code in PR #288: URL: https://github.com/apache/doris-flink-connector/pull/288#discussion_r1446932572
########## flink-doris-connector/src/main/java/org/apache/doris/flink/tools/cdc/DatabaseSync.java: ########## @@ -338,6 +349,67 @@ protected HashMap<Pattern, String> multiToOneRulesParser( return multiToOneRulesPattern; } + /** + * Get table buckets Map. + * + * @param tableBuckets the string of tableBuckets, eg:student:10,student_info:20,student.*:30 + * @return The table name and buckets map. The key is table name, the value is buckets. + */ + public Map<String, Integer> getTableBuckets(String tableBuckets) { + Map<String, Integer> tableBucketsMap = new HashMap<>(); + String[] tableBucketsArray = tableBuckets.split(","); + for (String tableBucket : tableBucketsArray) { + String[] tableBucketArray = tableBucket.split(":"); + tableBucketsMap.put( + tableBucketArray[0].trim(), Integer.parseInt(tableBucketArray[1].trim())); + } + return tableBucketsMap; Review Comment: please add ut, thanks -- 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. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org