Skip to content

Commit 64ba57e

Browse files
committed
add PropertiesUtils
1 parent 4b11bea commit 64ba57e

File tree

6 files changed

+129
-12
lines changed

6 files changed

+129
-12
lines changed

core/src/main/java/com/dtstack/flink/sql/Main.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.dtstack.flink.sql.sink.StreamSinkFactory;
3838
import com.dtstack.flink.sql.source.StreamSourceFactory;
3939
import com.dtstack.flink.sql.util.DtStringUtil;
40+
import com.dtstack.flink.sql.util.PropertiesUtils;
4041
import com.dtstack.flink.sql.watermarker.WaterMarkerAssigner;
4142
import com.dtstack.flink.sql.util.FlinkUtil;
4243
import com.dtstack.flink.sql.util.PluginUtil;
@@ -329,7 +330,7 @@ private static void registerTable(SqlTree sqlTree, StreamExecutionEnvironment en
329330
}
330331

331332
private static StreamExecutionEnvironment getStreamExeEnv(Properties confProperties, String deployMode) throws Exception {
332-
confProperties = propertiesTrim(confProperties);
333+
confProperties = PropertiesUtils.propertiesTrim(confProperties);
333334

334335
StreamExecutionEnvironment env = !ClusterMode.local.name().equals(deployMode) ?
335336
StreamExecutionEnvironment.getExecutionEnvironment() :
@@ -373,13 +374,4 @@ private static StreamExecutionEnvironment getStreamExeEnv(Properties confPropert
373374
return env;
374375
}
375376

376-
private static Properties propertiesTrim(Properties confProperties) {
377-
Properties properties = new Properties();
378-
confProperties.forEach(
379-
(k, v) -> {
380-
properties.put(k.toString().trim(), v.toString().trim());
381-
}
382-
);
383-
return properties;
384-
}
385377
}

core/src/main/java/com/dtstack/flink/sql/udf/TimestampUdf.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
120
package com.dtstack.flink.sql.udf;
221

322
import org.apache.flink.table.functions.FunctionContext;

core/src/main/java/com/dtstack/flink/sql/util/JDBCUtils.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
120
package com.dtstack.flink.sql.util;
221

322
import org.slf4j.Logger;

core/src/main/java/com/dtstack/flink/sql/util/ParseUtils.java

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,47 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/*
20+
* Licensed to the Apache Software Foundation (ASF) under one
21+
* or more contributor license agreements. See the NOTICE file
22+
* distributed with this work for additional information
23+
* regarding copyright ownership. The ASF licenses this file
24+
* to you under the Apache License, Version 2.0 (the
25+
* "License"); you may not use this file except in compliance
26+
* with the License. You may obtain a copy of the License at
27+
*
28+
* http://www.apache.org/licenses/LICENSE-2.0
29+
*
30+
* Unless required by applicable law or agreed to in writing, software
31+
* distributed under the License is distributed on an "AS IS" BASIS,
32+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33+
* See the License for the specific language governing permissions and
34+
* limitations under the License.
35+
*/
36+
137
package com.dtstack.flink.sql.util;
238

339
import org.apache.calcite.sql.SqlBasicCall;
440
import org.apache.calcite.sql.SqlKind;
541
import org.apache.calcite.sql.SqlNode;
642
import org.apache.commons.lang3.StringUtils;
743

8-
import java.util.HashSet;
944
import java.util.List;
10-
import java.util.Set;
1145

1246
/**
1347
* @Auther: jiangjunjie
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
20+
package com.dtstack.flink.sql.util;
21+
22+
import java.util.Properties;
23+
24+
public class PropertiesUtils {
25+
public static Properties propertiesTrim(Properties confProperties) {
26+
Properties properties = new Properties();
27+
confProperties.forEach(
28+
(k, v) -> {
29+
properties.put(k.toString().trim(), v.toString().trim());
30+
}
31+
);
32+
return properties;
33+
}
34+
}

core/src/main/java/com/dtstack/flink/sql/watermarker/AbsCustomerWaterMarker.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
120
package com.dtstack.flink.sql.watermarker;
221

322
import com.dtstack.flink.sql.metric.EventDelayGauge;

0 commit comments

Comments
 (0)