aratno commented on code in PR #4428:
URL: https://github.com/apache/cassandra/pull/4428#discussion_r2539467129


##########
src/java/org/apache/cassandra/db/streaming/CassandraStreamReader.java:
##########
@@ -187,8 +192,21 @@ protected SSTableTxnSingleStreamWriter 
createWriter(ColumnFamilyStore cfs, long
         StreamReceiver streamReceiver = session.getAggregator(tableId);
         Preconditions.checkState(streamReceiver instanceof 
CassandraStreamReceiver);
         ILifecycleTransaction txn = createTxn();
-        RangeAwareSSTableWriter writer = new RangeAwareSSTableWriter(cfs, 
estimatedKeys, repairedAt, pendingRepair, coordinatorLogOffsets, format, 
sstableLevel, totalSize, txn, getHeader(cfs.metadata()));
-        return new SSTableTxnSingleStreamWriter(txn, writer);
+        if (session.streamOperation() == StreamOperation.TRACKED_TRANSFER)
+        {
+            
Preconditions.checkState(cfs.metadata().replicationType().isTracked());
+            File location = 
cfs.getDirectories().getPendingLocationForDisk(localDir, session.planId());
+            Descriptor desc = cfs.newSSTableDescriptor(location, format);
+            SSTableMultiWriter writer = SimpleSSTableMultiWriter.create(desc, 
estimatedKeys, ActiveRepairService.UNREPAIRED_SSTABLE, 
ActiveRepairService.NO_PENDING_REPAIR,
+                                                                               
     coordinatorLogOffsets, cfs.metadata, null, sstableLevel, 
getHeader(cfs.metadata()),
+                                                                               
     cfs.indexManager.listIndexGroups(), txn, cfs);
+            return new SSTableTxnSingleStreamWriter(txn, writer);
+        }
+        else
+        {
+            RangeAwareSSTableWriter writer = new RangeAwareSSTableWriter(cfs, 
estimatedKeys, repairedAt, pendingRepair, coordinatorLogOffsets, format, 
sstableLevel, totalSize, txn, getHeader(cfs.metadata()));
+            return new SSTableTxnSingleStreamWriter(txn, writer);

Review Comment:
   Just pushed an update that makes pending transfers work with disk 
boundaries, that improves this a bit



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to