Skip to content

Commit

Permalink
Added One to Many Datatype Transformation for IT (#90)
Browse files Browse the repository at this point in the history
Added One to Many Datatype Transformation for IT
Fix PR review comments
  • Loading branch information
pawankashyapollion authored Feb 5, 2025
1 parent 191c13c commit 7d288f0
Show file tree
Hide file tree
Showing 17 changed files with 1,218 additions and 1,031 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.apache.beam.it.common.utils.ResourceManagerUtils;
import org.apache.beam.it.testcontainers.TestContainerResourceManager;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.annotations.VisibleForTesting;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableList;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -52,10 +51,10 @@
*
* <p>The class is thread-safe.
*/
public class CassandraSharedResourceManager
extends TestContainerResourceManager<GenericContainer<?>> implements ResourceManager {
public class CassandraResourceManager extends TestContainerResourceManager<GenericContainer<?>>
implements ResourceManager {

private static final Logger LOG = LoggerFactory.getLogger(CassandraSharedResourceManager.class);
private static final Logger LOG = LoggerFactory.getLogger(CassandraResourceManager.class);

private static final String DEFAULT_CASSANDRA_CONTAINER_NAME = "cassandra";

Expand All @@ -70,7 +69,7 @@ public class CassandraSharedResourceManager
private final String keyspaceName;
private final boolean usingStaticDatabase;

private CassandraSharedResourceManager(Builder builder) {
private CassandraResourceManager(Builder builder) {
this(
null,
new CassandraContainer<>(
Expand All @@ -80,7 +79,7 @@ private CassandraSharedResourceManager(Builder builder) {

@VisibleForTesting
@SuppressWarnings("nullness")
CassandraSharedResourceManager(
CassandraResourceManager(
@Nullable CqlSession cassandraClient, CassandraContainer<?> container, Builder builder) {
super(container, builder);
// we are trying to handle userDefined KeyspaceName name without usingStatic Container
Expand Down Expand Up @@ -176,19 +175,6 @@ public synchronized void execute(String statement) {
}
}

/**
* Inserts the given Document into a table.
*
* <p>A database will be created here, if one does not already exist.
*
* @param tableName The name of the table to insert the document into.
* @param document The document to insert into the table.
* @return A boolean indicating whether the Document was inserted successfully.
*/
public synchronized boolean insertDocument(String tableName, Map<String, Object> document) {
return insertDocuments(tableName, ImmutableList.of(document));
}

/**
* Inserts the given Documents into a collection.
*
Expand Down Expand Up @@ -312,9 +298,9 @@ private static RetryPolicy<Object> buildRetryPolicy() {
.build();
}

/** Builder for {@link CassandraSharedResourceManager}. */
/** Builder for {@link CassandraResourceManager}. */
public static final class Builder
extends TestContainerResourceManager.Builder<CassandraSharedResourceManager> {
extends TestContainerResourceManager.Builder<CassandraResourceManager> {

private @Nullable String keyspaceName;

Expand Down Expand Up @@ -359,8 +345,8 @@ public Builder sePreGeneratedKeyspaceName(boolean preGeneratedKeyspaceName) {
}

@Override
public CassandraSharedResourceManager build() {
return new CassandraSharedResourceManager(this);
public CassandraResourceManager build() {
return new CassandraResourceManager(this);
}
}
}

This file was deleted.

Loading

0 comments on commit 7d288f0

Please sign in to comment.