//yield
import json
import re
import logging
import sys
from collections import Counter
from pyflink.datastream import DataStream, StreamExecutionEnvironment
from pyflink.datastream.functions import RuntimeContext, FlatMapFunction, MapFunction,KeySelector
from pyflink.common.typeinfo import Types
s_env = StreamExecutionEnvironment.get_execution_environment()
data = DataStream(s_env._j_stream_execution_environment.socketTextStream('192.168.137.201', 8899))
#data.print()
def get_key():
return '999'
class LogEvent:
world=None
def __init__(self,world,count):
self.world = world
self.count = count
def to_dict(self):
return {
"world": str(self.world),
"count": str(self.count)
}
class MyMapFun