public int compareTo(ColumnIdentifier that) { int c = Long.compare(this.prefixComparison, that.prefixComparison); if (c != 0) return c; if (this == that) return 0; return ByteBufferUtil.compareUnsigned(this.bytes, that.bytes); }
public int compareCustom(ByteBuffer o1, ByteBuffer o2) { int diff = o1.get(o1.position()) - o2.get(o2.position()); if (diff != 0) return diff; return ByteBufferUtil.compareUnsigned(o1, o2); }
public int compareCustom(ByteBuffer o1, ByteBuffer o2) { int diff = o1.get(o1.position()) - o2.get(o2.position()); if (diff != 0) return diff; return ByteBufferUtil.compareUnsigned(o1, o2); }
public int compareCustom(ByteBuffer o1, ByteBuffer o2) { if (!o1.hasRemaining() || !o2.hasRemaining()) return o1.hasRemaining() ? 1 : o2.hasRemaining() ? -1 : 0; int diff = o1.get(o1.position()) - o2.get(o2.position()); if (diff != 0) return diff; return ByteBufferUtil.compareUnsigned(o1, o2); }
public static int compareLongs(ByteBuffer o1, ByteBuffer o2) { if (!o1.hasRemaining() || !o2.hasRemaining()) return o1.hasRemaining() ? 1 : o2.hasRemaining() ? -1 : 0; int diff = o1.get(o1.position()) - o2.get(o2.position()); if (diff != 0) return diff; return ByteBufferUtil.compareUnsigned(o1, o2); }
public int compareCustom(ByteBuffer o1, ByteBuffer o2) { if (!o1.hasRemaining() || !o2.hasRemaining()) return o1.hasRemaining() ? 1 : o2.hasRemaining() ? -1 : 0; int diff = o1.get(o1.position()) - o2.get(o2.position()); if (diff != 0) return diff; return ByteBufferUtil.compareUnsigned(o1, o2); }
public static int compareLongs(ByteBuffer o1, ByteBuffer o2) { if (!o1.hasRemaining() || !o2.hasRemaining()) return o1.hasRemaining() ? 1 : o2.hasRemaining() ? -1 : 0; int diff = o1.get(o1.position()) - o2.get(o2.position()); if (diff != 0) return diff; return ByteBufferUtil.compareUnsigned(o1, o2); }
public static int compareLongs(ByteBuffer o1, ByteBuffer o2) { if (!o1.hasRemaining() || !o2.hasRemaining()) return o1.hasRemaining() ? 1 : o2.hasRemaining() ? -1 : 0; int diff = o1.get(o1.position()) - o2.get(o2.position()); if (diff != 0) return diff; return ByteBufferUtil.compareUnsigned(o1, o2); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || !(obj instanceof DecoratedKey)) return false; DecoratedKey other = (DecoratedKey)obj; return ByteBufferUtil.compareUnsigned(getKey(), other.getKey()) == 0; // we compare faster than BB.equals for array backed BB }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || !(obj instanceof DecoratedKey)) return false; DecoratedKey other = (DecoratedKey)obj; return ByteBufferUtil.compareUnsigned(getKey(), other.getKey()) == 0; // we compare faster than BB.equals for array backed BB }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || !(obj instanceof DecoratedKey)) return false; DecoratedKey other = (DecoratedKey)obj; return ByteBufferUtil.compareUnsigned(getKey(), other.getKey()) == 0; // we compare faster than BB.equals for array backed BB }
@Inline static int compareUnsigned(Composite c1, Composite c2) { ByteBuffer b1 = c1.toByteBuffer(); ByteBuffer b2 = c2.toByteBuffer(); return ByteBufferUtil.compareUnsigned(b1, b2); }
public static int compareTo(IPartitioner partitioner, ByteBuffer key, PartitionPosition position) { // delegate to Token.KeyBound if needed if (!(position instanceof DecoratedKey)) return -position.compareTo(partitioner.decorateKey(key)); DecoratedKey otherKey = (DecoratedKey) position; int cmp = partitioner.getToken(key).compareTo(otherKey.getToken()); return cmp == 0 ? ByteBufferUtil.compareUnsigned(key, otherKey.getKey()) : cmp; }
public int compareTo(RowPosition pos) { if (this == pos) return 0; // delegate to Token.KeyBound if needed if (!(pos instanceof DecoratedKey)) return -pos.compareTo(this); DecoratedKey otherKey = (DecoratedKey) pos; int cmp = getToken().compareTo(otherKey.getToken()); return cmp == 0 ? ByteBufferUtil.compareUnsigned(getKey(), otherKey.getKey()) : cmp; }
public static int compareTo(IPartitioner partitioner, ByteBuffer key, PartitionPosition position) { // delegate to Token.KeyBound if needed if (!(position instanceof DecoratedKey)) return -position.compareTo(partitioner.decorateKey(key)); DecoratedKey otherKey = (DecoratedKey) position; int cmp = partitioner.getToken(key).compareTo(otherKey.getToken()); return cmp == 0 ? ByteBufferUtil.compareUnsigned(key, otherKey.getKey()) : cmp; }
public int compareTo(PartitionPosition pos) { if (this == pos) return 0; // delegate to Token.KeyBound if needed if (!(pos instanceof DecoratedKey)) return -pos.compareTo(this); DecoratedKey otherKey = (DecoratedKey) pos; int cmp = getToken().compareTo(otherKey.getToken()); return cmp == 0 ? ByteBufferUtil.compareUnsigned(getKey(), otherKey.getKey()) : cmp; }
public static int compareTo(IPartitioner partitioner, ByteBuffer key, PartitionPosition position) { // delegate to Token.KeyBound if needed if (!(position instanceof DecoratedKey)) return -position.compareTo(partitioner.decorateKey(key)); DecoratedKey otherKey = (DecoratedKey) position; int cmp = partitioner.getToken(key).compareTo(otherKey.getToken()); return cmp == 0 ? ByteBufferUtil.compareUnsigned(key, otherKey.getKey()) : cmp; }
public int compareTo(PartitionPosition pos) { if (this == pos) return 0; // delegate to Token.KeyBound if needed if (!(pos instanceof DecoratedKey)) return -pos.compareTo(this); DecoratedKey otherKey = (DecoratedKey) pos; int cmp = getToken().compareTo(otherKey.getToken()); return cmp == 0 ? ByteBufferUtil.compareUnsigned(getKey(), otherKey.getKey()) : cmp; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof ColumnFamily)) return false; ColumnFamily comparison = (ColumnFamily) o; return metadata.equals(comparison.metadata) && deletionInfo().equals(comparison.deletionInfo()) && ByteBufferUtil.compareUnsigned(digest(this), digest(comparison)) == 0; }
public int compareTo(PartitionPosition pos) { if (this == pos) return 0; // delegate to Token.KeyBound if needed if (!(pos instanceof DecoratedKey)) return -pos.compareTo(this); DecoratedKey otherKey = (DecoratedKey) pos; int cmp = getToken().compareTo(otherKey.getToken()); return cmp == 0 ? ByteBufferUtil.compareUnsigned(getKey(), otherKey.getKey()) : cmp; }