-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub-issue#1994 : Implementation Of Cloudwatch metrics source plugi…
…n configuration Junit test cases and source coordinator. Signed-off-by: venkataraopasyavula <[email protected]>
- Loading branch information
1 parent
21b26c5
commit 4ec407f
Showing
11 changed files
with
698 additions
and
74 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
31 changes: 31 additions & 0 deletions
31
...n/java/org/opensearch/dataprepper/plugins/source/CloudwatchPartitionCreationSupplier.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,31 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.dataprepper.plugins.source; | ||
|
||
import org.opensearch.dataprepper.model.source.coordinator.PartitionIdentifier; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.function.Function; | ||
|
||
public class CloudwatchPartitionCreationSupplier implements Function<Map<String, Object>, List<PartitionIdentifier>> { | ||
|
||
private List<String> metrics; | ||
|
||
public CloudwatchPartitionCreationSupplier(final List<String> metrics) { | ||
this.metrics = metrics; | ||
} | ||
|
||
@Override | ||
public List<PartitionIdentifier> apply(final Map<String, Object> globalStateMap) { | ||
final List<PartitionIdentifier> objectsToProcess = new ArrayList<>(); | ||
for ( String metric : metrics) { | ||
objectsToProcess.add(PartitionIdentifier.builder().withPartitionKey(metric).build()); | ||
} | ||
return objectsToProcess; | ||
} | ||
} |
Oops, something went wrong.