Skip to content

Commit

Permalink
Change RemoteDirectory.close to a no-op
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <kalsac@amazon.com>
  • Loading branch information
Sachin Kale committed Jun 29, 2022
1 parent 25a5306 commit 3e0aa6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@ public IndexInput openInput(String name, IOContext context) throws IOException {
}

/**
* Closes the directory by deleting all the files in this directory
* Closes the remote directory. Currently, it is a no-op.
* If remote directory maintains a state in future, we need to clean it before closing the directory
*/
@Override
public void close() throws IOException {
blobContainer.delete();
// Do nothing
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,6 @@ public void testOpenInputNoSuchFileException() throws IOException {
assertThrows(NoSuchFileException.class, () -> remoteDirectory.openInput("segment_1", IOContext.DEFAULT));
}

public void testClose() throws IOException {
remoteDirectory.close();

verify(blobContainer).delete();
}

public void testCloseIOException() throws IOException {
when(blobContainer.delete()).thenThrow(new IOException("Error while writing to blob store"));

assertThrows(IOException.class, () -> remoteDirectory.close());
}

public void testFileLength() throws IOException {
Map<String, BlobMetadata> fileInfo = new HashMap<>();
fileInfo.put("segment_1", new PlainBlobMetadata("segment_1", 100));
Expand Down

0 comments on commit 3e0aa6b

Please sign in to comment.