Add error message if unable to create index / tmp resource dir
@@ -106,14 +106,18 @@ public abstract class BaseTableDataManager implements TableDataManager {
_tableDataDir = tableDataManagerConfig.getDataDir();
_indexDir = new File(_tableDataDir);
if (!_indexDir.exists()) {
- Preconditions.checkState(_indexDir.mkdirs());
+ Preconditions.checkState(_indexDir.mkdirs(),
+ "Unable to create index directory at %s. Check that the user has permissions on this directory.",
+ _indexDir);
}
_resourceTmpDir = new File(_indexDir, "tmp");
// This is meant to cleanup temp resources from TableDataManager. But other code using this same
// directory will have those deleted as well.
FileUtils.deleteQuietly(_resourceTmpDir);
if (!_resourceTmpDir.exists()) {
- Preconditions.checkState(_resourceTmpDir.mkdirs());
+ Preconditions.checkState(_resourceTmpDir.mkdirs(),
+ "Unable to create temp resources directory at %s. Check that the user has permissions on this directory.",
+ _resourceTmpDir);
}
_errorCache = errorCache;
_logger = LoggerFactory.getLogger(_tableNameWithType + "-" + getClass().getSimpleName());
