dataset and datastream 這裡以wordcount為例,共同的程式設計套路如下所示:1.獲取執行環境(execution environment)
final streamexecutionenvironment env =streamexecutionenvironment.getexecutionenvironment();
2.載入/建立初始資料集
//
讀取輸入資料
datastreamtext;
if (params.has("input"))
else
3.對資料集進行各種轉換操作(生成新的資料集)datastream
> counts =
//切分每行單詞
text.flatmap(new
tokenizer())
//對每個單詞分組統計詞頻數
.keyby(0).sum(1);
4.指定將計算的結果放到何處去
//
輸出統計結果
if (params.has("output"))
else
//執行flink 程式
env.execute("streaming wordcount");
套介面程式設計
1 struct in addr 4struct sockaddr in 通用套介面位址結構 struct sockaddr int bind int struct sockaddr socklen t strcut sockaddr in serv bind sockfd,struct socka...
套介面程式設計
1 struct in addr 4struct sockaddr in struct sockaddr int bind int struct sockaddr socklen t strcut sockaddr in serv bind sockfd,struct sockaddr serv,s...
套介面程式設計
1 struct in addr 4struct sockaddr in struct sockaddr int bind int struct sockaddr socklen t strcut sockaddr in serv bind sockfd,struct sockaddr serv,s...