Skip to content

Commit b1bfdc3

Browse files
committed
format the code
1 parent d252ac2 commit b1bfdc3

File tree

8 files changed

+15
-17
lines changed

8 files changed

+15
-17
lines changed

flink-learning-common/src/main/java/com/zhisheng/common/constant/PropertiesConstants.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public class PropertiesConstants {
1717
public static final String CONSUMER_FROM_TIME = "consumer.from.time";
1818
public static final String STREAM_PARALLELISM = "stream.parallelism";
1919
public static final String STREAM_SINK_PARALLELISM = "stream.sink.parallelism";
20-
public static final String STREAM_DEFAULT_PARALLELISM = "stream.default.parallelism";
2120
public static final String STREAM_CHECKPOINT_ENABLE = "stream.checkpoint.enable";
2221
public static final String STREAM_CHECKPOINT_DIR = "stream.checkpoint.dir";
2322
public static final String STREAM_CHECKPOINT_TYPE = "stream.checkpoint.type";

flink-learning-common/src/main/java/com/zhisheng/common/schemas/LogSchema.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.apache.flink.api.common.typeinfo.TypeInformation;
88

99
import java.io.IOException;
10-
import java.nio.charset.Charset;
10+
import java.nio.charset.StandardCharsets;
1111

1212
/**
1313
* Log Schema ,支持序列化和反序列化
@@ -32,7 +32,7 @@ public boolean isEndOfStream(LogEvent logEvent) {
3232

3333
@Override
3434
public byte[] serialize(LogEvent logEvent) {
35-
return gson.toJson(logEvent).getBytes(Charset.forName("UTF-8"));
35+
return gson.toJson(logEvent).getBytes(StandardCharsets.UTF_8);
3636
}
3737

3838
@Override

flink-learning-common/src/main/java/com/zhisheng/common/schemas/MetricSchema.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
import org.apache.flink.api.common.typeinfo.TypeInformation;
88

99
import java.io.IOException;
10-
import java.nio.charset.Charset;
10+
import java.nio.charset.StandardCharsets;
1111

1212
/**
1313
* Metric Schema ,支持序列化和反序列化
14-
*
14+
* <p>
1515
* blog:http://www.54tianzhisheng.cn/
1616
* 微信公众号:zhisheng
17-
*
1817
*/
1918
public class MetricSchema implements DeserializationSchema<MetricEvent>, SerializationSchema<MetricEvent> {
2019

@@ -32,7 +31,7 @@ public boolean isEndOfStream(MetricEvent metricEvent) {
3231

3332
@Override
3433
public byte[] serialize(MetricEvent metricEvent) {
35-
return gson.toJson(metricEvent).getBytes(Charset.forName("UTF-8"));
34+
return gson.toJson(metricEvent).getBytes(StandardCharsets.UTF_8);
3635
}
3736

3837
@Override

flink-learning-common/src/main/java/com/zhisheng/common/schemas/OrderLineSchema.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.apache.flink.api.common.typeinfo.TypeInformation;
88

99
import java.io.IOException;
10-
import java.nio.charset.Charset;
10+
import java.nio.charset.StandardCharsets;
1111

1212
/**
1313
* OrderLine Schema ,支持序列化和反序列化
@@ -31,7 +31,7 @@ public boolean isEndOfStream(OrderLineEvent orderLineEvent) {
3131

3232
@Override
3333
public byte[] serialize(OrderLineEvent orderLineEvent) {
34-
return gson.toJson(orderLineEvent).getBytes(Charset.forName("UTF-8"));
34+
return gson.toJson(orderLineEvent).getBytes(StandardCharsets.UTF_8);
3535
}
3636

3737
@Override

flink-learning-common/src/main/java/com/zhisheng/common/schemas/OrderSchema.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.apache.flink.api.common.typeinfo.TypeInformation;
88

99
import java.io.IOException;
10-
import java.nio.charset.Charset;
10+
import java.nio.charset.StandardCharsets;
1111

1212
/**
1313
* order Schema ,支持序列化和反序列化
@@ -31,7 +31,7 @@ public boolean isEndOfStream(OrderEvent orderEvent) {
3131

3232
@Override
3333
public byte[] serialize(OrderEvent orderEvent) {
34-
return gson.toJson(orderEvent).getBytes(Charset.forName("UTF-8"));
34+
return gson.toJson(orderEvent).getBytes(StandardCharsets.UTF_8);
3535
}
3636

3737
@Override

flink-learning-common/src/main/java/com/zhisheng/common/schemas/ProductSchema.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.apache.flink.api.common.typeinfo.TypeInformation;
88

99
import java.io.IOException;
10-
import java.nio.charset.Charset;
10+
import java.nio.charset.StandardCharsets;
1111

1212
/**
1313
* Product Schema ,支持序列化和反序列化
@@ -31,7 +31,7 @@ public boolean isEndOfStream(ProductEvent productEvent) {
3131

3232
@Override
3333
public byte[] serialize(ProductEvent productEvent) {
34-
return gson.toJson(productEvent).getBytes(Charset.forName("UTF-8"));
34+
return gson.toJson(productEvent).getBytes(StandardCharsets.UTF_8);
3535
}
3636

3737
@Override

flink-learning-common/src/main/java/com/zhisheng/common/schemas/ShopSchema.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.apache.flink.api.common.typeinfo.TypeInformation;
88

99
import java.io.IOException;
10-
import java.nio.charset.Charset;
10+
import java.nio.charset.StandardCharsets;
1111

1212
/**
1313
* Shop Schema ,支持序列化和反序列化
@@ -31,7 +31,7 @@ public boolean isEndOfStream(ShopEvent shopEvent) {
3131

3232
@Override
3333
public byte[] serialize(ShopEvent shopEvent) {
34-
return gson.toJson(shopEvent).getBytes(Charset.forName("UTF-8"));
34+
return gson.toJson(shopEvent).getBytes(StandardCharsets.UTF_8);
3535
}
3636

3737
@Override

flink-learning-common/src/main/java/com/zhisheng/common/schemas/UserSchema.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.apache.flink.api.common.typeinfo.TypeInformation;
88

99
import java.io.IOException;
10-
import java.nio.charset.Charset;
10+
import java.nio.charset.StandardCharsets;
1111

1212
/**
1313
* User Schema ,支持序列化和反序列化
@@ -31,7 +31,7 @@ public boolean isEndOfStream(UserEvent userEvent) {
3131

3232
@Override
3333
public byte[] serialize(UserEvent userEvent) {
34-
return gson.toJson(userEvent).getBytes(Charset.forName("UTF-8"));
34+
return gson.toJson(userEvent).getBytes(StandardCharsets.UTF_8);
3535
}
3636

3737
@Override

0 commit comments

Comments
 (0)