}
}
- SingleMessage对象的定义:
public class SingleMessage {
private long timeLong;
private String name;
private String bizID;
private String time;
private String message;
public long getTimeLong() {
return timeLong;
}
public void setTimeLong(long timeLong) {
this.timeLong = timeLong;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBizID() {
return bizID;
}
public void setBizID(String bizID) {
this.bizID = bizID;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
- 实时处理的操作都集中在StreamingJob类,源码的关键位置已经加了注释,就不再赘述了:
/*
-
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 distrib