You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/06/26 09:59:39 UTC

[GitHub] [flink] pnowojski commented on a change in pull request #8621: [FLINK-12682][connectors] StringWriter support custom row delimiter

pnowojski commented on a change in pull request #8621: [FLINK-12682][connectors] StringWriter support custom row delimiter
URL: https://github.com/apache/flink/pull/8621#discussion_r297579509
 
 

 ##########
 File path: flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/StringWriter.java
 ##########
 @@ -82,7 +89,10 @@ public void open(FileSystem fs, Path path) throws IOException {
 	public void write(T element) throws IOException {
 		FSDataOutputStream outputStream = getStream();
 		outputStream.write(element.toString().getBytes(charset));
-		outputStream.write('\n');
+		if (rowDelimiterBytes == null) {
+			rowDelimiterBytes = rowDelimiter.getBytes(charset);
 
 Review comment:
   Why are you "caching" `rowDelimiterBytes`? Isn't this a premature optimisation?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services