Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
670 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...