Пример #1
0
 /**
  * expand super types after scanning, for super types that were not scanned. this is helpful in
  * finding the transitive closure without scanning all 3rd party dependencies. it uses {@link
  * ReflectionUtils#getSuperTypes(Class)}.
  *
  * <p>for example, for classes A,B,C where A supertype of B, B supertype of C:
  *
  * <ul>
  *   <li>if scanning C resulted in B (B->C in store), but A was not scanned (although A supertype
  *       of B) - then getSubTypes(A) will not return C
  *   <li>if expanding supertypes, B will be expanded with A (A->B in store) - then getSubTypes(A)
  *       will return C
  * </ul>
  */
 public void expandSuperTypes() {
   if (store.keySet().contains(index(SubTypesScanner.class))) {
     Multimap<String, String> mmap = store.get(index(SubTypesScanner.class));
     Sets.SetView<String> keys = Sets.difference(mmap.keySet(), Sets.newHashSet(mmap.values()));
     Multimap<String, String> expand = HashMultimap.create();
     for (String key : keys) {
       expandSupertypes(expand, key, forName(key));
     }
     mmap.putAll(expand);
   }
 }
  /**
   * @param gcBefore
   * @return
   */
  private List<SSTableReader> getNextBackgroundSSTables(final int gcBefore) {
    if (!isEnabled() || cfs.getSSTables().isEmpty()) return Collections.emptyList();

    Set<SSTableReader> uncompacting = Sets.intersection(sstables, cfs.getUncompactingSSTables());

    // Find fully expired SSTables. Those will be included no matter what.
    Set<SSTableReader> expired =
        CompactionController.getFullyExpiredSSTables(
            cfs, uncompacting, cfs.getOverlappingSSTables(uncompacting), gcBefore);
    Set<SSTableReader> candidates = Sets.newHashSet(filterSuspectSSTables(uncompacting));

    List<SSTableReader> compactionCandidates =
        new ArrayList<>(getNextNonExpiredSSTables(Sets.difference(candidates, expired), gcBefore));
    if (!expired.isEmpty()) {
      logger.debug("Including expired sstables: {}", expired);
      compactionCandidates.addAll(expired);
    }
    return compactionCandidates;
  }
Пример #3
0
 /** @return collection of the non-system tables */
 public List<String> getNonSystemTables() {
   return ImmutableList.copyOf(Sets.difference(tables.keySet(), systemKeyspaceNames));
 }