File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
src/main/java/datastax/astra/migrate Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ public void getDataAndInsert(BigInteger min, BigInteger max) {
81
81
82
82
// cannot do batching if the writeFilter is greater than 0 or
83
83
// maxWriteTimeStampFilter is less than max long
84
- if (batchSize == 1 || writeTimeStampFilter ) {
84
+ // do not batch for counters as it adds latency & increases chance of discrepancy
85
+ if (batchSize == 1 || writeTimeStampFilter || isCounterTable ) {
85
86
for (Row sourceRow : resultSet ) {
86
87
readLimiter .acquire (1 );
87
88
@@ -124,13 +125,7 @@ public void getDataAndInsert(BigInteger min, BigInteger max) {
124
125
if (readCounter .incrementAndGet () % 1000 == 0 ) {
125
126
logger .info ("TreadID: " + Thread .currentThread ().getId () + " Read Record Count: " + readCounter .get ());
126
127
}
127
- Row astraRow = null ;
128
- if (isCounterTable ) {
129
- ResultSet astraReadResultSet = astraSession
130
- .execute (selectFromAstra (astraSelectStatement , sourceRow ));
131
- astraRow = astraReadResultSet .one ();
132
- }
133
- batchStatement = batchStatement .add (bindInsert (astraInsertStatement , sourceRow , astraRow ));
128
+ batchStatement = batchStatement .add (bindInsert (astraInsertStatement , sourceRow , null ));
134
129
135
130
// if batch threshold is met, send the writes and clear the batch
136
131
if (batchStatement .size () >= batchSize ) {
You can’t perform that action at this time.
0 commit comments