|
21 | 21 | import java.util.HashSet; |
22 | 22 | import java.util.List; |
23 | 23 | import java.util.Set; |
24 | | -import java.util.UUID; |
25 | 24 | import java.util.concurrent.TimeUnit; |
26 | 25 |
|
27 | 26 | import org.slf4j.Logger; |
|
36 | 35 | import org.apache.cassandra.db.rows.UnfilteredRowIterators; |
37 | 36 | import org.apache.cassandra.io.sstable.SSTableReadsListener; |
38 | 37 | import org.apache.cassandra.io.sstable.format.SSTableReader; |
| 38 | +import org.apache.cassandra.utils.Clock; |
39 | 39 | import org.apache.cassandra.utils.FBUtilities; |
40 | 40 | import org.apache.cassandra.utils.TimeUUID; |
41 | 41 |
|
@@ -120,7 +120,7 @@ public void validate() |
120 | 120 | private void doValidate() |
121 | 121 | { |
122 | 122 | logger.info("Starting compaction validation for task {}", id); |
123 | | - long startedNanos = System.nanoTime(); |
| 123 | + long startedNanos = Clock.Global.nanoTime(); |
124 | 124 | metrics.incrementValidation(); |
125 | 125 |
|
126 | 126 | Set<DecoratedKey> absentKeys = new HashSet<>(); |
@@ -152,14 +152,14 @@ private void doValidate() |
152 | 152 | { |
153 | 153 | metrics.incrementValidationWithoutAbsentKeys(); |
154 | 154 | logger.info("[Task {}] Compaction validation passed: all first/last keys found in update sstables, took {}ms", |
155 | | - id, TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startedNanos)); |
| 155 | + id, TimeUnit.NANOSECONDS.toMillis(Clock.Global.nanoTime() - startedNanos)); |
156 | 156 | return; |
157 | 157 | } |
158 | 158 |
|
159 | 159 | metrics.incrementAbsentKeys(absentKeys.size()); |
160 | 160 | if (validateAbsentKeysAgainstTombstones(absentKeys)) |
161 | 161 | logger.info("[Task {}] Compaction validation passed: all absent keys are properly obsoleted due to tombstones, took {} ms", |
162 | | - id, TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startedNanos)); |
| 162 | + id, TimeUnit.NANOSECONDS.toMillis(Clock.Global.nanoTime() - startedNanos)); |
163 | 163 | } |
164 | 164 |
|
165 | 165 | private boolean isKeyAbsentInOutputSSTables(DecoratedKey key) |
|
0 commit comments