public ByteBuffer getIndexedValue(ByteBuffer partitionKey, Clustering clustering, CellPath path, ByteBuffer cellValue) { return path.get(0); }
public ByteBuffer getIndexedValue(ByteBuffer partitionKey, Clustering clustering, CellPath path, ByteBuffer cellValue) { return CompositeType.build(path.get(0), cellValue); }
public List<ByteBuffer> serializedValues(Iterator<Cell> cells) { List<ByteBuffer> bbs = new ArrayList<ByteBuffer>(); while (cells.hasNext()) bbs.add(cells.next().path().get(0)); return bbs; }
public void digest(MessageDigest digest) { for (int i = 0; i < size(); i++) digest.update(get(i).duplicate()); }
public void digest(MessageDigest digest) { for (int i = 0; i < size(); i++) digest.update(get(i).duplicate()); }
@Override public final int hashCode() { int result = 31; for (int i = 0; i < size(); i++) result += 31 * Objects.hash(get(i)); return result; }
public List<ByteBuffer> serializedValues(Iterator<Cell> cells) { List<ByteBuffer> bbs = new ArrayList<ByteBuffer>(); while (cells.hasNext()) bbs.add(cells.next().path().get(0)); return bbs; }
public List<ByteBuffer> serializedValues(Iterator<Cell> cells) { List<ByteBuffer> bbs = new ArrayList<ByteBuffer>(); while (cells.hasNext()) bbs.add(cells.next().path().get(0)); return bbs; }
public int dataSize() { int size = 0; for (int i = 0; i < size(); i++) size += get(i).remaining(); return size; }
@Override public final int hashCode() { int result = 31; for (int i = 0; i < size(); i++) result += 31 * Objects.hash(get(i)); return result; }
public ByteBuffer getIndexedValue(ByteBuffer partitionKey, Clustering clustering, CellPath path, ByteBuffer cellValue) { return CompositeType.build(path.get(0), cellValue); }
public List<ByteBuffer> serializedValues(Iterator<Cell> cells) { assert isMultiCell; List<ByteBuffer> bbs = new ArrayList<ByteBuffer>(); while (cells.hasNext()) { Cell c = cells.next(); bbs.add(c.path().get(0)); bbs.add(c.value()); } return bbs; }
public List<ByteBuffer> serializedValues(Iterator<Cell> cells) { assert isMultiCell; List<ByteBuffer> bbs = new ArrayList<ByteBuffer>(); while (cells.hasNext()) { Cell c = cells.next(); bbs.add(c.path().get(0)); bbs.add(c.value()); } return bbs; }
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s:%s]", from == CellPath.BOTTOM ? "" : type.getString(from.get(0)), to == CellPath.TOP ? "" : type.getString(to.get(0))); } }
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s:%s]", from == CellPath.BOTTOM ? "" : type.getString(from.get(0)), to == CellPath.TOP ? "" : type.getString(to.get(0))); } }
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s:%s]", from == CellPath.BOTTOM ? "" : type.getString(from.get(0)), to == CellPath.TOP ? "" : type.getString(to.get(0))); } }
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s]", type.getString(element.get(0))); } }
private void validateCellPath(CellPath path) { if (!isComplex()) throw new MarshalException("Only complex cells should have a cell path"); assert type.isMultiCell(); if (type.isCollection()) ((CollectionType)type).nameComparator().validate(path.get(0)); else ((UserType)type).nameComparator().validate(path.get(0)); }
private static ByteBuffer makeCellName(Clustering clustering, ColumnDefinition c, CellPath path) { int cs = clustering.size(); ByteBuffer[] values = new ByteBuffer[cs + 1 + (path == null ? 0 : path.size())]; for (int i = 0; i < cs; i++) values[i] = clustering.get(i); values[cs] = c.name.bytes; if (path != null) for (int i = 0; i < path.size(); i++) values[cs + 1 + i] = path.get(i); return CompositeType.build(values); }
private static ByteBuffer makeCellName(Clustering clustering, ColumnDefinition c, CellPath path) { int cs = clustering.size(); ByteBuffer[] values = new ByteBuffer[cs + 1 + (path == null ? 0 : path.size())]; for (int i = 0; i < cs; i++) values[i] = clustering.get(i); values[cs] = c.name.bytes; if (path != null) for (int i = 0; i < path.size(); i++) values[cs + 1 + i] = path.get(i); return CompositeType.build(values); }