-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into lambda-sink-stateful
Signed-off-by: Srikanth Govindarajan <[email protected]>
- Loading branch information
Showing
30 changed files
with
785 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...in/java/org/opensearch/dataprepper/plugins/lambda/common/util/CountingRetryCondition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.opensearch.dataprepper.plugins.lambda.common.util; | ||
|
||
import software.amazon.awssdk.core.retry.RetryPolicyContext; | ||
|
||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
//Used ONLY for tests | ||
public class CountingRetryCondition extends CustomLambdaRetryCondition { | ||
private final AtomicInteger retryCount = new AtomicInteger(0); | ||
|
||
@Override | ||
public boolean shouldRetry(RetryPolicyContext context) { | ||
boolean shouldRetry = super.shouldRetry(context); | ||
if (shouldRetry) { | ||
retryCount.incrementAndGet(); | ||
} | ||
return shouldRetry; | ||
} | ||
|
||
public int getRetryCount() { | ||
return retryCount.get(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ava/org/opensearch/dataprepper/plugins/lambda/common/util/CustomLambdaRetryCondition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.opensearch.dataprepper.plugins.lambda.common.util; | ||
|
||
import software.amazon.awssdk.core.retry.conditions.RetryCondition; | ||
import software.amazon.awssdk.core.retry.RetryPolicyContext; | ||
|
||
public class CustomLambdaRetryCondition implements RetryCondition { | ||
|
||
@Override | ||
public boolean shouldRetry(RetryPolicyContext context) { | ||
Throwable exception = context.exception(); | ||
if (exception != null) { | ||
return LambdaRetryStrategy.isRetryableException(exception); | ||
} | ||
|
||
return false; | ||
} | ||
} |
Oops, something went wrong.