public static void appendKeyString(StringBuilder sb, AbstractType<?> type, ByteBuffer key) { if (type instanceof CompositeType) { CompositeType ct = (CompositeType)type; ByteBuffer[] values = ct.split(key); for (int i = 0; i < ct.types.size(); i++) sb.append(i == 0 ? "" : ", ").append(ct.types.get(i).getString(values[i])); } else { sb.append(type.getString(key)); } }
public static void appendKeyString(StringBuilder sb, AbstractType<?> type, ByteBuffer key) { if (type instanceof CompositeType) { CompositeType ct = (CompositeType)type; ByteBuffer[] values = ct.split(key); for (int i = 0; i < ct.types.size(); i++) sb.append(i == 0 ? "" : ", ").append(ct.types.get(i).getString(values[i])); } else { sb.append(type.getString(key)); } }
public static void appendKeyString(StringBuilder sb, AbstractType<?> type, ByteBuffer key) { if (type instanceof CompositeType) { CompositeType ct = (CompositeType)type; ByteBuffer[] values = ct.split(key); for (int i = 0; i < ct.types.size(); i++) sb.append(i == 0 ? "" : ", ").append(ct.types.get(i).getString(values[i])); } else { sb.append(type.getString(key)); } }
public static void appendKeyString(StringBuilder sb, AbstractType<?> type, ByteBuffer key) { if (type instanceof CompositeType) { CompositeType ct = (CompositeType)type; ByteBuffer[] values = ct.split(key); for (int i = 0; i < ct.types.size(); i++) sb.append(i == 0 ? "" : ", ").append(ct.types.get(i).getString(values[i])); } else { sb.append(type.getString(key)); } }
private static ByteBuffer[] extractKeyComponents(DecoratedKey partitionKey, AbstractType<?> type) { return type instanceof CompositeType ? ((CompositeType)type).split(partitionKey.getKey()) : new ByteBuffer[]{ partitionKey.getKey() }; }
public ByteBuffer getIndexedValue(ByteBuffer partitionKey, Clustering clustering, CellPath path, ByteBuffer cellValue) { CompositeType keyComparator = (CompositeType)baseCfs.metadata.getKeyValidator(); ByteBuffer[] components = keyComparator.split(partitionKey); return components[indexedColumn.position()]; }
public ByteBuffer getIndexedValue(ByteBuffer partitionKey, Clustering clustering, CellPath path, ByteBuffer cellValue) { CompositeType keyComparator = (CompositeType)baseCfs.metadata.getKeyValidator(); ByteBuffer[] components = keyComparator.split(partitionKey); return components[indexedColumn.position()]; }
private static ByteBuffer[] extractKeyComponents(DecoratedKey partitionKey, AbstractType<?> type) { return type instanceof CompositeType ? ((CompositeType)type).split(partitionKey.getKey()) : new ByteBuffer[]{ partitionKey.getKey() }; }
private static ByteBuffer[] extractKeyComponents(DecoratedKey partitionKey, AbstractType<?> type) { return type instanceof CompositeType ? ((CompositeType)type).split(partitionKey.getKey()) : new ByteBuffer[]{ partitionKey.getKey() }; }
protected ByteBuffer getIndexedValue(ByteBuffer rowKey, Cell cell) { CompositeType keyComparator = (CompositeType)baseCfs.metadata.getKeyValidator(); ByteBuffer[] components = keyComparator.split(rowKey); return components[columnDef.position()]; }
public ByteBuffer getIndexedValue(ByteBuffer partitionKey, Clustering clustering, CellPath path, ByteBuffer cellValue) { CompositeType keyComparator = (CompositeType)baseCfs.metadata.getKeyValidator(); ByteBuffer[] components = keyComparator.split(partitionKey); return components[indexedColumn.position()]; }
public static ByteBuffer[] getComponents(CFMetaData cfm, DecoratedKey dk) { ByteBuffer key = dk.getKey(); if (cfm.getKeyValidator() instanceof CompositeType) { return ((CompositeType)cfm.getKeyValidator()).split(key); } else { return new ByteBuffer[]{ key }; } }
public static ByteBuffer[] getComponents(CFMetaData cfm, DecoratedKey dk) { ByteBuffer key = dk.getKey(); if (cfm.getKeyValidator() instanceof CompositeType) { return ((CompositeType)cfm.getKeyValidator()).split(key); } else { return new ByteBuffer[]{ key }; } }
public static ByteBuffer[] getComponents(CFMetaData cfm, DecoratedKey dk) { ByteBuffer key = dk.getKey(); if (cfm.getKeyValidator() instanceof CompositeType) { return ((CompositeType)cfm.getKeyValidator()).split(key); } else { return new ByteBuffer[]{ key }; } }
/** * Returns true if all of the expressions within this filter that apply to the partition key are satisfied by * the given key, false otherwise. */ public boolean partitionKeyRestrictionsAreSatisfiedBy(DecoratedKey key, AbstractType<?> keyValidator) { for (Expression e : expressions) { if (!e.column.isPartitionKey()) continue; ByteBuffer value = keyValidator instanceof CompositeType ? ((CompositeType) keyValidator).split(key.getKey())[e.column.position()] : key.getKey(); if (!e.operator().isSatisfiedBy(e.column.type, value, e.value)) return false; } return true; }
public boolean isStale(Row data, ByteBuffer indexValue, int nowInSec) { ByteBuffer[] components = ((CompositeType)functions.getIndexedValueType(indexedColumn)).split(indexValue); ByteBuffer mapKey = components[0]; ByteBuffer mapValue = components[1]; ColumnDefinition columnDef = indexedColumn; Cell cell = data.getCell(columnDef, CellPath.create(mapKey)); if (cell == null || !cell.isLive(nowInSec)) return true; AbstractType<?> valueComparator = ((CollectionType)columnDef.type).valueComparator(); return valueComparator.compare(mapValue, cell.value()) != 0; } }
public boolean isStale(Row data, ByteBuffer indexValue, int nowInSec) { ByteBuffer[] components = ((CompositeType)functions.getIndexedValueType(indexedColumn)).split(indexValue); ByteBuffer mapKey = components[0]; ByteBuffer mapValue = components[1]; ColumnDefinition columnDef = indexedColumn; Cell cell = data.getCell(columnDef, CellPath.create(mapKey)); if (cell == null || !cell.isLive(nowInSec)) return true; AbstractType<?> valueComparator = ((CollectionType)columnDef.type).valueComparator(); return valueComparator.compare(mapValue, cell.value()) != 0; } }
public boolean isStale(Row data, ByteBuffer indexValue, int nowInSec) { ByteBuffer[] components = ((CompositeType)functions.getIndexedValueType(indexedColumn)).split(indexValue); ByteBuffer mapKey = components[0]; ByteBuffer mapValue = components[1]; ColumnDefinition columnDef = indexedColumn; Cell cell = data.getCell(columnDef, CellPath.create(mapKey)); if (cell == null || !cell.isLive(nowInSec)) return true; AbstractType<?> valueComparator = ((CollectionType)columnDef.type).valueComparator(); return valueComparator.compare(mapValue, cell.value()) != 0; } }
/** * Returns true if all of the expressions within this filter that apply to the partition key are satisfied by * the given key, false otherwise. */ public boolean partitionKeyRestrictionsAreSatisfiedBy(DecoratedKey key, AbstractType<?> keyValidator) { for (Expression e : expressions) { if (!e.column.isPartitionKey()) continue; ByteBuffer value = keyValidator instanceof CompositeType ? ((CompositeType) keyValidator).split(key.getKey())[e.column.position()] : key.getKey(); if (!e.operator().isSatisfiedBy(e.column.type, value, e.value)) return false; } return true; }
/** * Returns true if all of the expressions within this filter that apply to the partition key are satisfied by * the given key, false otherwise. */ public boolean partitionKeyRestrictionsAreSatisfiedBy(DecoratedKey key, AbstractType<?> keyValidator) { for (Expression e : expressions) { if (!e.column.isPartitionKey()) continue; ByteBuffer value = keyValidator instanceof CompositeType ? ((CompositeType) keyValidator).split(key.getKey())[e.column.position()] : key.getKey(); if (!e.operator().isSatisfiedBy(e.column.type, value, e.value)) return false; } return true; }