Tabnine Logo
Tracker.getCompacting
Code IndexAdd Tabnine to your IDE (free)

How to use
getCompacting
method
in
org.apache.cassandra.db.lifecycle.Tracker

Best Java code snippets using org.apache.cassandra.db.lifecycle.Tracker.getCompacting (Showing top 20 results out of 315)

origin: org.apache.cassandra/cassandra-all

public boolean isCompacting(Iterable<ColumnFamilyStore> cfses)
{
  for (ColumnFamilyStore cfs : cfses)
    if (!cfs.getTracker().getCompacting().isEmpty())
      return true;
  return false;
}
origin: jsevellec/cassandra-unit

public boolean isCompacting(Iterable<ColumnFamilyStore> cfses)
{
  for (ColumnFamilyStore cfs : cfses)
    if (!cfs.getTracker().getCompacting().isEmpty())
      return true;
  return false;
}
origin: com.strapdata.cassandra/cassandra-all

public boolean isCompacting(Iterable<ColumnFamilyStore> cfses)
{
  for (ColumnFamilyStore cfs : cfses)
    if (!cfs.getTracker().getCompacting().isEmpty())
      return true;
  return false;
}
origin: org.apache.cassandra/cassandra-all

private Set<SSTableReader> getCompacting(int level)
{
  Set<SSTableReader> sstables = new HashSet<>();
  Set<SSTableReader> levelSSTables = new HashSet<>(getLevel(level));
  for (SSTableReader sstable : cfs.getTracker().getCompacting())
  {
    if (levelSSTables.contains(sstable))
      sstables.add(sstable);
  }
  return sstables;
}
origin: org.apache.cassandra/cassandra-all

  public LifecycleTransaction call()
  {
    assert data.getCompacting().isEmpty() : data.getCompacting();
    Iterable<SSTableReader> sstables = getLiveSSTables();
    sstables = AbstractCompactionStrategy.filterSuspectSSTables(sstables);
    sstables = ImmutableList.copyOf(sstables);
    LifecycleTransaction modifier = data.tryModify(sstables, operationType);
    assert modifier != null: "something marked things compacting while compactions are disabled";
    return modifier;
  }
};
origin: com.strapdata.cassandra/cassandra-all

  public LifecycleTransaction call()
  {
    assert data.getCompacting().isEmpty() : data.getCompacting();
    Iterable<SSTableReader> sstables = getLiveSSTables();
    sstables = AbstractCompactionStrategy.filterSuspectSSTables(sstables);
    sstables = ImmutableList.copyOf(sstables);
    LifecycleTransaction modifier = data.tryModify(sstables, operationType);
    assert modifier != null: "something marked things compacting while compactions are disabled";
    return modifier;
  }
};
origin: jsevellec/cassandra-unit

private Set<SSTableReader> getCompacting(int level)
{
  Set<SSTableReader> sstables = new HashSet<>();
  Set<SSTableReader> levelSSTables = new HashSet<>(getLevel(level));
  for (SSTableReader sstable : cfs.getTracker().getCompacting())
  {
    if (levelSSTables.contains(sstable))
      sstables.add(sstable);
  }
  return sstables;
}
origin: com.strapdata.cassandra/cassandra-all

private Set<SSTableReader> getCompacting(int level)
{
  Set<SSTableReader> sstables = new HashSet<>();
  Set<SSTableReader> levelSSTables = new HashSet<>(getLevel(level));
  for (SSTableReader sstable : cfs.getTracker().getCompacting())
  {
    if (levelSSTables.contains(sstable))
      sstables.add(sstable);
  }
  return sstables;
}
origin: jsevellec/cassandra-unit

  public LifecycleTransaction call()
  {
    assert data.getCompacting().isEmpty() : data.getCompacting();
    Iterable<SSTableReader> sstables = getLiveSSTables();
    sstables = AbstractCompactionStrategy.filterSuspectSSTables(sstables);
    sstables = ImmutableList.copyOf(sstables);
    LifecycleTransaction modifier = data.tryModify(sstables, operationType);
    assert modifier != null: "something marked things compacting while compactions are disabled";
    return modifier;
  }
};
origin: jsevellec/cassandra-unit

/**
 * @param cfs
 * @param transaction the modifying managing the status of the sstables we're replacing
 */
public AbstractCompactionTask(ColumnFamilyStore cfs, LifecycleTransaction transaction)
{
  this.cfs = cfs;
  this.transaction = transaction;
  this.isUserDefined = false;
  this.compactionType = OperationType.COMPACTION;
  // enforce contract that caller should mark sstables compacting
  Set<SSTableReader> compacting = transaction.tracker.getCompacting();
  for (SSTableReader sstable : transaction.originals())
    assert compacting.contains(sstable) : sstable.getFilename() + " is not correctly marked compacting";
}
origin: org.apache.cassandra/cassandra-all

/**
 * Discard all SSTables that were created before given timestamp.
 *
 * Caller should first ensure that comapctions have quiesced.
 *
 * @param truncatedAt The timestamp of the truncation
 *                    (all SSTables before that timestamp are going be marked as compacted)
 */
public void discardSSTables(long truncatedAt)
{
  assert data.getCompacting().isEmpty() : data.getCompacting();
  List<SSTableReader> truncatedSSTables = new ArrayList<>();
  for (SSTableReader sstable : getSSTables(SSTableSet.LIVE))
  {
    if (!sstable.newSince(truncatedAt))
      truncatedSSTables.add(sstable);
  }
  if (!truncatedSSTables.isEmpty())
    markObsolete(truncatedSSTables, OperationType.UNKNOWN);
}
origin: jsevellec/cassandra-unit

/**
 * Discard all SSTables that were created before given timestamp.
 *
 * Caller should first ensure that comapctions have quiesced.
 *
 * @param truncatedAt The timestamp of the truncation
 *                    (all SSTables before that timestamp are going be marked as compacted)
 */
public void discardSSTables(long truncatedAt)
{
  assert data.getCompacting().isEmpty() : data.getCompacting();
  List<SSTableReader> truncatedSSTables = new ArrayList<>();
  for (SSTableReader sstable : getSSTables(SSTableSet.LIVE))
  {
    if (!sstable.newSince(truncatedAt))
      truncatedSSTables.add(sstable);
  }
  if (!truncatedSSTables.isEmpty())
    markObsolete(truncatedSSTables, OperationType.UNKNOWN);
}
origin: com.strapdata.cassandra/cassandra-all

/**
 * Discard all SSTables that were created before given timestamp.
 *
 * Caller should first ensure that comapctions have quiesced.
 *
 * @param truncatedAt The timestamp of the truncation
 *                    (all SSTables before that timestamp are going be marked as compacted)
 */
public void discardSSTables(long truncatedAt)
{
  assert data.getCompacting().isEmpty() : data.getCompacting();
  List<SSTableReader> truncatedSSTables = new ArrayList<>();
  for (SSTableReader sstable : getSSTables(SSTableSet.LIVE))
  {
    if (!sstable.newSince(truncatedAt))
      truncatedSSTables.add(sstable);
  }
  if (!truncatedSSTables.isEmpty())
    markObsolete(truncatedSSTables, OperationType.UNKNOWN);
}
origin: org.apache.cassandra/cassandra-all

/**
 * @param cfs
 * @param transaction the modifying managing the status of the sstables we're replacing
 */
public AbstractCompactionTask(ColumnFamilyStore cfs, LifecycleTransaction transaction)
{
  this.cfs = cfs;
  this.transaction = transaction;
  this.isUserDefined = false;
  this.compactionType = OperationType.COMPACTION;
  // enforce contract that caller should mark sstables compacting
  Set<SSTableReader> compacting = transaction.tracker.getCompacting();
  for (SSTableReader sstable : transaction.originals())
    assert compacting.contains(sstable) : sstable.getFilename() + " is not correctly marked compacting";
}
origin: com.strapdata.cassandra/cassandra-all

/**
 * @param cfs
 * @param transaction the modifying managing the status of the sstables we're replacing
 */
public AbstractCompactionTask(ColumnFamilyStore cfs, LifecycleTransaction transaction)
{
  this.cfs = cfs;
  this.transaction = transaction;
  this.isUserDefined = false;
  this.compactionType = OperationType.COMPACTION;
  // enforce contract that caller should mark sstables compacting
  Set<SSTableReader> compacting = transaction.tracker.getCompacting();
  for (SSTableReader sstable : transaction.originals())
    assert compacting.contains(sstable) : sstable.getFilename() + " is not correctly marked compacting";
}
origin: jsevellec/cassandra-unit

  @Override
  @SuppressWarnings("resource")
  public void runMayThrow() throws Exception
  {
    LifecycleTransaction modifier = null;
    while (modifier == null)
    {
      for (SSTableReader compactingSSTable : cfs.getTracker().getCompacting())
        sstables.releaseIfHolds(compactingSSTable);
      Set<SSTableReader> compactedSSTables = new HashSet<>();
      for (SSTableReader sstable : sstables)
        if (sstable.isMarkedCompacted())
          compactedSSTables.add(sstable);
      sstables.release(compactedSSTables);
      modifier = cfs.getTracker().tryModify(sstables, OperationType.ANTICOMPACTION);
    }
    performAnticompaction(cfs, ranges, sstables, modifier, repairedAt, parentRepairSession);
  }
};
origin: jsevellec/cassandra-unit

private SSTableReader findDroppableSSTable(final int gcBefore)
{
  level:
  for (int i = manifest.getLevelCount(); i >= 0; i--)
  {
    // sort sstables by droppable ratio in descending order
    SortedSet<SSTableReader> sstables = manifest.getLevelSorted(i, new Comparator<SSTableReader>()
    {
      public int compare(SSTableReader o1, SSTableReader o2)
      {
        double r1 = o1.getEstimatedDroppableTombstoneRatio(gcBefore);
        double r2 = o2.getEstimatedDroppableTombstoneRatio(gcBefore);
        return -1 * Doubles.compare(r1, r2);
      }
    });
    if (sstables.isEmpty())
      continue;
    Set<SSTableReader> compacting = cfs.getTracker().getCompacting();
    for (SSTableReader sstable : sstables)
    {
      if (sstable.getEstimatedDroppableTombstoneRatio(gcBefore) <= tombstoneThreshold)
        continue level;
      else if (!compacting.contains(sstable) && !sstable.isMarkedSuspect() && worthDroppingTombstones(sstable, gcBefore))
        return sstable;
    }
  }
  return null;
}
origin: org.apache.cassandra/cassandra-all

private SSTableReader findDroppableSSTable(final int gcBefore)
{
  level:
  for (int i = manifest.getLevelCount(); i >= 0; i--)
  {
    // sort sstables by droppable ratio in descending order
    SortedSet<SSTableReader> sstables = manifest.getLevelSorted(i, new Comparator<SSTableReader>()
    {
      public int compare(SSTableReader o1, SSTableReader o2)
      {
        double r1 = o1.getEstimatedDroppableTombstoneRatio(gcBefore);
        double r2 = o2.getEstimatedDroppableTombstoneRatio(gcBefore);
        return -1 * Doubles.compare(r1, r2);
      }
    });
    if (sstables.isEmpty())
      continue;
    Set<SSTableReader> compacting = cfs.getTracker().getCompacting();
    for (SSTableReader sstable : sstables)
    {
      if (sstable.getEstimatedDroppableTombstoneRatio(gcBefore) <= tombstoneThreshold)
        continue level;
      else if (!compacting.contains(sstable) && !sstable.isMarkedSuspect() && worthDroppingTombstones(sstable, gcBefore))
        return sstable;
    }
  }
  return null;
}
origin: org.apache.cassandra/cassandra-all

  @Override
  @SuppressWarnings("resource")
  public void runMayThrow() throws Exception
  {
    LifecycleTransaction modifier = null;
    while (modifier == null)
    {
      for (SSTableReader compactingSSTable : cfs.getTracker().getCompacting())
        sstables.releaseIfHolds(compactingSSTable);
      // We don't anti-compact any SSTable that has been compacted during repair as it may have been compacted
      // with unrepaired data.
      Set<SSTableReader> compactedSSTables = new HashSet<>();
      for (SSTableReader sstable : sstables)
        if (sstable.isMarkedCompacted())
          compactedSSTables.add(sstable);
      sstables.release(compactedSSTables);
      modifier = cfs.getTracker().tryModify(sstables, OperationType.ANTICOMPACTION);
    }
    performAnticompaction(cfs, ranges, sstables, modifier, repairedAt, parentRepairSession);
  }
};
origin: com.strapdata.cassandra/cassandra-all

  @Override
  @SuppressWarnings("resource")
  public void runMayThrow() throws Exception
  {
    LifecycleTransaction modifier = null;
    while (modifier == null)
    {
      for (SSTableReader compactingSSTable : cfs.getTracker().getCompacting())
        sstables.releaseIfHolds(compactingSSTable);
      // We don't anti-compact any SSTable that has been compacted during repair as it may have been compacted
      // with unrepaired data.
      Set<SSTableReader> compactedSSTables = new HashSet<>();
      for (SSTableReader sstable : sstables)
        if (sstable.isMarkedCompacted())
          compactedSSTables.add(sstable);
      sstables.release(compactedSSTables);
      modifier = cfs.getTracker().tryModify(sstables, OperationType.ANTICOMPACTION);
    }
    performAnticompaction(cfs, ranges, sstables, modifier, repairedAt, parentRepairSession);
  }
};
org.apache.cassandra.db.lifecycleTrackergetCompacting

Popular methods of Tracker

  • tryModify
  • <init>
  • addInitialSSTables
  • apply
    atomically tests permit against the view and applies function to it, if permit yields true, returnin
  • dropSSTables
    removes all sstables that are not busy compacting.
  • dropSSTablesIfInvalid
  • emptySet
  • isDummy
  • updateSizeTracking
  • addSSTables
  • getMemtableFor
    get the Memtable that the ordered writeOp should be directed to
  • getUncompacting
  • getMemtableFor,
  • getUncompacting,
  • getView,
  • markFlushing,
  • maybeIncrementallyBackup,
  • notify,
  • notifyAdded,
  • notifyDeleting,
  • notifyDiscarded

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • IsNull (org.hamcrest.core)
    Is the value null?
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now