Skip to content

Commit

Permalink
Added trace log
Browse files Browse the repository at this point in the history
  • Loading branch information
pravinbhat committed Sep 9, 2024
1 parent f4e24f6 commit b722b10
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
import java.util.ArrayList;
import java.util.Collection;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.datastax.cdm.feature.TrackRun;
import com.datastax.cdm.feature.TrackRun.RUN_TYPE;
import com.datastax.cdm.job.RunNotStartedException;
Expand All @@ -44,6 +47,8 @@ public class TargetUpsertRunDetailsStatement {
private BoundStatement boundSelectInfoStatement;
private BoundStatement boundSelectStatement;

public Logger logger = LoggerFactory.getLogger(this.getClass().getName());

public TargetUpsertRunDetailsStatement(CqlSession session, String keyspaceTable) {
this.session = session;
String[] ksTab = keyspaceTable.split("\\.");
Expand All @@ -56,11 +61,14 @@ public TargetUpsertRunDetailsStatement(CqlSession session, String keyspaceTable)
String cdmKsTabDetails = this.keyspaceName + ".cdm_run_details";

this.session.execute("create table if not exists " + cdmKsTabInfo
+ " (table_name text, run_id bigint, run_type text, prev_run_id bigint, start_time timestamp, end_time timestamp, run_info text, primary key (table_name, run_id))");
+ " (table_name text, run_id bigint, run_type text, prev_run_id bigint, start_time timestamp, end_time timestamp, run_info text, status text, primary key (table_name, run_id))");

// TODO: Remove this code block after a few releases, its only added for backward compatibility
try {
this.session.execute("alter table " + cdmKsTabInfo + " add status text");
} catch (Exception e) {
// ignore if column already exists
logger.trace("Column 'status' already exists in table {}", cdmKsTabInfo);
}

boundInitInfoStatement = bindStatement("INSERT INTO " + cdmKsTabInfo
Expand Down

0 comments on commit b722b10

Please sign in to comment.