blambov commented on code in PR #2064:
URL: https://github.com/apache/cassandra/pull/2064#discussion_r1081325365
##########
src/java/org/apache/cassandra/index/sasi/SASIIndexBuilder.java:
##########
@@ -82,46 +82,46 @@ public void build()
PerSSTableIndexWriter indexWriter =
SASIIndex.newWriter(keyValidator, sstable.descriptor, indexes,
OperationType.COMPACTION);
targetDirectory = indexWriter.getDescriptor().directory.path();
- long previousKeyPosition = 0;
- try (KeyIterator keys = new KeyIterator(sstable.descriptor,
cfs.metadata()))
+ try (KeyReader keys = sstable.keyReader())
{
- while (keys.hasNext())
+ while (!keys.isExhausted())
{
if (isStopRequested())
throw new
CompactionInterruptedException(getCompactionInfo());
- final DecoratedKey key = keys.next();
- final long keyPosition = keys.getKeyPosition();
+ final DecoratedKey key =
sstable.decorateKey(keys.key());
+ final long keyPosition =
keys.keyPositionForSecondaryIndex();
- indexWriter.startPartition(key, keyPosition);
+ indexWriter.startPartition(key, keys.dataPosition(),
keyPosition);
- try
- {
- long position = sstable.getPosition(key,
SSTableReader.Operator.EQ);
- dataFile.seek(position);
- ByteBufferUtil.readWithShortLength(dataFile); //
key
+ long position = sstable.getPosition(key,
SSTableReader.Operator.EQ);
Review Comment:
looks good
--
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]