Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
611 views
in Technique[技术] by (71.8m points)

state - Flink:执行完成后访问操作员状态(Flink: Access operator state after execution is complete)

Assuming I have a custom RichFunction with some raw state.

(假设我有一个带有某些原始状态的自定义RichFunction。)

How can I get the state (from every parallel instance of the operator) back to the main/driver code when the flink jobs ends?

(当flink作业结束时,如何将状态(从运算符的每个并行实例)返回到主代码/驱动程序代码?)

abstract class MyRichMap extends RichMapFunction[SomeType, Unit] {

  protected var someVar: Engine = _ 

  override def open(parameters: Configuration): Unit = {
    // assume someVar inititation here
    ....
  }

  override def map(value: SomeType): Unit = {

    engine.process(value)

  }

    val env = StreamExecutionEnvironment.getExecutionEnvironment
    ...
    someSource.map (new MyRichMap())

    env.execute()
    // How to get engine or some field of it here? (e.g., engine.someCounter)

what's the best way to approach this?

(解决此问题的最佳方法是什么?)

  ask by user3161227 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...