File tree Expand file tree Collapse file tree 8 files changed +15
-17
lines changed
flink-learning-common/src/main/java/com/zhisheng/common Expand file tree Collapse file tree 8 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ public class PropertiesConstants {
17
17
public static final String CONSUMER_FROM_TIME = "consumer.from.time" ;
18
18
public static final String STREAM_PARALLELISM = "stream.parallelism" ;
19
19
public static final String STREAM_SINK_PARALLELISM = "stream.sink.parallelism" ;
20
- public static final String STREAM_DEFAULT_PARALLELISM = "stream.default.parallelism" ;
21
20
public static final String STREAM_CHECKPOINT_ENABLE = "stream.checkpoint.enable" ;
22
21
public static final String STREAM_CHECKPOINT_DIR = "stream.checkpoint.dir" ;
23
22
public static final String STREAM_CHECKPOINT_TYPE = "stream.checkpoint.type" ;
Original file line number Diff line number Diff line change 7
7
import org .apache .flink .api .common .typeinfo .TypeInformation ;
8
8
9
9
import java .io .IOException ;
10
- import java .nio .charset .Charset ;
10
+ import java .nio .charset .StandardCharsets ;
11
11
12
12
/**
13
13
* Log Schema ,支持序列化和反序列化
@@ -32,7 +32,7 @@ public boolean isEndOfStream(LogEvent logEvent) {
32
32
33
33
@ Override
34
34
public byte [] serialize (LogEvent logEvent ) {
35
- return gson .toJson (logEvent ).getBytes (Charset . forName ( "UTF-8" ) );
35
+ return gson .toJson (logEvent ).getBytes (StandardCharsets . UTF_8 );
36
36
}
37
37
38
38
@ Override
Original file line number Diff line number Diff line change 7
7
import org .apache .flink .api .common .typeinfo .TypeInformation ;
8
8
9
9
import java .io .IOException ;
10
- import java .nio .charset .Charset ;
10
+ import java .nio .charset .StandardCharsets ;
11
11
12
12
/**
13
13
* Metric Schema ,支持序列化和反序列化
14
- *
14
+ * <p>
15
15
* blog:http://www.54tianzhisheng.cn/
16
16
* 微信公众号:zhisheng
17
- *
18
17
*/
19
18
public class MetricSchema implements DeserializationSchema <MetricEvent >, SerializationSchema <MetricEvent > {
20
19
@@ -32,7 +31,7 @@ public boolean isEndOfStream(MetricEvent metricEvent) {
32
31
33
32
@ Override
34
33
public byte [] serialize (MetricEvent metricEvent ) {
35
- return gson .toJson (metricEvent ).getBytes (Charset . forName ( "UTF-8" ) );
34
+ return gson .toJson (metricEvent ).getBytes (StandardCharsets . UTF_8 );
36
35
}
37
36
38
37
@ Override
Original file line number Diff line number Diff line change 7
7
import org .apache .flink .api .common .typeinfo .TypeInformation ;
8
8
9
9
import java .io .IOException ;
10
- import java .nio .charset .Charset ;
10
+ import java .nio .charset .StandardCharsets ;
11
11
12
12
/**
13
13
* OrderLine Schema ,支持序列化和反序列化
@@ -31,7 +31,7 @@ public boolean isEndOfStream(OrderLineEvent orderLineEvent) {
31
31
32
32
@ Override
33
33
public byte [] serialize (OrderLineEvent orderLineEvent ) {
34
- return gson .toJson (orderLineEvent ).getBytes (Charset . forName ( "UTF-8" ) );
34
+ return gson .toJson (orderLineEvent ).getBytes (StandardCharsets . UTF_8 );
35
35
}
36
36
37
37
@ Override
Original file line number Diff line number Diff line change 7
7
import org .apache .flink .api .common .typeinfo .TypeInformation ;
8
8
9
9
import java .io .IOException ;
10
- import java .nio .charset .Charset ;
10
+ import java .nio .charset .StandardCharsets ;
11
11
12
12
/**
13
13
* order Schema ,支持序列化和反序列化
@@ -31,7 +31,7 @@ public boolean isEndOfStream(OrderEvent orderEvent) {
31
31
32
32
@ Override
33
33
public byte [] serialize (OrderEvent orderEvent ) {
34
- return gson .toJson (orderEvent ).getBytes (Charset . forName ( "UTF-8" ) );
34
+ return gson .toJson (orderEvent ).getBytes (StandardCharsets . UTF_8 );
35
35
}
36
36
37
37
@ Override
Original file line number Diff line number Diff line change 7
7
import org .apache .flink .api .common .typeinfo .TypeInformation ;
8
8
9
9
import java .io .IOException ;
10
- import java .nio .charset .Charset ;
10
+ import java .nio .charset .StandardCharsets ;
11
11
12
12
/**
13
13
* Product Schema ,支持序列化和反序列化
@@ -31,7 +31,7 @@ public boolean isEndOfStream(ProductEvent productEvent) {
31
31
32
32
@ Override
33
33
public byte [] serialize (ProductEvent productEvent ) {
34
- return gson .toJson (productEvent ).getBytes (Charset . forName ( "UTF-8" ) );
34
+ return gson .toJson (productEvent ).getBytes (StandardCharsets . UTF_8 );
35
35
}
36
36
37
37
@ Override
Original file line number Diff line number Diff line change 7
7
import org .apache .flink .api .common .typeinfo .TypeInformation ;
8
8
9
9
import java .io .IOException ;
10
- import java .nio .charset .Charset ;
10
+ import java .nio .charset .StandardCharsets ;
11
11
12
12
/**
13
13
* Shop Schema ,支持序列化和反序列化
@@ -31,7 +31,7 @@ public boolean isEndOfStream(ShopEvent shopEvent) {
31
31
32
32
@ Override
33
33
public byte [] serialize (ShopEvent shopEvent ) {
34
- return gson .toJson (shopEvent ).getBytes (Charset . forName ( "UTF-8" ) );
34
+ return gson .toJson (shopEvent ).getBytes (StandardCharsets . UTF_8 );
35
35
}
36
36
37
37
@ Override
Original file line number Diff line number Diff line change 7
7
import org .apache .flink .api .common .typeinfo .TypeInformation ;
8
8
9
9
import java .io .IOException ;
10
- import java .nio .charset .Charset ;
10
+ import java .nio .charset .StandardCharsets ;
11
11
12
12
/**
13
13
* User Schema ,支持序列化和反序列化
@@ -31,7 +31,7 @@ public boolean isEndOfStream(UserEvent userEvent) {
31
31
32
32
@ Override
33
33
public byte [] serialize (UserEvent userEvent ) {
34
- return gson .toJson (userEvent ).getBytes (Charset . forName ( "UTF-8" ) );
34
+ return gson .toJson (userEvent ).getBytes (StandardCharsets . UTF_8 );
35
35
}
36
36
37
37
@ Override
You can’t perform that action at this time.
0 commit comments