0

I am using flink 1.8.0 and I am trying to query my job state.

val descriptor = new ValueStateDescriptor("myState", Types.CASE_CLASS[Foo])
    descriptor.setQueryable("my-queryable-State")

I used port 9067 which is the default port according to this, my client:

val client = new QueryableStateClient("127.0.0.1", 9067)
val jobId = JobID.fromHexString("d48a6c980d1a147e0622565700158d9e")

      val execConfig = new ExecutionConfig
       val descriptor = new ValueStateDescriptor("my-queryable-State", Types.CASE_CLASS[Foo])
      val res: Future[ValueState[Foo]] = client.getKvState(jobId, "my-queryable-State","a", BasicTypeInfo.STRING_TYPE_INFO, descriptor)
      res.map(_.toString).pipeTo(sender)

but I am getting :

[ERROR] [06/25/2019 20:37:05.499] [bvAkkaHttpServer-akka.actor.default-dispatcher-5] [akka.actor.ActorSystemImpl(bvAkkaHttpServer)] Error during processing of request: 'org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:9067'. Completing with 500 Internal Server Error response. To change default exception handling behavior, provide a custom ExceptionHandler.
java.util.concurrent.CompletionException: org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:9067
  1. what am I doing wrong ?
  2. how and where should I define QueryableStateOptions
Community
  • 1
  • 1
igx
  • 4,101
  • 11
  • 43
  • 88

1 Answers1

0

So If You want to use the QueryableState You need to add the proper Jar to Your flink. The jar is flink-queryable-state-runtime, it can be found in the opt folder in Your flink distribution and You should move it to the lib folder.

As for the second question the QueryableStateOption is just a class that is used to create static ConfigOption definitions. The definitions are then used to read the configurations from flink-conf.yaml file. So currently the only option to configure the QueryableState is to use the flink-conf file in the flink distribution.

EDIT: Also, try reading this]1 it provides more info on how does Queryable State works. You shouldn't really connect directly to the server port but rather You should use the proxy port which by default is 9069.

Dominik Wosiński
  • 3,769
  • 1
  • 8
  • 22
  • Thanks, I did flowed the instruction above and restarted the flink cluster (standalone ) BUT still getting connection refused error : ```Caused by: org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:9067 ``` – igx Jun 26 '19 at 07:34
  • 1
    Hey, I have added the edits :) Also, verify in the logs of jobmanager and taskmanagers whether there is information about starting the Queryable State Proxy. – Dominik Wosiński Jun 26 '19 at 08:45
  • I set everything as described https://ci.apache.org/projects/flink/flink-docs-stable/dev/stream/state/queryable_state.html and I do see in the logs "Started the Queryable State Proxy Server @ ...". but still getting connection refused – igx Jun 30 '19 at 13:33
  • Hey, how are You starting You cluster ? Are You using Docker or some other way ?? Also Are you using the correct port ? – Dominik Wosiński Jun 30 '19 at 19:06
  • this is running on my local machine. I start the cluster simply by `flink/bin/start-cluster.sh` – igx Jul 01 '19 at 07:34
  • 1
    The problem was that the client didn't address the proxy server (as reported in the log `Started Queryable State Proxy Server ... `)just the correct port – igx Jul 02 '19 at 11:01