Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ public OutputStream getOutputStream() throws IOException {
if (!fileSystem.mkdirs(path.getParent(), dirperms)) {
LOG.warn("error creating parent dir: " + path.getParent());
}
if (!fileSystem.getFileStatus(path.getParent()).getPermission().equals(dirperms)) {
LOG.warn("Directory {} created with unexpected permission {}.Set permission {} for this directory.",
path.getParent(), fileSystem.getFileStatus(path.getParent()).getPermission(), dirperms);
fileSystem.setPermission(path.getParent(), dirperms);
}
out = fileSystem.create(path, (short) this.getMetadata().get_replication_factor());
fileSystem.setPermission(path, dirperms);
fileSystem.setReplication(path, (short) this.getMetadata().get_replication_factor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ public HdfsBlobStoreImpl(Path path, Map<String, Object> conf,
if (!fileSystem.exists(fullPath)) {
FsPermission perms = new FsPermission(BLOBSTORE_DIR_PERMISSION);
boolean success = fileSystem.mkdirs(fullPath, perms);
if (!fileSystem.getFileStatus(fullPath).getPermission().equals(perms)) {
LOG.warn("Directory {} created with unexpected permission {}.Set permission {} for this directory.",
fullPath, fileSystem.getFileStatus(fullPath).getPermission(), perms);
fileSystem.setPermission(fullPath, perms);
}
if (!success) {
throw new IOException("Error creating blobstore directory: " + fullPath);
}
Expand Down