Repository: apex-malhar Updated Branches: refs/heads/master 6b0e931ce -> 05a7ca3e4
APEXMALHAR-2342: check file exists to prevent null pointer exception in AbstractFileOutputOperator recovery setup Project: http://git-wip-us.apache.org/repos/asf/apex-malhar/repo Commit: http://git-wip-us.apache.org/repos/asf/apex-malhar/commit/1df0b523 Tree: http://git-wip-us.apache.org/repos/asf/apex-malhar/tree/1df0b523 Diff: http://git-wip-us.apache.org/repos/asf/apex-malhar/diff/1df0b523 Branch: refs/heads/master Commit: 1df0b523ad522595f6bb30ff76aacb57d239807f Parents: 9db0447 Author: Darin Nee <[email protected]> Authored: Tue Nov 15 09:57:07 2016 -0800 Committer: Darin Nee <[email protected]> Committed: Tue Nov 15 09:57:07 2016 -0800 ---------------------------------------------------------------------- .../java/com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/1df0b523/library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java ---------------------------------------------------------------------- diff --git a/library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java b/library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java index 27a56cd..85d5f70 100644 --- a/library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java +++ b/library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java @@ -412,7 +412,7 @@ public abstract class AbstractFileOutputOperator<INPUT> extends BaseOperator imp activePath = new Path(filePath + Path.SEPARATOR + seenPartFileName); } - if (activePath != null && fs.getFileStatus(activePath).getLen() > maxLength) { + if (activePath != null && fs.exists(activePath) && fs.getFileStatus(activePath).getLen() > maxLength) { //Handle the case when restoring to a checkpoint where the current rolling file //already has a length greater than max length. LOG.debug("rotating file at setup.");
