From 1df0b523ad522595f6bb30ff76aacb57d239807f Mon Sep 17 00:00:00 2001 From: Darin Nee Date: Tue, 15 Nov 2016 09:57:07 -0800 Subject: [PATCH] APEXMALHAR-2342: check file exists to prevent null pointer exception in AbstractFileOutputOperator recovery setup --- .../com/datatorrent/lib/io/fs/AbstractFileOutputOperator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 27a56cdc1e..85d5f70a2d 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 void setup(Context.OperatorContext context) 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.");