コード例 #1
0
ファイル: Program.cs プロジェクト: justmine66/FLink.CSharp
        static void Main(string[] args)
        {
            var env = StreamExecutionEnvironment.GetExecutionEnvironment();

            DataStream <UserAction>    actions  = null;
            DataStream <ActionPattern> patterns = null;

            var actionsByUser = actions.KeyBy(action => action.UserId);

            var bcStateDescriptor = new MapStateDescriptor <string, ActionPattern>("patterns", Types.String, Types.Poco <ActionPattern>());

            var bcedPatterns = patterns.Broadcast(bcStateDescriptor);

            var matches = actionsByUser
                          .Connect(bcedPatterns)
                          .Process(new PatternEvaluator());

            matches.Print();

            env.Execute("User Actions Evaluation");
        }