public AbstractType<?> getColumnDefinitionNameComparator(ColumnDefinition.Kind kind) { return (isSuper() && kind == ColumnDefinition.Kind.REGULAR) || (isStaticCompactTable() && kind == ColumnDefinition.Kind.STATIC) ? thriftColumnNameType() : UTF8Type.instance; }
public AbstractType<?> getColumnDefinitionNameComparator(ColumnDefinition.Kind kind) { return (isSuper() && kind == ColumnDefinition.Kind.REGULAR) || (isStaticCompactTable() && kind == ColumnDefinition.Kind.STATIC) ? thriftColumnNameType() : UTF8Type.instance; }
public AbstractType<?> getColumnDefinitionNameComparator(ColumnDefinition.Kind kind) { return (isSuper() && kind == ColumnDefinition.Kind.REGULAR) || (isStaticCompactTable() && kind == ColumnDefinition.Kind.STATIC) ? thriftColumnNameType() : UTF8Type.instance; }
public AbstractType<?> getColumnDefinitionNameComparator(ColumnDefinition.Kind kind) { return (isSuper() && kind == ColumnDefinition.Kind.REGULAR) || (isStaticCompactTable() && kind == ColumnDefinition.Kind.STATIC) ? thriftColumnNameType() : UTF8Type.instance; }
private static AbstractType<?> getThriftColumnNameComparator(CFMetaData metadata, ByteBuffer superColumnName) { if (!metadata.isSuper()) return LegacyLayout.makeLegacyComparator(metadata); if (superColumnName == null) { // comparator for super column name return metadata.comparator.subtype(0); } else { // comparator for sub columns return metadata.thriftColumnNameType(); } }
private static AbstractType<?> getThriftColumnNameComparator(CFMetaData metadata, ByteBuffer superColumnName) { if (!metadata.isSuper()) return LegacyLayout.makeLegacyComparator(metadata); if (superColumnName == null) { // comparator for super column name return metadata.comparator.subtype(0); } else { // comparator for sub columns return metadata.thriftColumnNameType(); } }
public ColumnIdentifier getIdentifier(CFMetaData cfm) { if (!cfm.isStaticCompactTable()) return ColumnIdentifier.getInterned(text, true); AbstractType<?> thriftColumnNameType = cfm.thriftColumnNameType(); if (thriftColumnNameType instanceof UTF8Type) return ColumnIdentifier.getInterned(text, true); // We have a Thrift-created table with a non-text comparator. Check if we have a match column, otherwise assume we should use // thriftColumnNameType ByteBuffer bufferName = ByteBufferUtil.bytes(text); for (ColumnDefinition def : cfm.allColumns()) { if (def.name.bytes.equals(bufferName)) return def.name; } return ColumnIdentifier.getInterned(thriftColumnNameType, thriftColumnNameType.fromString(text), text); }
public ColumnIdentifier getIdentifier(CFMetaData cfm) { if (!cfm.isStaticCompactTable()) return ColumnIdentifier.getInterned(text, true); AbstractType<?> thriftColumnNameType = cfm.thriftColumnNameType(); if (thriftColumnNameType instanceof UTF8Type) return ColumnIdentifier.getInterned(text, true); // We have a Thrift-created table with a non-text comparator. Check if we have a match column, otherwise assume we should use // thriftColumnNameType ByteBuffer bufferName = ByteBufferUtil.bytes(text); for (ColumnDefinition def : cfm.allColumns()) { if (def.name.bytes.equals(bufferName)) return def.name; } return ColumnIdentifier.getInterned(thriftColumnNameType, thriftColumnNameType.fromString(text), text); }
public ColumnDefinition prepare(CFMetaData cfm) { if (!cfm.isStaticCompactTable()) return find(cfm); AbstractType<?> thriftColumnNameType = cfm.thriftColumnNameType(); if (thriftColumnNameType instanceof UTF8Type) return find(cfm); // We have a Thrift-created table with a non-text comparator. Check if we have a match column, otherwise assume we should use // thriftColumnNameType ByteBuffer bufferName = ByteBufferUtil.bytes(text); for (ColumnDefinition def : cfm.allColumns()) { if (def.name.bytes.equals(bufferName)) return def; } return find(thriftColumnNameType.fromString(text), cfm); }
public ColumnDefinition prepare(CFMetaData cfm) { if (!cfm.isStaticCompactTable()) return find(cfm); AbstractType<?> thriftColumnNameType = cfm.thriftColumnNameType(); if (thriftColumnNameType instanceof UTF8Type) return find(cfm); // We have a Thrift-created table with a non-text comparator. Check if we have a match column, otherwise assume we should use // thriftColumnNameType ByteBuffer bufferName = ByteBufferUtil.bytes(text); for (ColumnDefinition def : cfm.allColumns()) { if (def.name.bytes.equals(bufferName)) return def; } return find(thriftColumnNameType.fromString(text), cfm); }
public ColumnDefinition prepare(CFMetaData cfm) { if (!cfm.isStaticCompactTable()) return find(cfm); AbstractType<?> thriftColumnNameType = cfm.thriftColumnNameType(); if (thriftColumnNameType instanceof UTF8Type) return find(cfm); // We have a Thrift-created table with a non-text comparator. Check if we have a match column, otherwise assume we should use // thriftColumnNameType ByteBuffer bufferName = ByteBufferUtil.bytes(text); for (ColumnDefinition def : cfm.allColumns()) { if (def.name.bytes.equals(bufferName)) return def; } return find(thriftColumnNameType.fromString(text), cfm); }
public ColumnDefinition prepare(CFMetaData cfm) { if (!cfm.isStaticCompactTable()) return find(cfm); AbstractType<?> thriftColumnNameType = cfm.thriftColumnNameType(); if (thriftColumnNameType instanceof UTF8Type) return find(cfm); // We have a Thrift-created table with a non-text comparator. Check if we have a match column, otherwise assume we should use // thriftColumnNameType ByteBuffer bufferName = ByteBufferUtil.bytes(text); for (ColumnDefinition def : cfm.allColumns()) { if (def.name.bytes.equals(bufferName)) return def; } return find(thriftColumnNameType.fromString(text), cfm); }
public ColumnIdentifier getIdentifier(CFMetaData cfm) { if (!cfm.isStaticCompactTable()) return ColumnIdentifier.getInterned(text, true); AbstractType<?> thriftColumnNameType = cfm.thriftColumnNameType(); if (thriftColumnNameType instanceof UTF8Type) return ColumnIdentifier.getInterned(text, true); // We have a Thrift-created table with a non-text comparator. Check if we have a match column, otherwise assume we should use // thriftColumnNameType ByteBuffer bufferName = ByteBufferUtil.bytes(text); for (ColumnDefinition def : cfm.allColumns()) { if (def.name.bytes.equals(bufferName)) return def.name; } return ColumnIdentifier.getInterned(thriftColumnNameType, thriftColumnNameType.fromString(text), text); }
public ColumnIdentifier getIdentifier(CFMetaData cfm) { if (!cfm.isStaticCompactTable()) return ColumnIdentifier.getInterned(text, true); AbstractType<?> thriftColumnNameType = cfm.thriftColumnNameType(); if (thriftColumnNameType instanceof UTF8Type) return ColumnIdentifier.getInterned(text, true); // We have a Thrift-created table with a non-text comparator. Check if we have a match column, otherwise assume we should use // thriftColumnNameType ByteBuffer bufferName = ByteBufferUtil.bytes(text); for (ColumnDefinition def : cfm.allColumns()) { if (def.name.bytes.equals(bufferName)) return def.name; } return ColumnIdentifier.getInterned(thriftColumnNameType, thriftColumnNameType.fromString(text), text); }
private ColumnFilter makeColumnFilter(CFMetaData metadata, ColumnParent parent, SliceRange range) { if (metadata.isSuper() && parent.isSetSuper_column()) { // We want a slice of the dynamic columns ColumnFilter.Builder builder = ColumnFilter.selectionBuilder(); ColumnDefinition def = metadata.compactValueColumn(); ByteBuffer start = range.reversed ? range.finish : range.start; ByteBuffer finish = range.reversed ? range.start : range.finish; builder.slice(def, start.hasRemaining() ? CellPath.create(start) : CellPath.BOTTOM, finish.hasRemaining() ? CellPath.create(finish) : CellPath.TOP); if (metadata.isDense()) return builder.build(); // We also want to add any staticly defined column if it's within the range AbstractType<?> cmp = metadata.thriftColumnNameType(); for (ColumnDefinition column : metadata.partitionColumns()) { if (SuperColumnCompatibility.isSuperColumnMapColumn(column)) continue; ByteBuffer name = column.name.bytes; if (cmp.compare(name, start) < 0 || cmp.compare(finish, name) > 0) continue; builder.add(column); } return builder.build(); } return makeColumnFilter(metadata, makeSlices(metadata, range)); }
private ColumnFilter makeColumnFilter(CFMetaData metadata, ColumnParent parent, SliceRange range) { if (metadata.isSuper() && parent.isSetSuper_column()) { // We want a slice of the dynamic columns ColumnFilter.Builder builder = ColumnFilter.selectionBuilder(); ColumnDefinition def = metadata.compactValueColumn(); ByteBuffer start = range.reversed ? range.finish : range.start; ByteBuffer finish = range.reversed ? range.start : range.finish; builder.slice(def, start.hasRemaining() ? CellPath.create(start) : CellPath.BOTTOM, finish.hasRemaining() ? CellPath.create(finish) : CellPath.TOP); if (metadata.isDense()) return builder.build(); // We also want to add any staticly defined column if it's within the range AbstractType<?> cmp = metadata.thriftColumnNameType(); for (ColumnDefinition column : metadata.partitionColumns()) { if (SuperColumnCompatibility.isSuperColumnMapColumn(column)) continue; ByteBuffer name = column.name.bytes; if (cmp.compare(name, start) < 0 || cmp.compare(finish, name) > 0) continue; builder.add(column); } return builder.build(); } return makeColumnFilter(metadata, makeSlices(metadata, range)); }
def.setSubcomparator_type(cfm.thriftColumnNameType().toString());
def.setSubcomparator_type(cfm.thriftColumnNameType().toString());