asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "abdullah alamoudi (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Detect IO errors before NullPointerException
Date Mon, 13 Mar 2017 01:04:00 GMT
abdullah alamoudi has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1572

Change subject: Detect IO errors before NullPointerException
......................................................................

Detect IO errors before NullPointerException

Change-Id: I808b12590791a17b749084d1e85f34b9c4ac5893
---
M hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexFileManager.java
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/72/1572/1

diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexFileManager.java
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexFileManager.java
index 731d312..8a1b87e 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexFileManager.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexFileManager.java
@@ -414,7 +414,13 @@
 
     protected FilenameFilter getTransactionFileFilter(boolean inclusive) {
         File dir = new File(baseDir);
+        if (!dir.isDirectory()) {
+            throw new IllegalStateException("base dir: " + baseDir + " is not a directory");
+        }
         String[] files = dir.list(transactionFileNameFilter);
+        if (files == null) {
+            throw new IllegalStateException("Failed to list files in base dir: " + baseDir);
+        }
         if (files.length == 0) {
             return dummyFilter;
         } else {

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1572
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I808b12590791a17b749084d1e85f34b9c4ac5893
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <bamousaa@gmail.com>

Mime
View raw message