diff --git a/core/common/src/main/java/alluxio/underfs/BaseUnderFileSystem.java b/core/common/src/main/java/alluxio/underfs/BaseUnderFileSystem.java index 33fa575bb0c6..b72f97eda6dd 100644 --- a/core/common/src/main/java/alluxio/underfs/BaseUnderFileSystem.java +++ b/core/common/src/main/java/alluxio/underfs/BaseUnderFileSystem.java @@ -124,11 +124,9 @@ public AlluxioURI resolveUri(AlluxioURI ufsBaseUri, String alluxioPath) { } /** - * Check whether the {@link UnderFileSystem} is mounted read-only. - * - * @return whether the Object UFS is mounted read-only + * @return whether only read operations are permitted to the {@link UnderFileSystem} */ - protected boolean isMountReadOnly() { + protected boolean isReadOnly() { return mUfsConf.isReadOnly(); } diff --git a/core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java b/core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java index fbeec09cc830..12676e795159 100644 --- a/core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java +++ b/core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java @@ -704,7 +704,7 @@ protected ObjectListingChunk getObjectListingChunkForPath(String path, boolean r if (objs != null && ((objs.getObjectStatuses() != null && objs.getObjectStatuses().length > 0) || (objs.getCommonPrefixes() != null && objs.getCommonPrefixes().length > 0))) { // If the breadcrumb exists, this is a no-op - if (!isMountReadOnly()) { + if (!isReadOnly()) { mkdirsInternal(dir); } return objs; @@ -805,7 +805,7 @@ protected UfsStatus[] listInternal(String path, ListOptions options) throws IOEx child = childNameIndex != -1 ? child.substring(0, childNameIndex) : child; if (!child.isEmpty() && !children.containsKey(child)) { // This directory has not been created through Alluxio. - if (!isMountReadOnly()) { + if (!isReadOnly()) { mkdirsInternal(commonPrefix); } // If both a file and a directory existed with the same name, the path will be