EricJoy2048 commented on code in PR #3309: URL: https://github.com/apache/incubator-seatunnel/pull/3309#discussion_r1021195267
########## seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java: ########## @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.tablestore.config; + +import org.apache.seatunnel.api.configuration.Option; +import org.apache.seatunnel.api.configuration.Options; + +import java.io.Serializable; + +public class TablestoreConfig implements Serializable { + public static final Option<String> END_POINT = Options.key("end_point") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore end_point"); + public static final Option<String> INSTANCE_NAME = Options.key("instance_name") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore instance_name"); + public static final Option<String> ACCESS_KEY_ID = Options.key("access_key_id") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore access_key_id"); + public static final Option<String> ACCESS_KEY_SECRET = Options.key("access_key_secret") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore access_key_secret"); + public static final Option<String> TABLE = Options.key("table") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore table"); + public static final Option<String> BATCH_SIZE = Options.key("batch_size") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore batch_size"); + public static final Option<String> DEFAULT_BATCH_INTERVAL_MS = Options.key("batch_interval_ms") Review Comment: ```suggestion public static final Option<String> BATCH_INTERVAL_MS = Options.key("batch_interval_ms") ``` ########## seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java: ########## @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.tablestore.config; + +import org.apache.seatunnel.api.configuration.Option; +import org.apache.seatunnel.api.configuration.Options; + +import java.io.Serializable; + +public class TablestoreConfig implements Serializable { + public static final Option<String> END_POINT = Options.key("end_point") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore end_point"); + public static final Option<String> INSTANCE_NAME = Options.key("instance_name") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore instance_name"); + public static final Option<String> ACCESS_KEY_ID = Options.key("access_key_id") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore access_key_id"); + public static final Option<String> ACCESS_KEY_SECRET = Options.key("access_key_secret") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore access_key_secret"); + public static final Option<String> TABLE = Options.key("table") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore table"); + public static final Option<String> BATCH_SIZE = Options.key("batch_size") + .stringType() + .noDefaultValue() Review Comment: ```suggestion .defaultValue("25") ``` ########## seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java: ########## @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.tablestore.config; + +import org.apache.seatunnel.shade.com.typesafe.config.Config; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +@AllArgsConstructor +public class TablestoreOptions implements Serializable { + + private static final int DEFAULT_BATCH_SIZE = 25; + private static final int DEFAULT_BATCH_INTERVAL_MS = 1000; Review Comment: ```suggestion ``` ########## seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java: ########## @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.tablestore.config; + +import org.apache.seatunnel.api.configuration.Option; +import org.apache.seatunnel.api.configuration.Options; + +import java.io.Serializable; + +public class TablestoreConfig implements Serializable { + public static final Option<String> END_POINT = Options.key("end_point") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore end_point"); + public static final Option<String> INSTANCE_NAME = Options.key("instance_name") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore instance_name"); + public static final Option<String> ACCESS_KEY_ID = Options.key("access_key_id") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore access_key_id"); + public static final Option<String> ACCESS_KEY_SECRET = Options.key("access_key_secret") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore access_key_secret"); + public static final Option<String> TABLE = Options.key("table") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore table"); + public static final Option<String> BATCH_SIZE = Options.key("batch_size") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore batch_size"); + public static final Option<String> DEFAULT_BATCH_INTERVAL_MS = Options.key("batch_interval_ms") + .stringType() + .defaultValue("25") + .withDescription(" Tablestore batch_interval_ms"); + public static final Option<String> PRIMARY_KEYS = Options.key("primary_keys") + .stringType() + .defaultValue("1000") Review Comment: ```suggestion .noDefaultValue() ``` ########## seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java: ########## @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.tablestore.config; + +import org.apache.seatunnel.shade.com.typesafe.config.Config; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +@AllArgsConstructor +public class TablestoreOptions implements Serializable { + + private static final int DEFAULT_BATCH_SIZE = 25; + private static final int DEFAULT_BATCH_INTERVAL_MS = 1000; + + private String endpoint; + + private String instanceName; + + private String accessKeyId; + + private String accessKeySecret; + + private String table; + + private List<String> primaryKeys; + + public int batchSize = DEFAULT_BATCH_SIZE; + public int batchIntervalMs = DEFAULT_BATCH_INTERVAL_MS; Review Comment: ```suggestion public int batchIntervalMs = Integer.valueOf(BATCH_INTERVAL_MS.defaultValue()); ``` ########## seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java: ########## @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.tablestore.config; + +import org.apache.seatunnel.shade.com.typesafe.config.Config; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +@AllArgsConstructor +public class TablestoreOptions implements Serializable { + + private static final int DEFAULT_BATCH_SIZE = 25; Review Comment: ```suggestion ``` ########## seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java: ########## @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.tablestore.config; + +import org.apache.seatunnel.api.configuration.Option; +import org.apache.seatunnel.api.configuration.Options; + +import java.io.Serializable; + +public class TablestoreConfig implements Serializable { + public static final Option<String> END_POINT = Options.key("end_point") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore end_point"); + public static final Option<String> INSTANCE_NAME = Options.key("instance_name") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore instance_name"); + public static final Option<String> ACCESS_KEY_ID = Options.key("access_key_id") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore access_key_id"); + public static final Option<String> ACCESS_KEY_SECRET = Options.key("access_key_secret") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore access_key_secret"); + public static final Option<String> TABLE = Options.key("table") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore table"); + public static final Option<String> BATCH_SIZE = Options.key("batch_size") + .stringType() + .noDefaultValue() + .withDescription(" Tablestore batch_size"); + public static final Option<String> DEFAULT_BATCH_INTERVAL_MS = Options.key("batch_interval_ms") + .stringType() + .defaultValue("25") Review Comment: ```suggestion .defaultValue("1000") ``` ########## seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java: ########## @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.tablestore.config; + +import org.apache.seatunnel.shade.com.typesafe.config.Config; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +@AllArgsConstructor +public class TablestoreOptions implements Serializable { + + private static final int DEFAULT_BATCH_SIZE = 25; + private static final int DEFAULT_BATCH_INTERVAL_MS = 1000; + + private String endpoint; + + private String instanceName; + + private String accessKeyId; + + private String accessKeySecret; + + private String table; + + private List<String> primaryKeys; + + public int batchSize = DEFAULT_BATCH_SIZE; Review Comment: ```suggestion public int batchSize = Integer.valueOf(BATCH_SIZE.defaultValue()); ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
