From 2c8b9220c88cb75ad2fee5c5168510ddb4406f5b Mon Sep 17 00:00:00 2001 From: tledkov-gridgain Date: Tue, 9 Aug 2016 15:22:28 +0300 Subject: [PATCH] IGNITE-3649 IGFS: Local secondary: "create" flag is not used for append() operation. --- .../ignite/hadoop/fs/LocalIgfsSecondaryFileSystem.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/LocalIgfsSecondaryFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/LocalIgfsSecondaryFileSystem.java index 537b2a4db2538..06372ac525a7e 100644 --- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/LocalIgfsSecondaryFileSystem.java +++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/LocalIgfsSecondaryFileSystem.java @@ -411,14 +411,17 @@ private boolean mkdirs0(@Nullable File dir) { @Override public OutputStream append(IgfsPath path, int bufSize, boolean create, @Nullable Map props) { // TODO: IGNITE-3648. - // TODO: IGNITE-3649. try { File file = fileForPath(path); boolean exists = file.exists(); - if (!exists) - throw new IOException("File not found."); + if (!exists) { + if(!create) + throw new IOException("File not found."); + else + return create0(path, false, bufSize); + } return new BufferedOutputStream(new FileOutputStream(file, true), bufSize); }