Re: Re: How can I add config file as classpath in taskmgr node when submitting a flink job?
Posted by
wanglei2@geekplus.com.cn on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/How-many-task-managers-to-launch-for-a-job-tp27983p28040.html
Thanks. Let me have a try
Date: 2019-05-28 09:47
Subject: Re: How can I add config file as classpath in taskmgr node when submitting a flink job?
Hi, wanglei
You could use the flink distributed cache to register some config files and then access them in your task.
1. Register a cached file
StreamExecutionEnvironment.registerCachedFile(inputFile.toString(), "test_data", false);
2. Access the file in your task
final Path testFile = getRuntimeContext().getDistributedCache().getFile("test_data").toPath();
When starting a single node java application, I can add some config file to it.
How can i implenment it when submitting a flink job? The config file need to be read from taskMgr node and used to initialize some classess.