How to set stateBackEnd in flink sql program?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to set stateBackEnd in flink sql program?

wanglei2@geekplus.com.cn

EnvironmentSettings settings = EnvironmentSettings.newInstance().useBlinkPlanner().inStreamingMode().build();
TableEnvironment tEnv = TableEnvironment.create(settings);
tEnv.sqlUpdate()...

Is there a way i can set stateBackEnd like normal streaming program as folloing:
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setStateBackend(new RocksDBStateBackend(args[0], true));


Reply | Threaded
Open this post in threaded view
|

Re: How to set stateBackEnd in flink sql program?

Jingsong Li
Hi wanglei,

If you are using Flink 1.10, you can set "state.backend=rocksdb" to "TableConfig.getConfiguration".
And you can find related config options here[1].


Jingsong Lee

On Thu, Mar 12, 2020 at 11:15 AM [hidden email] <[hidden email]> wrote:

EnvironmentSettings settings = EnvironmentSettings.newInstance().useBlinkPlanner().inStreamingMode().build();
TableEnvironment tEnv = TableEnvironment.create(settings);
tEnv.sqlUpdate()...

Is there a way i can set stateBackEnd like normal streaming program as folloing:
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setStateBackend(new RocksDBStateBackend(args[0], true));




--
Best, Jingsong Lee
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to set stateBackEnd in flink sql program?

wanglei2@geekplus.com.cn
Hi Jingsong, 

So i can write the code as following?

EnvironmentSettings settings = EnvironmentSettings.newInstance().useBlinkPlanner().inStreamingMode().build();
TableEnvironment tEnv = TableEnvironment.create(settings);
tEnv.getConfig().getConfiguration().setString("state.backend","rocksdb");
eEnv.sqlUpdate(......)

Thanks,
Lei

 
Date: 2020-03-12 11:32
Subject: Re: How to set stateBackEnd in flink sql program?
Hi wanglei,

If you are using Flink 1.10, you can set "state.backend=rocksdb" to "TableConfig.getConfiguration".
And you can find related config options here[1].


Jingsong Lee

On Thu, Mar 12, 2020 at 11:15 AM [hidden email] <[hidden email]> wrote:

EnvironmentSettings settings = EnvironmentSettings.newInstance().useBlinkPlanner().inStreamingMode().build();
TableEnvironment tEnv = TableEnvironment.create(settings);
tEnv.sqlUpdate()...

Is there a way i can set stateBackEnd like normal streaming program as folloing:
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setStateBackend(new RocksDBStateBackend(args[0], true));




--
Best, Jingsong Lee
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to set stateBackEnd in flink sql program?

Jingsong Li
 Yes,

You should take a look to [1]. Others config you need too.


Best,
Jingsong Lee

On Thu, Mar 12, 2020 at 12:26 PM [hidden email] <[hidden email]> wrote:
Hi Jingsong, 

So i can write the code as following?

EnvironmentSettings settings = EnvironmentSettings.newInstance().useBlinkPlanner().inStreamingMode().build();
TableEnvironment tEnv = TableEnvironment.create(settings);
tEnv.getConfig().getConfiguration().setString("state.backend","rocksdb");
eEnv.sqlUpdate(......)

Thanks,
Lei

 
Date: 2020-03-12 11:32
Subject: Re: How to set stateBackEnd in flink sql program?
Hi wanglei,

If you are using Flink 1.10, you can set "state.backend=rocksdb" to "TableConfig.getConfiguration".
And you can find related config options here[1].


Jingsong Lee

On Thu, Mar 12, 2020 at 11:15 AM [hidden email] <[hidden email]> wrote:

EnvironmentSettings settings = EnvironmentSettings.newInstance().useBlinkPlanner().inStreamingMode().build();
TableEnvironment tEnv = TableEnvironment.create(settings);
tEnv.sqlUpdate()...

Is there a way i can set stateBackEnd like normal streaming program as folloing:
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setStateBackend(new RocksDBStateBackend(args[0], true));




--
Best, Jingsong Lee


--
Best, Jingsong Lee