Skip to content

Commit 4eb336c

Browse files
committed
address diff comment
1 parent 9092288 commit 4eb336c

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/PeerDownloadLLCRealtimeClusterIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public boolean doMove(URI srcUri, URI dstUri)
288288
}
289289

290290
@Override
291-
public boolean copy(URI srcUri, URI dstUri)
291+
public boolean copyDir(URI srcUri, URI dstUri)
292292
throws IOException {
293293
try {
294294
return _localPinotFS.copyDir(new URI(_basePath + srcUri.getPath()), new URI(_basePath + dstUri.getPath()));

pinot-plugins/pinot-file-system/pinot-adls/src/main/java/org/apache/pinot/plugin/filesystem/AzurePinotFS.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public boolean doMove(URI srcUri, URI dstUri)
109109
@Override
110110
public boolean copyDir(URI srcUri, URI dstUri)
111111
throws IOException {
112+
// TODO: support directory copy.
112113
if (isDirectory(srcUri)) {
113114
throw new UnsupportedOperationException("Azure FS doesn't support directory recursive copy!");
114115
}

pinot-spi/src/main/java/org/apache/pinot/spi/filesystem/PinotFS.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ boolean move(URI srcUri, URI dstUri, boolean overwrite)
103103
default boolean copy(URI srcUri, URI dstUri)
104104
throws IOException {
105105
if (isDirectory(srcUri)) {
106-
throw new UnsupportedOperationException("Recursive copy not supported");
106+
throw new IllegalArgumentException("Recursive copy not supported");
107107
}
108108
return copyDir(srcUri, dstUri);
109109
}
@@ -123,10 +123,8 @@ default boolean copy(URI srcUri, URI dstUri)
123123
* @return true if copy is successful
124124
* @throws IOException on IO failure
125125
*/
126-
default boolean copyDir(URI srcUri, URI dstUri)
127-
throws IOException {
128-
throw new UnsupportedOperationException("Recursive copy not supported");
129-
}
126+
boolean copyDir(URI srcUri, URI dstUri)
127+
throws IOException;
130128

131129
/**
132130
* Checks whether the file or directory at the provided location exists.

pinot-spi/src/test/java/org/apache/pinot/spi/filesystem/LocalPinotFSTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public void testFS()
209209
try {
210210
localPinotFS.copy(firstTempDir.toURI(), secondTempDir.toURI());
211211
fail();
212-
} catch (UnsupportedOperationException e) {
212+
} catch (IllegalArgumentException e) {
213213
// expected.
214214
}
215215

0 commit comments

Comments
 (0)