ストリームデータ処理基盤 uCosminexus Stream Data Platform - Application Framework アプリケーション開発ガイド
ここでは,インプロセス連携カスタムアダプターでストリームデータを送信する処理の基本的な流れについて,実装例を基に説明します。
public class Inpro_SendSample implements StreamInprocessUP {
// StreamInprocessUPの実装
public void execute(SDPConnector con) {
// 1. 送信対象の入力ストリームに接続
StreamInput in = con.openStreamOutput("GROUP","STREAM1");
// 2. タプルを送信
Object[] data=new Object[]{new Integer(1)};
StreamTuple tuple=new StreamTuple(data);
in.put(tuple);
// 3. データ送信完了を通知
in.putEnd();
// 4. 入力ストリームとの接続を切断
in.close();
// 5. SDPサーバとの接続を切断
con.close();
}
}
それぞれの処理の意味について説明します。番号は実装例中のコメントの番号に対応しています。
StreamInput in = con.openStreamInput("GROUP","STREAM1");in.put(tuple);
in.putEnd();
in.close();
con.close();
All Rights Reserved. Copyright (C) 2010, 2014, Hitachi, Ltd.