diff --git a/dora/core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java b/dora/core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java index e45df22a9ce1..f81ae1e0442a 100755 --- a/dora/core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java +++ b/dora/core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java @@ -202,7 +202,8 @@ public interface ObjectListingChunk { * @return true if there is, no if there isn't, NULL if it cannot tell */ default @Nullable Boolean hasNextChunk() { - return null; + throw new UnsupportedOperationException( + "HasNextChunk not implemented for " + getClass().getName()); } } diff --git a/dora/underfs/cos/src/main/java/alluxio/underfs/cos/COSUnderFileSystem.java b/dora/underfs/cos/src/main/java/alluxio/underfs/cos/COSUnderFileSystem.java index b5c3db779f07..c91a99b33b4d 100644 --- a/dora/underfs/cos/src/main/java/alluxio/underfs/cos/COSUnderFileSystem.java +++ b/dora/underfs/cos/src/main/java/alluxio/underfs/cos/COSUnderFileSystem.java @@ -328,6 +328,11 @@ public ObjectListingChunk getNextChunk() throws IOException { } return null; } + + @Override + public Boolean hasNextChunk() { + return mResult.isTruncated(); + } } @Override diff --git a/dora/underfs/obs/src/main/java/alluxio/underfs/obs/OBSUnderFileSystem.java b/dora/underfs/obs/src/main/java/alluxio/underfs/obs/OBSUnderFileSystem.java index 617853dcfe5b..2a1f03598860 100644 --- a/dora/underfs/obs/src/main/java/alluxio/underfs/obs/OBSUnderFileSystem.java +++ b/dora/underfs/obs/src/main/java/alluxio/underfs/obs/OBSUnderFileSystem.java @@ -392,6 +392,11 @@ public ObjectListingChunk getNextChunk() throws IOException { } return null; } + + @Override + public Boolean hasNextChunk() { + return mResult.isTruncated(); + } } @Override diff --git a/dora/underfs/oss/src/main/java/alluxio/underfs/oss/OSSUnderFileSystem.java b/dora/underfs/oss/src/main/java/alluxio/underfs/oss/OSSUnderFileSystem.java index ba0f0fe68efa..703ec8838d7a 100644 --- a/dora/underfs/oss/src/main/java/alluxio/underfs/oss/OSSUnderFileSystem.java +++ b/dora/underfs/oss/src/main/java/alluxio/underfs/oss/OSSUnderFileSystem.java @@ -361,6 +361,11 @@ public ObjectListingChunk getNextChunk() throws IOException { } return null; } + + @Override + public Boolean hasNextChunk() { + return mResult.isTruncated(); + } } @Override