Skip to content

Commit ca1467e

Browse files
committed
minor improvement
1 parent 84d0be7 commit ca1467e

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/processor/maxwell/MaxwellJsonKafkaSourcePostProcessor.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
import com.fasterxml.jackson.databind.JsonNode;
3131
import com.fasterxml.jackson.databind.ObjectMapper;
3232
import com.fasterxml.jackson.databind.node.ObjectNode;
33-
import org.apache.log4j.LogManager;
34-
import org.apache.log4j.Logger;
3533
import org.apache.spark.api.java.JavaRDD;
3634

3735
import java.util.Locale;
@@ -50,12 +48,15 @@
5048
*/
5149
public class MaxwellJsonKafkaSourcePostProcessor extends JsonKafkaSourcePostProcessor {
5250

53-
private static final Logger LOG = LogManager.getLogger(MaxwellJsonKafkaSourcePostProcessor.class);
54-
5551
private static final ObjectMapper MAPPER = new ObjectMapper();
5652

53+
private final String databaseRegex;
54+
private final String tableRegex;
55+
5756
public MaxwellJsonKafkaSourcePostProcessor(TypedProperties props) {
5857
super(props);
58+
databaseRegex = this.props.getString(Config.DATABASE_NAME_REGEX_PROP.key(), null);
59+
tableRegex = this.props.getString(Config.TABLE_NAME_REGEX_PROP.key());
5960
}
6061

6162
// ------------------------------------------------------------------------
@@ -112,9 +113,6 @@ public JavaRDD<String> process(JavaRDD<String> maxwellJsonRecords) {
112113

113114
// filter out target databases and tables
114115
if (isTargetTable(database, table)) {
115-
116-
LOG.info(String.format("Maxwell source processor starts process table : %s.%s", database, table));
117-
118116
ObjectNode result = (ObjectNode) inputJson.get(DATA);
119117
String type = inputJson.get(OPERATION_TYPE).textValue();
120118

@@ -183,9 +181,6 @@ private String processDelete(JsonNode inputJson, ObjectNode result) {
183181
* @param table table the data belong to
184182
*/
185183
private boolean isTargetTable(String database, String table) {
186-
String databaseRegex = this.props.getString(Config.DATABASE_NAME_REGEX_PROP.key(), null);
187-
String tableRegex = this.props.getString(Config.TABLE_NAME_REGEX_PROP.key());
188-
189184
if (StringUtils.isNullOrEmpty(databaseRegex)) {
190185
return Pattern.matches(tableRegex, table);
191186
} else {

0 commit comments

Comments
 (0)