Skip to content

Commit

Permalink
feature: Not storing duplicate data in external storage (Netflix#153)
Browse files Browse the repository at this point in the history
* Not storing duplicate data in external storage

Signed-off-by: Simon Misencik <simon.misencik@gmail.com>

* Add dependencies

Signed-off-by: Simon Misencik <simon.misencik@gmail.com>

---------

Signed-off-by: Simon Misencik <simon.misencik@gmail.com>
  • Loading branch information
SimonMisencik authored and jmasar committed Oct 11, 2023
1 parent 30ba565 commit ca31a75
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,22 +268,22 @@ private String getKey(String input) {

private void assertCount(int expected) throws SQLException {
try (PreparedStatement stmt =
testPostgres
.getDataSource()
.getConnection()
.prepareStatement(
"SELECT count(id) FROM external.external_payload");
ResultSet rs = stmt.executeQuery()) {
testPostgres
.getDataSource()
.getConnection()
.prepareStatement(
"SELECT count(id) FROM external.external_payload");
ResultSet rs = stmt.executeQuery()) {
rs.next();
assertEquals(expected, rs.getInt(1));
}
}

private String getCreatedOn(String key) throws SQLException {
try (Connection conn = testPostgres.getDataSource().getConnection();
PreparedStatement stmt =
conn.prepareStatement(
"SELECT created_on FROM external.external_payload WHERE id = ?")) {
PreparedStatement stmt =
conn.prepareStatement(
"SELECT created_on FROM external.external_payload WHERE id = ?")) {
stmt.setString(1, key);
try (ResultSet rs = stmt.executeQuery()) {
rs.next();
Expand Down

0 comments on commit ca31a75

Please sign in to comment.