Tabnine Logo
PartitionPosition
Code IndexAdd Tabnine to your IDE (free)

How to use
PartitionPosition
in
org.apache.cassandra.db

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

origin: org.apache.cassandra/cassandra-all

  private Set<SSTableIndex> applyScope(Set<SSTableIndex> indexes)
  {
    return Sets.filter(indexes, index -> {
      SSTableReader sstable = index.getSSTable();
      return range.startKey().compareTo(sstable.last) <= 0 && (range.stopKey().isMinimum() || sstable.first.compareTo(range.stopKey()) <= 0);
    });
  }
}
origin: org.apache.cassandra/cassandra-all

  public long serializedSize(PartitionPosition pos, int version)
  {
    Kind kind = pos.kind();
    int size = 1; // 1 byte for enum
    if (kind == Kind.ROW_KEY)
    {
      int keySize = ((DecoratedKey)pos).getKey().remaining();
      size += TypeSizes.sizeof((short) keySize) + keySize;
    }
    else
    {
      size += Token.serializer.serializedSize(pos.getToken(), version);
    }
    return size;
  }
}
origin: jsevellec/cassandra-unit

private Paging(AbstractBounds<PartitionPosition> range,
        ClusteringIndexFilter filter,
        ClusteringComparator comparator,
        Clustering lastReturned,
        boolean inclusive)
{
  super(range, filter);
  // When using a paging range, we don't allow wrapped ranges, as it's unclear how to handle them properly.
  // This is ok for now since we only need this in range queries, and the range are "unwrapped" in that case.
  assert !(range instanceof Range) || !((Range<?>)range).isWrapAround() || range.right.isMinimum() : range;
  assert lastReturned != null;
  this.comparator = comparator;
  this.lastReturned = lastReturned;
  this.inclusive = inclusive;
}
origin: jsevellec/cassandra-unit

public int compareCustom(ByteBuffer o1, ByteBuffer o2)
{
  // o1 and o2 can be empty so we need to use PartitionPosition, not DecoratedKey
  return PartitionPosition.ForKey.get(o1, partitioner).compareTo(PartitionPosition.ForKey.get(o2, partitioner));
}
origin: org.apache.cassandra/cassandra-all

public int compareTo(PartitionPosition pos)
{
  if (this == pos)
    return 0;
  int cmp = getToken().compareTo(pos.getToken());
  if (cmp != 0)
    return cmp;
  if (isMinimumBound)
    return ((pos instanceof KeyBound) && ((KeyBound)pos).isMinimumBound) ? 0 : -1;
  else
    return ((pos instanceof KeyBound) && !((KeyBound)pos).isMinimumBound) ? 0 : 1;
}
origin: org.apache.cassandra/cassandra-all

public boolean isLimitedToOnePartition()
{
  return dataRange.keyRange instanceof Bounds
    && dataRange.startKey().kind() == PartitionPosition.Kind.ROW_KEY
    && dataRange.startKey().equals(dataRange.stopKey());
}
origin: org.apache.cassandra/cassandra-all

private Paging(AbstractBounds<PartitionPosition> range,
        ClusteringIndexFilter filter,
        ClusteringComparator comparator,
        Clustering lastReturned,
        boolean inclusive)
{
  super(range, filter);
  // When using a paging range, we don't allow wrapped ranges, as it's unclear how to handle them properly.
  // This is ok for now since we only need this in range queries, and the range are "unwrapped" in that case.
  assert !(range instanceof Range) || !((Range<?>)range).isWrapAround() || range.right.isMinimum() : range;
  assert lastReturned != null;
  this.comparator = comparator;
  this.lastReturned = lastReturned;
  this.inclusive = inclusive;
}
origin: org.apache.cassandra/cassandra-all

/**
 * Gets the position in the index file to start scanning to find the given key (at most indexInterval keys away,
 * modulo downsampling of the index summary). Always returns a {@code value >= 0}
 */
public long getIndexScanPosition(PartitionPosition key)
{
  if (openReason == OpenReason.MOVED_START && key.compareTo(first) < 0)
    key = first;
  return getIndexScanPositionFromBinarySearchResult(indexSummary.binarySearch(key), indexSummary);
}
origin: com.strapdata.cassandra/cassandra-all

public int compareTo(PartitionPosition pos)
{
  if (this == pos)
    return 0;
  int cmp = getToken().compareTo(pos.getToken());
  if (cmp != 0)
    return cmp;
  if (isMinimumBound)
    return ((pos instanceof KeyBound) && ((KeyBound)pos).isMinimumBound) ? 0 : -1;
  else
    return ((pos instanceof KeyBound) && !((KeyBound)pos).isMinimumBound) ? 0 : 1;
}
origin: jsevellec/cassandra-unit

public boolean isLimitedToOnePartition()
{
  return dataRange.keyRange instanceof Bounds
    && dataRange.startKey().kind() == PartitionPosition.Kind.ROW_KEY
    && dataRange.startKey().equals(dataRange.stopKey());
}
origin: com.strapdata.cassandra/cassandra-all

  private Set<SSTableIndex> applyScope(Set<SSTableIndex> indexes)
  {
    return Sets.filter(indexes, index -> {
      SSTableReader sstable = index.getSSTable();
      return range.startKey().compareTo(sstable.last) <= 0 && (range.stopKey().isMinimum() || sstable.first.compareTo(range.stopKey()) <= 0);
    });
  }
}
origin: com.strapdata.cassandra/cassandra-all

private Paging(AbstractBounds<PartitionPosition> range,
        ClusteringIndexFilter filter,
        ClusteringComparator comparator,
        Clustering lastReturned,
        boolean inclusive)
{
  super(range, filter);
  // When using a paging range, we don't allow wrapped ranges, as it's unclear how to handle them properly.
  // This is ok for now since we only need this in range queries, and the range are "unwrapped" in that case.
  assert !(range instanceof Range) || !((Range<?>)range).isWrapAround() || range.right.isMinimum() : range;
  assert lastReturned != null;
  this.comparator = comparator;
  this.lastReturned = lastReturned;
  this.inclusive = inclusive;
}
origin: jsevellec/cassandra-unit

  public long serializedSize(PartitionPosition pos, int version)
  {
    Kind kind = pos.kind();
    int size = 1; // 1 byte for enum
    if (kind == Kind.ROW_KEY)
    {
      int keySize = ((DecoratedKey)pos).getKey().remaining();
      size += TypeSizes.sizeof((short) keySize) + keySize;
    }
    else
    {
      size += Token.serializer.serializedSize(pos.getToken(), version);
    }
    return size;
  }
}
origin: com.strapdata.cassandra/cassandra-all

/**
 * Gets the position in the index file to start scanning to find the given key (at most indexInterval keys away,
 * modulo downsampling of the index summary). Always returns a {@code value >= 0}
 */
public long getIndexScanPosition(PartitionPosition key)
{
  if (openReason == OpenReason.MOVED_START && key.compareTo(first) < 0)
    key = first;
  return getIndexScanPositionFromBinarySearchResult(indexSummary.binarySearch(key), indexSummary);
}
origin: jsevellec/cassandra-unit

public int compareTo(PartitionPosition pos)
{
  if (this == pos)
    return 0;
  int cmp = getToken().compareTo(pos.getToken());
  if (cmp != 0)
    return cmp;
  if (isMinimumBound)
    return ((pos instanceof KeyBound) && ((KeyBound)pos).isMinimumBound) ? 0 : -1;
  else
    return ((pos instanceof KeyBound) && !((KeyBound)pos).isMinimumBound) ? 0 : 1;
}
origin: com.strapdata.cassandra/cassandra-all

public boolean isLimitedToOnePartition()
{
  return dataRange.keyRange instanceof Bounds
    && dataRange.startKey().kind() == PartitionPosition.Kind.ROW_KEY
    && dataRange.startKey().equals(dataRange.stopKey());
}
origin: jsevellec/cassandra-unit

  private Set<SSTableIndex> applyScope(Set<SSTableIndex> indexes)
  {
    return Sets.filter(indexes, index -> {
      SSTableReader sstable = index.getSSTable();
      return range.startKey().compareTo(sstable.last) <= 0 && (range.stopKey().isMinimum() || sstable.first.compareTo(range.stopKey()) <= 0);
    });
  }
}
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

private Paging(AbstractBounds<PartitionPosition> range,
        ClusteringIndexFilter filter,
        ClusteringComparator comparator,
        Clustering lastReturned,
        boolean inclusive)
{
  super(range, filter);
  // When using a paging range, we don't allow wrapped ranges, as it's unclear how to handle them properly.
  // This is ok for now since we only need this in range queries, and the range are "unwrapped" in that case.
  assert !(range instanceof Range) || !((Range<?>)range).isWrapAround() || range.right.isMinimum() : range;
  assert lastReturned != null;
  this.comparator = comparator;
  this.lastReturned = lastReturned;
  this.inclusive = inclusive;
}
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

  public long serializedSize(PartitionPosition pos, int version)
  {
    Kind kind = pos.kind();
    int size = 1; // 1 byte for enum
    if (kind == Kind.ROW_KEY)
    {
      int keySize = ((DecoratedKey)pos).getKey().remaining();
      size += TypeSizes.sizeof((short) keySize) + keySize;
    }
    else
    {
      size += Token.serializer.serializedSize(pos.getToken(), version);
    }
    return size;
  }
}
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

/**
 * Gets the position in the index file to start scanning to find the given key (at most indexInterval keys away,
 * modulo downsampling of the index summary). Always returns a {@code value >= 0}
 */
public long getIndexScanPosition(PartitionPosition key)
{
  if (openReason == OpenReason.MOVED_START && key.compareTo(first) < 0)
    key = first;
  return getIndexScanPositionFromBinarySearchResult(indexSummary.binarySearch(key), indexSummary);
}
org.apache.cassandra.dbPartitionPosition

Most used methods

  • isMinimum
  • compareTo
  • getToken
  • kind

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JLabel (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • From CI to AI: The AI layer in your organization
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