Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added One to Many Datatype Transformation for IT #90

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
Loading