public boolean rebuildOnFailedScrub(Throwable failure){
  if (!isIndex())   return false;
  SecondaryIndex index=null;
  if (metadata.cfName.contains(Directories.SECONDARY_INDEX_NAME_SEPARATOR)) {
    String[] parts=metadata.cfName.split("\\" + Directories.SECONDARY_INDEX_NAME_SEPARATOR,2);
    ColumnFamilyStore parentCfs=keyspace.getColumnFamilyStore(parts[0]);
    index=parentCfs.indexManager.getIndexByName(metadata.cfName);
    assert index != null;
  }
  if (index == null)   return false;
  truncateBlocking();
  logger.warn("Rebuilding index for {} because of <{}>",name,failure.getMessage());
  index.getBaseCfs().rebuildSecondaryIndex(index.getIndexName());
  return true;
}

public boolean rebuildOnFailedScrub ( Throwable failure ) { if ( ! isIndex ( ) ) return false ; SecondaryIndex index = null ; if ( metadata . cfName . contains ( Directories . SECONDARY_INDEX_NAME_SEPARATOR ) ) { String [ ] parts = metadata . cfName . split ( "\\" + Directories . SECONDARY_INDEX_NAME_SEPARATOR , 2 ) ; ColumnFamilyStore parentCfs = keyspace . getColumnFamilyStore ( parts [ 0 ] ) ; index = parentCfs . indexManager . getIndexByName ( metadata . cfName ) ; assert index != null ; } if ( index == null ) return false ; truncateBlocking ( ) ; logger . warn ( "Rebuilding index for {} because of <{}>" , name , failure . getMessage ( ) ) ; index . getBaseCfs ( ) . rebuildSecondaryIndex ( index . getIndexName ( ) ) ; return true ; }
cassandra - 5174 : for an index cfs we may be able to discard everything and just rebuild the index when a scrub fails .
