code: public static CellNameType getIndexComparator(CFMetaData baseMetadata, ColumnDefinition cdef)
      {
          switch (cdef.getIndexType())
          {
              case KEYS:
                  return new SimpleDenseCellNameType(keyComparator);
              case COMPOSITES:
                  return CompositesIndex.getIndexComparator(baseMetadata, cdef);
              case CUSTOM:
                  return null;
          }
          throw new AssertionError();
      }
docs: Returns the index comparator for index backed by CFS, or null.
  
  Note: it would be cleaner to have this be a member method. However we need this when opening indexes
  sstables, but by then the CFS won't be fully initiated, so the SecondaryIndex object won't be accessible.