forked from opensearch-project/data-prepper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Progress Check interface and test files
Signed-off-by: Krishna Kondaka <[email protected]>
- Loading branch information
Krishna Kondaka
committed
Nov 3, 2023
1 parent
740cb4b
commit d3bfac4
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...er-api/src/main/java/org/opensearch/dataprepper/model/acknowledgements/ProgressCheck.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 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.dataprepper.model.acknowledgements; | ||
|
||
public interface ProgressCheck { | ||
/** | ||
* Returns the pending ratio | ||
* | ||
* @return returns the ratio of pending to the total acknowledgements | ||
* @since 2.6 | ||
*/ | ||
Double getRatio(); | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
...-core/src/main/java/org/opensearch/dataprepper/acknowledgements/DefaultProgressCheck.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,21 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.dataprepper.acknowledgements; | ||
|
||
import org.opensearch.dataprepper.model.acknowledgements.ProgressCheck; | ||
|
||
public class DefaultProgressCheck implements ProgressCheck { | ||
double ratio; | ||
|
||
public DefaultProgressCheck(double ratio) { | ||
this.ratio = ratio; | ||
} | ||
|
||
@Override | ||
public Double getRatio() { | ||
return ratio; | ||
} | ||
} |