maedhroz commented on a change in pull request #1098:
URL: https://github.com/apache/cassandra/pull/1098#discussion_r683633618
##########
File path:
src/java/org/apache/cassandra/index/internal/CollatedViewIndexBuilder.java
##########
@@ -55,29 +57,57 @@ public CollatedViewIndexBuilder(ColumnFamilyStore cfs,
Set<Index> indexers, Redu
public CompactionInfo getCompactionInfo()
{
return new CompactionInfo(cfs.metadata(),
- OperationType.INDEX_BUILD,
- iter.getBytesRead(),
- iter.getTotalBytes(),
- compactionId,
- sstables);
+ OperationType.INDEX_BUILD,
+ iter.getBytesRead(),
+ iter.getTotalBytes(),
+ compactionId,
+ sstables);
}
public void build()
{
try
{
int pageSize = cfs.indexManager.calculateIndexingPageSize();
+ RegularAndStaticColumns targetPartitionColumns =
extractIndexedColumns();
+
while (iter.hasNext())
{
if (isStopRequested())
throw new
CompactionInterruptedException(getCompactionInfo());
DecoratedKey key = iter.next();
- cfs.indexManager.indexPartition(key, indexers, pageSize);
+ cfs.indexManager.indexPartition(key, indexers, pageSize,
targetPartitionColumns);
}
}
finally
{
iter.close();
}
}
+
+ private RegularAndStaticColumns extractIndexedColumns()
+ {
+ RegularAndStaticColumns.Builder builder =
RegularAndStaticColumns.builder();
+
+ for (Index index : indexers)
+ {
+ boolean isPartitionIndex = true;
+
+ for (ColumnMetadata column :
cfs.metadata().regularAndStaticColumns())
+ {
+ if (index.dependsOn(column))
+ {
+ builder.add(column);
+ isPartitionIndex = false;
+ }
+
+ // if any index declares no dependency on any column, it is a
full partition index
+ // so we can use the base partition columns as the input source
+ if (isPartitionIndex)
Review comment:
Fixed.
--
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]