Skip to content

Commit

Permalink
Add more javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffxiang committed Dec 17, 2024
1 parent 747ea7f commit cb2e485
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;

/**
* A {@link DeadLetterQueueHandler} that writes failed uploads to a local file with human-readable formatting.
*/
public class LocalFileDeadLetterQueueHandler extends DeadLetterQueueHandler {

private static final Logger LOG = LogManager.getLogger(LocalFileDeadLetterQueueHandler.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;

/**
* A {@link DeadLetterQueueHandler} that writes failed uploads to a local executable file in a format
* that can be run as-is to retry the uploads.
*/
public class S3LocalExecutableDeadLetterQueueHandler extends DeadLetterQueueHandler {

private static final Logger LOG = LogManager.getLogger(S3LocalExecutableDeadLetterQueueHandler.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ void testExponentialBackoffRetries() throws InterruptedException {
}
}

/**
* Test that retry exhaustion calls the DLQ handler
*/
@Test
void testRetryExhaustion() throws Exception {
// override s3AsyncClient to have a very short timeout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ public void onCompletion(DirectoryTreeWatcher.UploadTask uploadTask, long totalT
});
}

/**
* Ensure that an upload that times out returns the correct error code and exception
*/
@Test
void testTimeoutUpload() throws IOException {
// override s3AsyncClient to have a very short timeout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

public class TestS3LocalExecutableDeadLetterQueueHandler extends TestBase {

/**
* Test the handler by having it send many tasks concurrently to a local executable file.
*/
@Test
void testConcurrentSend() throws IOException, ExecutionException, InterruptedException {
String filePath = "/tmp/s3-local-executable-dlq-handler-test.sh";
Expand Down

0 comments on commit cb2e485

Please sign in to comment.