27
27
import org .apache .cassandra .db .compression .ICompressionDictionaryTrainer .TrainingStatus ;
28
28
import org .apache .cassandra .db .compression .ManualTrainingOptions ;
29
29
import org .apache .cassandra .tools .NodeProbe ;
30
+ import org .apache .cassandra .utils .Clock ;
30
31
import picocli .CommandLine .Command ;
31
32
import picocli .CommandLine .Option ;
32
33
import picocli .CommandLine .Parameters ;
@@ -116,9 +117,9 @@ public void execute(NodeProbe probe)
116
117
"writing to new SSTable, you might consider running nodetool 'flush' along " +
117
118
"with this command to have chunk available for sampling)" );
118
119
long maxWaitMillis = TimeUnit .SECONDS .toMillis (maxSamplingDurationSeconds + 300 ); // Add 5 minutes for training
119
- long startTime = System .currentTimeMillis ();
120
+ long startTime = Clock . Global .currentTimeMillis ();
120
121
121
- while (System .currentTimeMillis () - startTime < maxWaitMillis )
122
+ while (Clock . Global .currentTimeMillis () - startTime < maxWaitMillis )
122
123
{
123
124
String statusStr = probe .getCompressionDictionaryTrainingStatus (keyspace , table );
124
125
TrainingStatus status = TrainingStatus .valueOf (statusStr );
@@ -136,7 +137,7 @@ else if (TrainingStatus.FAILED == status)
136
137
// Display meaningful statistics
137
138
long sampleCount = probe .getCompressionDictionaryTrainingSampleCount (keyspace , table );
138
139
long totalSampleSize = probe .getCompressionDictionaryTrainingTotalSampleSize (keyspace , table );
139
- long elapsedSeconds = (System .currentTimeMillis () - startTime ) / 1000 ;
140
+ long elapsedSeconds = (Clock . Global .currentTimeMillis () - startTime ) / 1000 ;
140
141
double sampleSizeMB = totalSampleSize / (1024.0 * 1024.0 );
141
142
142
143
out .printf ("\r Status: %s | Samples: %d | Size: %.2f MiB | Elapsed: %ds" ,
0 commit comments