Example usage for org.apache.cassandra.dht Range contains

List of usage examples for org.apache.cassandra.dht Range contains

Introduction

In this page you can find the example usage for org.apache.cassandra.dht Range contains.

Prototype

public boolean contains(T point) 

Source Link

Document

Helps determine if a given point on the DHT ring is contained in the range in question.

Usage

From source file:com.tuplejump.stargate.IndexContainer.java

License:Apache License

private boolean intersects(Range<Token> filterRange, boolean isSingleToken, boolean isFullRange,
        Range<Token> range) {
    boolean intersects;
    if (isFullRange)
        intersects = true;//from w  ww . j  av  a 2  s . c o  m
    else if (isSingleToken)
        intersects = range.contains(filterRange.left);
    else {
        intersects = range.intersects(filterRange);
    }
    return intersects;
}

From source file:org.elassandra.cluster.InternalCassandraClusterService.java

License:Apache License

public boolean tokenRangesContains(Collection<Range<Token>> shardTokenRanges, Token token) {
    for (Range<Token> shardRange : shardTokenRanges) {
        if (shardRange.contains(token))
            return true;
    }/*  w  ww. ja v a2 s  .c  o  m*/
    return false;
}