-
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.
# This is a combination of 7 commits.
# This is the 1st commit message: additional test coverage Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> # This is the commit message #2: cleaned up JiraOauthConfig file Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> # This is the commit message #3: addressing review comments and simplifying the exception handling Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> # This is the commit message #4: Add external origination time for events created from S3 Object (#5104) Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com> Co-authored-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com> # This is the commit message #5: moved the wait block out of the catch block Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> # This is the commit message #6: Renewal logic adjusted Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> # This is the commit message #7: partial Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> fix merge issues Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> update Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> Add getColumnDataTypes method to SchemaManager to get datatype for table columns (#5135) Add getColumnDataTypes method to SchemaManager Signed-off-by: Dinu John <86094133+dinujoh@users.noreply.github.com> Add model for table column metadata for Global state (#5136) Signed-off-by: Dinu John <86094133+dinujoh@users.noreply.github.com> Rename the KDS source plugin name to "kinesis-data-streams" (#5138) Signed-off-by: Souvik Bose <souvbose@amazon.com> Co-authored-by: Souvik Bose <souvbose@amazon.com> Addressed review comments (#5108) Signed-off-by: Krishna Kondaka <krishkdk@amazon.com> fixes related to source config properties change Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> removed future handling for loop based operations Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> additional test cases Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> addressing review comments Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> Jira Service Test coverage Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> jirasourceconfigTest comments Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> introduced RestClient and moved rest template interactions to there. Similar chage on the test cases too Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> backingoff for any kind of exception. Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> restructured constants file Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com> JiraSourceTests Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> JiraItemInfo coverage Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> jira service branch coverage Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> branch coverage jira service Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> move add Items to queue logic into JiraItemInfo Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> fixing regex and adding date time formatter Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> Revert "Jira source" re add changes and fix issues Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> unneeded comment Signed-off-by: Maxwell Brown <mxwelwbr@amazon.com> using issue bean methods to simplify the logic Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
- Loading branch information
Showing
36 changed files
with
1,277 additions
and
519 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
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
43 changes: 43 additions & 0 deletions
43
...ce/src/main/java/org/opensearch/dataprepper/plugins/source/rds/model/DbTableMetadata.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,43 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.dataprepper.plugins.source.rds.model; | ||
|
||
import java.util.Map; | ||
|
||
public class DbTableMetadata { | ||
|
||
private static final String DB_METADATA_KEY = "dbMetadata"; | ||
private static final String TABLE_COLUMN_METADATA_KEY = "tableColumnDataTypeMap"; | ||
private final DbMetadata dbMetadata; | ||
private final Map<String, Map<String, String>> tableColumnDataTypeMap; | ||
|
||
public DbTableMetadata(final DbMetadata dbMetadata, final Map<String, Map<String, String>> tableColumnDataTypeMap) { | ||
this.dbMetadata = dbMetadata; | ||
this.tableColumnDataTypeMap = tableColumnDataTypeMap; | ||
} | ||
|
||
public DbMetadata getDbMetadata() { | ||
return dbMetadata; | ||
} | ||
|
||
public Map<String, Map<String, String>> getTableColumnDataTypeMap() { | ||
return tableColumnDataTypeMap; | ||
} | ||
|
||
public Map<String, Object> toMap() { | ||
return Map.of( | ||
DB_METADATA_KEY, dbMetadata.toMap(), | ||
TABLE_COLUMN_METADATA_KEY, tableColumnDataTypeMap | ||
); | ||
} | ||
|
||
public static DbTableMetadata fromMap(Map<String, Object> map) { | ||
return new DbTableMetadata( | ||
DbMetadata.fromMap((Map<String, Object>)map.get(DB_METADATA_KEY)), | ||
(Map<String, Map<String, String>>) map.get(TABLE_COLUMN_METADATA_KEY) | ||
); | ||
} | ||
} |
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
48 changes: 48 additions & 0 deletions
48
...rce/src/test/java/org/opensearch/dataprepper/plugins/source/rds/model/DbMetadataTest.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,48 @@ | ||
package org.opensearch.dataprepper.plugins.source.rds.model; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Random; | ||
import java.util.UUID; | ||
|
||
import static org.hamcrest.CoreMatchers.notNullValue; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.CoreMatchers.is; | ||
|
||
public class DbMetadataTest { | ||
|
||
@Test | ||
public void test_fromMap_success() { | ||
final String dbIdentifier = UUID.randomUUID().toString(); | ||
final String hostName = UUID.randomUUID().toString(); | ||
final int port = new Random().nextInt(); | ||
final Map<String, Object> map = new HashMap<>(); | ||
map.put("dbIdentifier", dbIdentifier); | ||
map.put("hostName", hostName); | ||
map.put("port", port); | ||
|
||
final DbMetadata result = DbMetadata.fromMap(map); | ||
|
||
assertThat(result.getDbIdentifier(), is(dbIdentifier)); | ||
assertThat(result.getHostName(), is(hostName)); | ||
assertThat(result.getPort(), is(port)); | ||
} | ||
|
||
@Test | ||
public void test_toMap_success() { | ||
final String dbIdentifier = UUID.randomUUID().toString(); | ||
final String hostName = UUID.randomUUID().toString(); | ||
final int port = new Random().nextInt(); | ||
final DbMetadata dbMetadata = new DbMetadata(dbIdentifier, hostName, port); | ||
|
||
final Map<String, Object> result = dbMetadata.toMap(); | ||
|
||
assertThat(result, is(notNullValue())); | ||
assertThat(result.size(), is(3)); | ||
assertThat(result.get("dbIdentifier"), is(dbIdentifier)); | ||
assertThat(result.get("hostName"), is(hostName)); | ||
assertThat(result.get("port"), is(port)); | ||
} | ||
} |
Oops, something went wrong.