code: public void maybeBuildSecondaryIndexes(Collection<SSTableReader> sstables, Set<String> idxNames)
      {
          if (idxNames.isEmpty())
              return;
  
          logger.info(String.format("Submitting index build of %s for data in %s",
                                    idxNames, StringUtils.join(sstables, ", ")));
  
          SecondaryIndexBuilder builder = new SecondaryIndexBuilder(baseCfs, idxNames, new ReducingKeyIterator(sstables));
          Future<?> future = CompactionManager.instance.submitIndexBuild(builder);
          FBUtilities.waitOnFuture(future);
  
          flushIndexesBlocking();
  
          logger.info("Index build of {} complete", idxNames);
      }
docs: Does a full, blocking rebuild of the indexes specified by columns from the sstables.
  Does nothing if columns is empty.
  
  Caller must acquire and release references to the sstables used here.
  
  @param sstables the data to build from
  @param idxNames the list of columns to index, ordered by comparator