Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.google.common.annotations.VisibleForTesting;
import org.apache.beam.sdk.io.astra.db.CqlSessionHolder;
import org.apache.beam.sdk.options.ValueProvider.StaticValueProvider;
import org.jline.utils.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -43,15 +42,15 @@ public CassandraConnector(
case ASTRA -> getSessionAstra(cassandraDataSource.astra(), schemaReference);
default -> getSessionOss(cassandraDataSource.oss(), schemaReference);
};
Log.info(
LOG.info(
"Connected to Cassandra Source dataSource = {}, schemaReference = {}",
cassandraDataSource,
schemaReference);
}

private CqlSession getSessionOss(
CassandraDataSourceOss dataSourceOss, CassandraSchemaReference schemaReference) {
Log.info(
LOG.info(
"Connecting to Cassandra OSS Source dataSource = {}, schemaReference = {}",
dataSourceOss,
schemaReference);
Expand All @@ -66,7 +65,7 @@ private CqlSession getSessionOss(

private CqlSession getSessionAstra(
AstraDbDataSource astraDbDataSource, CassandraSchemaReference schemaReference) {
Log.info(
LOG.info(
"Connecting to Cassandra Astra Source dataSource = {}, schemaReference = {}",
astraDbDataSource,
schemaReference);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.jline.utils.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -54,7 +53,7 @@ public final class CassandraSchemaDiscovery implements RetriableSchemaDiscovery
public ImmutableList<String> discoverTables(
DataSource dataSource, SourceSchemaReference sourceSchemaReference)
throws SchemaDiscoveryException, RetriableSchemaDiscoveryException {
Log.info(
LOG.info(
"CassandraSchemaDiscovery discoverTables started dataSource = {}, sourceSchemaReference = {}",
dataSource,
sourceSchemaReference);
Expand All @@ -63,7 +62,7 @@ public ImmutableList<String> discoverTables(
sourceSchemaReference.getKind().equals(SourceSchemaReference.Kind.CASSANDRA));
ImmutableList<String> tables =
discoverTables(dataSource.cassandra(), sourceSchemaReference.cassandra());
Log.info(
LOG.info(
"CassandraSchemaDiscovery discoverTables completed dataSource = {}, sourceSchemaReference = {}, tables = {}",
dataSource,
sourceSchemaReference,
Expand All @@ -87,7 +86,7 @@ private ImmutableList<String> discoverTables(
.map(n -> n.asCql(true))
.collect(ImmutableList.toImmutableList());
} catch (DriverException e) {
Log.error(
LOG.error(
"CassandraSchemaDiscovery discoverTables dataSource = {}, sourceSchemaReference = {}",
dataSource,
sourceSchemaReference,
Expand All @@ -112,7 +111,7 @@ private ImmutableList<String> discoverTables(
public ImmutableMap<String, ImmutableMap<String, SourceColumnType>> discoverTableSchema(
DataSource dataSource, SourceSchemaReference schemaReference, ImmutableList<String> tables)
throws SchemaDiscoveryException, RetriableSchemaDiscoveryException {
Log.info(
LOG.info(
"CassandraSchemaDiscovery discoverTableSchema started dataSource = {}, sourceSchemaReference = {}, tables = {}",
dataSource,
schemaReference,
Expand All @@ -122,7 +121,7 @@ public ImmutableMap<String, ImmutableMap<String, SourceColumnType>> discoverTabl
schemaReference.getKind().equals(SourceSchemaReference.Kind.CASSANDRA));
ImmutableMap<String, ImmutableMap<String, SourceColumnType>> schema =
this.discoverTableSchema(dataSource.cassandra(), schemaReference.cassandra(), tables);
Log.info(
LOG.info(
"CassandraSchemaDiscovery discoverTableSchema completed dataSource = {}, sourceSchemaReference = {}, tables = {}, schema = {}",
dataSource,
schemaReference,
Expand All @@ -146,7 +145,7 @@ private ImmutableMap<String, ImmutableMap<String, SourceColumnType>> discoverTab
}
return builder.build();
} catch (DriverException e) {
Log.error(
LOG.error(
"CassandraSchemaDiscovery discoverTableSchema dataSource = {}, sourceSchemaReference = {}, tables = {}",
dataSource,
schemaReference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import javax.sql.DataSource;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.commons.lang3.StringUtils;
import org.jline.utils.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -139,7 +138,7 @@ public JdbcDataSource(JdbcIOWrapperConfig jdbcIOWrapperConfig) {

private void initializeSuper() {

Log.info("Initializing {}", this);
LOG.info("Initializing {}", this);

super.setDriverClassName(jdbcDriverClassName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.UnknownKeyFor;
import org.jetbrains.annotations.NotNull;
import org.jline.utils.Log;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -252,7 +251,7 @@ public void allTypesTest() throws Exception {
: row.getValue(colName).toString()));
readValues.add(rowMapBuilder.build());
}
Log.info("Spanner Cassandra Values are: {}", readValues);
LOG.info("Spanner Cassandra Values are: {}", readValues);
assertThat(readValues).isEqualTo(entry.getValue());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.jline.utils.Log;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ChangeEventToMapConvertor {

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

public static Map<String, Object> convertChangeEventToMap(JsonNode changeEvent)
throws InvalidChangeEventException {
Map<String, Object> sourceRecord = new HashMap<>();
Expand Down Expand Up @@ -83,7 +87,7 @@ public static JsonNode transformChangeEventViaCustomTransformation(
} else if (columnValue instanceof String) {
((ObjectNode) changeEvent).put(columnName, (String) columnValue);
} else {
Log.error(
LOG.error(
"Column name(" + columnName + ") has unsupported column value(" + columnValue + ")");
throw new InvalidTransformationException(
"Column name(" + columnName + ") has unsupported column value(" + columnValue + ")");
Expand Down
Loading