Search in sources :

Example 1 with ITaskDivideStrategy

use of org.apache.rocketmq.connect.hudi.strategy.ITaskDivideStrategy in project rocketmq-externals by apache.

the class HudiSinkConnector method taskConfigs.

@Override
public List<KeyValue> taskConfigs() {
    log.info("List.start");
    if (!configValid) {
        return new ArrayList<KeyValue>();
    }
    startMQAdminTools();
    buildRoute();
    DefaultKeyValue defaultKeyValue = new DefaultKeyValue();
    defaultKeyValue.put(HudiConnectConfig.CONN_HUDI_TABLE_PATH, sinkConnectConfig.getTablePath());
    defaultKeyValue.put(HudiConnectConfig.CONN_HUDI_TABLE_NAME, sinkConnectConfig.getTableName());
    defaultKeyValue.put(HudiConnectConfig.CONN_HUDI_INSERT_SHUFFLE_PARALLELISM, sinkConnectConfig.getInsertShuffleParallelism());
    defaultKeyValue.put(HudiConnectConfig.CONN_HUDI_UPSERT_SHUFFLE_PARALLELISM, sinkConnectConfig.getUpsertShuffleParallelism());
    defaultKeyValue.put(HudiConnectConfig.CONN_HUDI_DELETE_PARALLELISM, sinkConnectConfig.getDeleteParallelism());
    defaultKeyValue.put(HudiConnectConfig.CONN_SOURCE_RECORD_CONVERTER, sinkConnectConfig.getSrcRecordConverter());
    defaultKeyValue.put(HudiConnectConfig.CONN_TOPIC_NAMES, sinkConnectConfig.getTopicNames());
    defaultKeyValue.put(HudiConnectConfig.CONN_SCHEMA_PATH, sinkConnectConfig.getSchemaPath());
    defaultKeyValue.put(HudiConnectConfig.CONN_TASK_PARALLELISM, sinkConnectConfig.getTaskParallelism());
    defaultKeyValue.put(HudiConnectConfig.CONN_TASK_DIVIDE_STRATEGY, sinkConnectConfig.getTaskDivideStrategy());
    defaultKeyValue.put(HudiConnectConfig.CONN_WHITE_LIST, JSONObject.toJSONString(sinkConnectConfig.getWhiteList()));
    defaultKeyValue.put(HudiConnectConfig.CONN_SCHEMA_PATH, sinkConnectConfig.getSchemaPath());
    defaultKeyValue.put(HudiConnectConfig.CONN_TOPIC_ROUTE_INFO, JSONObject.toJSONString(sinkConnectConfig.getTopicRouteMap()));
    log.info("taskConfig : " + defaultKeyValue + ", sinkConnectConfig : " + sinkConnectConfig);
    ITaskDivideStrategy strategy = TaskDivideStrategyFactory.getInstance();
    List<KeyValue> taskConfigs = strategy.divide(defaultKeyValue);
    return taskConfigs;
}
Also used : DefaultKeyValue(io.openmessaging.internal.DefaultKeyValue) KeyValue(io.openmessaging.KeyValue) DefaultKeyValue(io.openmessaging.internal.DefaultKeyValue) ITaskDivideStrategy(org.apache.rocketmq.connect.hudi.strategy.ITaskDivideStrategy) ArrayList(java.util.ArrayList)

Aggregations

KeyValue (io.openmessaging.KeyValue)1 DefaultKeyValue (io.openmessaging.internal.DefaultKeyValue)1 ArrayList (java.util.ArrayList)1 ITaskDivideStrategy (org.apache.rocketmq.connect.hudi.strategy.ITaskDivideStrategy)1