Hi to all,
in many of my jobs I have to read a config file that can be either on local fs either on hdfs.
I'm looking for an intuitive API to read the content of such config files (JSON) before converting them to Java objects through jackson. Is there any Flink API to easily achieve this?
I really like something like
- String content = FileSystem.get(myFileUri).readAsString() or
- String content = new Path(myFilePath).readAsString();
but at the moment the only solution I found is something like:
StringBuffer content = new StringBuffer();
Path path = new Path(myFilePath);
FSDataInputStream stream = FileSystem.get(path.toUri()).open(path);
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
while ((line = reader.readLine()) != null) {
String contentStr = content.toString();
Am I the only one that need such a feature?
Best,
Flavio