Skip to content

Commit 6c04f3c

Browse files
committed
PR review fixes
1 parent 0279656 commit 6c04f3c

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

src/main/java/datastax/astra/migrate/AbstractJobSession.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public class AbstractJobSession extends BaseJobSession {
3030
protected List<String> ttlWTCols;
3131
protected String tsReplaceValStr;
3232
protected long tsReplaceVal;
33-
protected Long customWritetime = 0l;
34-
protected Long incrWritetime = 0l;
33+
protected long customWriteTime = 0l;
34+
protected long incrementWriteTime = 0l;
3535

3636
protected AbstractJobSession(CqlSession sourceSession, CqlSession astraSession, SparkConf sc) {
3737
this(sourceSession, astraSession, sc, false);
@@ -98,19 +98,19 @@ protected AbstractJobSession(CqlSession sourceSession, CqlSession astraSession,
9898
String customWriteTimeStr =
9999
Util.getSparkPropOr(sc, "spark.target.writeTime.fixedValue", "0");
100100
if (null != customWriteTimeStr && customWriteTimeStr.trim().length() > 0 && StringUtils.isNumeric(customWriteTimeStr.trim())) {
101-
customWritetime = Long.parseLong(customWriteTimeStr);
101+
customWriteTime = Long.parseLong(customWriteTimeStr);
102102
}
103103

104104
String incrWriteTimeStr =
105105
Util.getSparkPropOr(sc, "spark.target.writeTime.incrementBy", "0");
106106
if (null != incrWriteTimeStr && incrWriteTimeStr.trim().length() > 0 && StringUtils.isNumeric(incrWriteTimeStr.trim())) {
107-
incrWritetime = Long.parseLong(incrWriteTimeStr);
107+
incrementWriteTime = Long.parseLong(incrWriteTimeStr);
108108
}
109109

110110
logger.info("PARAM -- TTL-WriteTime Columns: {}", ttlWTCols);
111111
logger.info("PARAM -- WriteTimes Filter: {}", writeTimeStampFilter);
112-
logger.info("PARAM -- WriteTime Custom Value: {}", customWritetime);
113-
logger.info("PARAM -- WriteTime increment Value: {}", incrWritetime);
112+
logger.info("PARAM -- WriteTime Custom Value: {}", customWriteTime);
113+
logger.info("PARAM -- WriteTime Increment Value: {}", incrementWriteTime);
114114
if (writeTimeStampFilter) {
115115
logger.info("PARAM -- minWriteTimeStampFilter: {} datetime is {}", minWriteTimeStampFilter,
116116
Instant.ofEpochMilli(minWriteTimeStampFilter / 1000));
@@ -202,10 +202,10 @@ public BoundStatement bindInsert(PreparedStatement insertStatement, Row sourceRo
202202
if (!ttlWTCols.isEmpty()) {
203203
boundInsertStatement = boundInsertStatement.set(index, getLargestTTL(sourceRow), Integer.class);
204204
index++;
205-
if (customWritetime > 0) {
206-
boundInsertStatement = boundInsertStatement.set(index, customWritetime, Long.class);
205+
if (customWriteTime > 0) {
206+
boundInsertStatement = boundInsertStatement.set(index, customWriteTime, Long.class);
207207
} else {
208-
boundInsertStatement = boundInsertStatement.set(index, getLargestWriteTimeStamp(sourceRow) + incrWritetime, Long.class);
208+
boundInsertStatement = boundInsertStatement.set(index, getLargestWriteTimeStamp(sourceRow) + incrementWriteTime, Long.class);
209209
}
210210
}
211211
}

src/main/java/datastax/astra/migrate/BaseJobSession.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,26 @@ public abstract class BaseJobSession {
3131
// Rate = Total Throughput (write/read per sec) / Total Executors
3232
protected RateLimiter readLimiter;
3333
protected RateLimiter writeLimiter;
34-
protected Integer maxRetries = 10;
34+
protected int maxRetries = 10;
3535
protected AtomicLong readCounter = new AtomicLong(0);
36-
protected Integer batchSize = 1;
37-
protected Integer fetchSizeInRows = 1000;
38-
protected Integer printStatsAfter = 100000;
36+
protected int batchSize = 1;
37+
protected int fetchSizeInRows = 1000;
38+
protected int printStatsAfter;
3939

40-
protected Boolean writeTimeStampFilter = Boolean.FALSE;
41-
protected Long minWriteTimeStampFilter = 0l;
42-
protected Long maxWriteTimeStampFilter = Long.MAX_VALUE;
40+
protected boolean writeTimeStampFilter;
41+
protected long minWriteTimeStampFilter = 0l;
42+
protected long maxWriteTimeStampFilter = Long.MAX_VALUE;
4343

44-
protected Boolean isCounterTable = false;
44+
protected boolean isCounterTable;
4545

4646
protected String sourceKeyspaceTable;
4747
protected String astraKeyspaceTable;
4848

49-
protected Boolean hasRandomPartitioner;
50-
protected Boolean filterData;
49+
protected boolean hasRandomPartitioner;
50+
protected boolean filterData;
5151
protected String filterColName;
5252
protected String filterColType;
53-
protected Integer filterColIndex;
53+
protected int filterColIndex;
5454
protected String filterColValue;
5555
protected String sourceSelectCondition;
5656

src/main/java/datastax/astra/migrate/DiffJobSession.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public class DiffJobSession extends CopyJobSession {
3030
private final AtomicLong validCounter = new AtomicLong(0);
3131
private final AtomicLong skippedCounter = new AtomicLong(0);
3232
public Logger logger = LoggerFactory.getLogger(this.getClass().getName());
33-
protected Boolean autoCorrectMissing = false;
34-
protected Boolean autoCorrectMismatch = false;
33+
protected boolean autoCorrectMissing;
34+
protected boolean autoCorrectMismatch;
3535

3636
private DiffJobSession(CqlSession sourceSession, CqlSession astraSession, SparkConf sc) {
3737
super(sourceSession, astraSession, sc);

src/main/java/datastax/astra/migrate/GuardrailJobSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class GuardrailJobSession extends BaseJobSession {
1919
protected AtomicLong readCounter = new AtomicLong(0);
2020
protected AtomicLong largeRowCounter = new AtomicLong(0);
2121
protected AtomicLong largeFieldCounter = new AtomicLong(0);
22-
protected Integer guardrailColSizeInKB;
22+
protected int guardrailColSizeInKB;
2323

2424
protected GuardrailJobSession(CqlSession session, SparkConf sc) {
2525
super(sc);

0 commit comments

Comments
 (0)