errorStatus = fs.getFileStatus(errorPath);
} catch (FileNotFoundException ex) {
// ignored
}
if (errorStatus == null)
throw new ThriftTableOperationException(tableId, null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_ERROR_DIRECTORY, errorDir
+ " does not exist");
if (!errorStatus.isDir())
throw new ThriftTableOperationException(tableId, null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_ERROR_DIRECTORY, errorDir
+ " is not a directory");
if (fs.listStatus(errorPath).length != 0)
throw new ThriftTableOperationException(tableId, null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_ERROR_DIRECTORY, errorDir
+ " is not empty");
ZooArbitrator.start(Constants.BULK_ARBITRATOR_TYPE, tid);
// move the files into the directory
try {
String bulkDir = prepareBulkImport(fs, sourceDir, tableId);
log.debug(" tid " + tid + " bulkDir " + bulkDir);
return new LoadFiles(tableId, sourceDir, bulkDir, errorDir, setTime);
} catch (IOException ex) {
log.error("error preparing the bulk import directory", ex);
throw new ThriftTableOperationException(tableId, null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_INPUT_DIRECTORY, sourceDir + ": "
+ ex);
}
}