You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Fabian Hueske (JIRA)" <ji...@apache.org> on 2015/11/11 10:21:10 UTC

[jira] [Created] (FLINK-2999) Support connected keyed streams

Fabian Hueske created FLINK-2999:
------------------------------------

             Summary: Support connected keyed streams
                 Key: FLINK-2999
                 URL: https://issues.apache.org/jira/browse/FLINK-2999
             Project: Flink
          Issue Type: Improvement
          Components: Streaming
    Affects Versions: 1.0
            Reporter: Fabian Hueske


It would be nice to add support for connected keyed streams to enable key-partitioned state in Co*Functions.

This could be done by simply connecting two keyed Streams or adding a new method to connect and key two streams as one operation.

{code}
DataStream<X> s1 = ...
DataStream<Y> s2 = ...

// alternative 1
s1
  .keyBy(0)
  .connect(s2.keyBy(1))
  .map(new KeyedCoMap());

// alternative 2
s1
  .connectByKey(s2, 0, 1)
  .map(new KeyedCoMap());

public class KeyedCoMap implements RichCoMapFunction<X,Y,Z> {
  
  OperatorState<A> s;

  public void open() {
    s = getRuntimeContext().getKeyValueState("abc", A.class, new A());
  }

  // ...

}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)