public static AbstractType getValueValidator(AbstractType abstractType) { if (abstractType instanceof CollectionType) { if (abstractType instanceof MapType) { MapType mapType = (MapType) abstractType; return mapType.valueComparator(); } else if (abstractType instanceof SetType) { SetType setType = (SetType) abstractType; return setType.nameComparator(); } else if (abstractType instanceof ListType) { ListType listType = (ListType) abstractType; return listType.valueComparator(); } } return abstractType; }
@Override public String toString() { MapType<?, ?> mt = (MapType<?, ?>)column.type; return String.format("%s[%s] = %s", column.name, mt.nameComparator().getString(key), mt.valueComparator().getString(value)); }
@Override public String toString() { MapType<?, ?> mt = (MapType<?, ?>)column.type; return String.format("%s[%s] = %s", column.name, mt.nameComparator().getString(key), mt.valueComparator().getString(value)); }
@Override public String toString() { MapType<?, ?> mt = (MapType<?, ?>)column.type; return String.format("%s[%s] = %s", column.name, mt.nameComparator().getString(key), mt.valueComparator().getString(value)); }
public AbstractType<?> makeLegacyDefaultValidator() { if (isCounter()) return CounterColumnType.instance; else if (isCompactTable()) return isSuper() ? ((MapType)compactValueColumn().type).valueComparator() : compactValueColumn().type; else return BytesType.instance; }
public AbstractType<?> makeLegacyDefaultValidator() { if (isCounter()) return CounterColumnType.instance; else if (isCompactTable()) return isSuper() ? ((MapType)compactValueColumn().type).valueComparator() : compactValueColumn().type; else return BytesType.instance; }
public AbstractType<?> makeLegacyDefaultValidator() { if (isCounter()) return CounterColumnType.instance; else if (isCompactTable()) return isSuper() ? ((MapType)compactValueColumn().type).valueComparator() : compactValueColumn().type; else return BytesType.instance; }
public boolean isSatisfiedBy(CFMetaData metadata, DecoratedKey partitionKey, Row row) { assert key != null; // We support null conditions for LWT (in ColumnCondition) but not for RowFilter. // TODO: we should try to merge both code someday. assert value != null; if (row.isStatic() != column.isStatic()) return true; MapType<?, ?> mt = (MapType<?, ?>)column.type; if (column.isComplex()) { Cell cell = row.getCell(column, CellPath.create(key)); return cell != null && mt.valueComparator().compare(cell.value(), value) == 0; } else { ByteBuffer serializedMap = getValue(metadata, partitionKey, row); if (serializedMap == null) return false; ByteBuffer foundValue = mt.getSerializer().getSerializedValue(serializedMap, key, mt.getKeysType()); return foundValue != null && mt.valueComparator().compare(foundValue, value) == 0; } }
public boolean isSatisfiedBy(CFMetaData metadata, DecoratedKey partitionKey, Row row) { assert key != null; // We support null conditions for LWT (in ColumnCondition) but not for RowFilter. // TODO: we should try to merge both code someday. assert value != null; if (row.isStatic() != column.isStatic()) return true; MapType<?, ?> mt = (MapType<?, ?>)column.type; if (column.isComplex()) { Cell cell = row.getCell(column, CellPath.create(key)); return cell != null && mt.valueComparator().compare(cell.value(), value) == 0; } else { ByteBuffer serializedMap = getValue(metadata, partitionKey, row); if (serializedMap == null) return false; ByteBuffer foundValue = mt.getSerializer().getSerializedValue(serializedMap, key, mt.getKeysType()); return foundValue != null && mt.valueComparator().compare(foundValue, value) == 0; } }
public boolean isSatisfiedBy(CFMetaData metadata, DecoratedKey partitionKey, Row row) { assert key != null; // We support null conditions for LWT (in ColumnCondition) but not for RowFilter. // TODO: we should try to merge both code someday. assert value != null; if (row.isStatic() != column.isStatic()) return true; MapType<?, ?> mt = (MapType<?, ?>)column.type; if (column.isComplex()) { Cell cell = row.getCell(column, CellPath.create(key)); return cell != null && mt.valueComparator().compare(cell.value(), value) == 0; } else { ByteBuffer serializedMap = getValue(metadata, partitionKey, row); if (serializedMap == null) return false; ByteBuffer foundValue = mt.getSerializer().getSerializedValue(serializedMap, key, mt.getKeysType()); return foundValue != null && mt.valueComparator().compare(foundValue, value) == 0; } }