Codota Logo
DiskBoundaries.getDiskIndex
Code IndexAdd Codota to your IDE (free)

How to use
getDiskIndex
method
in
org.apache.cassandra.db.DiskBoundaries

Best Java code snippets using org.apache.cassandra.db.DiskBoundaries.getDiskIndex (Showing top 12 results out of 315)

  • Common ways to obtain DiskBoundaries
private void myMethod () {
DiskBoundaries d =
  • Codota IconColumnFamilyStore cfs;cfs.getDiskBoundaries()
  • Codota IconColumnFamilyStore columnFamilyStore;new DiskBoundaries(columnFamilyStore.getDirectories().getWriteableLocations(), BlacklistedDirectories.getDirectoriesVersion())
  • Codota IconDiskBoundaryManager diskBoundaryManager;ColumnFamilyStore columnFamilyStore;diskBoundaryManager.getDiskBoundaries(columnFamilyStore)
  • Smart code suggestions by Codota
}
origin: org.apache.cassandra/cassandra-all

  public Directories.DataDirectory getCorrectDiskForSSTable(SSTableReader sstable)
  {
    return directories.get(getDiskIndex(sstable));
  }
}
origin: jsevellec/cassandra-unit

  public Directories.DataDirectory getCorrectDiskForSSTable(SSTableReader sstable)
  {
    return directories.get(getDiskIndex(sstable));
  }
}
origin: com.strapdata.cassandra/cassandra-all

  public Directories.DataDirectory getCorrectDiskForSSTable(SSTableReader sstable)
  {
    return directories.get(getDiskIndex(sstable));
  }
}
origin: org.apache.cassandra/cassandra-all

public Map<Integer, List<SSTableReader>> groupByDiskIndex(Set<SSTableReader> needsRelocation)
{
  return needsRelocation.stream().collect(Collectors.groupingBy((s) -> diskBoundaries.getDiskIndex(s)));
}
origin: jsevellec/cassandra-unit

public Map<Integer, List<SSTableReader>> groupByDiskIndex(Set<SSTableReader> needsRelocation)
{
  return needsRelocation.stream().collect(Collectors.groupingBy((s) -> diskBoundaries.getDiskIndex(s)));
}
origin: com.strapdata.cassandra/cassandra-all

public Map<Integer, List<SSTableReader>> groupByDiskIndex(Set<SSTableReader> needsRelocation)
{
  return needsRelocation.stream().collect(Collectors.groupingBy((s) -> diskBoundaries.getDiskIndex(s)));
}
origin: org.apache.cassandra/cassandra-all

/**
 * Get the correct compaction strategy for the given sstable. If the first token starts within a disk boundary, we
 * will add it to that compaction strategy.
 *
 * In the case we are upgrading, the first compaction strategy will get most files - we do not care about which disk
 * the sstable is on currently (unless we don't know the local tokens yet). Once we start compacting we will write out
 * sstables in the correct locations and give them to the correct compaction strategy instance.
 *
 * @param sstable
 * @return
 */
@VisibleForTesting
protected int compactionStrategyIndexFor(SSTableReader sstable)
{
  // should not call maybeReload because it may be called from within lock
  readLock.lock();
  try
  {
    //We only have a single compaction strategy when sstables are not
    //partitioned by token range
    if (!partitionSSTablesByTokenRange)
      return 0;
    return currentBoundaries.getDiskIndex(sstable);
  }
  finally
  {
    readLock.unlock();
  }
}
origin: jsevellec/cassandra-unit

/**
 * Get the correct compaction strategy for the given sstable. If the first token starts within a disk boundary, we
 * will add it to that compaction strategy.
 *
 * In the case we are upgrading, the first compaction strategy will get most files - we do not care about which disk
 * the sstable is on currently (unless we don't know the local tokens yet). Once we start compacting we will write out
 * sstables in the correct locations and give them to the correct compaction strategy instance.
 *
 * @param sstable
 * @return
 */
@VisibleForTesting
protected int compactionStrategyIndexFor(SSTableReader sstable)
{
  // should not call maybeReload because it may be called from within lock
  readLock.lock();
  try
  {
    //We only have a single compaction strategy when sstables are not
    //partitioned by token range
    if (!partitionSSTablesByTokenRange)
      return 0;
    return currentBoundaries.getDiskIndex(sstable);
  }
  finally
  {
    readLock.unlock();
  }
}
origin: com.strapdata.cassandra/cassandra-all

/**
 * Get the correct compaction strategy for the given sstable. If the first token starts within a disk boundary, we
 * will add it to that compaction strategy.
 *
 * In the case we are upgrading, the first compaction strategy will get most files - we do not care about which disk
 * the sstable is on currently (unless we don't know the local tokens yet). Once we start compacting we will write out
 * sstables in the correct locations and give them to the correct compaction strategy instance.
 *
 * @param sstable
 * @return
 */
@VisibleForTesting
protected int compactionStrategyIndexFor(SSTableReader sstable)
{
  // should not call maybeReload because it may be called from within lock
  readLock.lock();
  try
  {
    //We only have a single compaction strategy when sstables are not
    //partitioned by token range
    if (!partitionSSTablesByTokenRange)
      return 0;
    return currentBoundaries.getDiskIndex(sstable);
  }
  finally
  {
    readLock.unlock();
  }
}
origin: org.apache.cassandra/cassandra-all

private boolean inCorrectLocation(SSTableReader sstable)
{
  if (!cfs.getPartitioner().splitter().isPresent())
    return true;
  int diskIndex = diskBoundaries.getDiskIndex(sstable);
  File diskLocation = diskBoundaries.directories.get(diskIndex).location;
  PartitionPosition diskLast = diskBoundaries.positions.get(diskIndex);
  // the location we get from directoryIndex is based on the first key in the sstable
  // now we need to make sure the last key is less than the boundary as well:
  return sstable.descriptor.directory.getAbsolutePath().startsWith(diskLocation.getAbsolutePath()) && sstable.last.compareTo(diskLast) <= 0;
}
origin: com.strapdata.cassandra/cassandra-all

private boolean inCorrectLocation(SSTableReader sstable)
{
  if (!cfs.getPartitioner().splitter().isPresent())
    return true;
  int diskIndex = diskBoundaries.getDiskIndex(sstable);
  File diskLocation = diskBoundaries.directories.get(diskIndex).location;
  PartitionPosition diskLast = diskBoundaries.positions.get(diskIndex);
  // the location we get from directoryIndex is based on the first key in the sstable
  // now we need to make sure the last key is less than the boundary as well:
  return sstable.descriptor.directory.getAbsolutePath().startsWith(diskLocation.getAbsolutePath()) && sstable.last.compareTo(diskLast) <= 0;
}
origin: jsevellec/cassandra-unit

private boolean inCorrectLocation(SSTableReader sstable)
{
  if (!cfs.getPartitioner().splitter().isPresent())
    return true;
  int diskIndex = diskBoundaries.getDiskIndex(sstable);
  File diskLocation = diskBoundaries.directories.get(diskIndex).location;
  PartitionPosition diskLast = diskBoundaries.positions.get(diskIndex);
  // the location we get from directoryIndex is based on the first key in the sstable
  // now we need to make sure the last key is less than the boundary as well:
  return sstable.descriptor.directory.getAbsolutePath().startsWith(diskLocation.getAbsolutePath()) && sstable.last.compareTo(diskLast) <= 0;
}
org.apache.cassandra.dbDiskBoundariesgetDiskIndex

Popular methods of DiskBoundaries

  • <init>
  • getBoundariesFromSSTableDirectory
    Try to figure out location based on sstable directory
  • getCorrectDiskForSSTable
  • invalidate
  • isOutOfDate
    check if the given disk boundaries are out of date due not being set or to having too old diskVersio

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now