private int compare(Clustering c1, Clustering c2, ColumnFamilyStore cfs) { if (c1 == Clustering.STATIC_CLUSTERING) return c2 == Clustering.STATIC_CLUSTERING ? 0 : -1; if (c2 == Clustering.STATIC_CLUSTERING) return 1; return cfs.getComparator().compare(c1, c2); }
protected AbstractType getExpressionComparator() { return baseCfs.getComparator().asAbstractType(); } }
private int compare(Clustering c1, Clustering c2, ColumnFamilyStore cfs) { if (c1 == Clustering.STATIC_CLUSTERING) return c2 == Clustering.STATIC_CLUSTERING ? 0 : -1; if (c2 == Clustering.STATIC_CLUSTERING) return 1; return cfs.getComparator().compare(c1, c2); }
public SinglePartitionSliceBuilder(ColumnFamilyStore cfs, DecoratedKey key) { super(cfs); this.partitionKey = key; sliceBuilder = new Slices.Builder(cfs.getComparator()); }
public SinglePartitionSliceBuilder(ColumnFamilyStore cfs, DecoratedKey key) { super(cfs); this.partitionKey = key; sliceBuilder = new Slices.Builder(cfs.getComparator()); }
public SinglePartitionSliceBuilder(ColumnFamilyStore cfs, DecoratedKey key) { super(cfs); this.partitionKey = key; sliceBuilder = new Slices.Builder(cfs.getComparator()); }
private int compare(Clustering c1, Clustering c2, ColumnFamilyStore cfs) { if (c1 == Clustering.STATIC_CLUSTERING) return c2 == Clustering.STATIC_CLUSTERING ? 0 : -1; if (c2 == Clustering.STATIC_CLUSTERING) return 1; return cfs.getComparator().compare(c1, c2); }
public TableMapper(ColumnFamilyStore table, boolean isMetaColumn, ColumnDefinition primaryColumnDefinition) { this.table = table; this.cfMetaData = table.metadata; this.clusteringCType = table.getComparator(); this.primaryKeyAbstractType = table.metadata.getKeyValidator(); this.clusteringKeyType = table.getComparator().asAbstractType(); this.primaryKeyType = CompositeType.getInstance(primaryKeyAbstractType, clusteringKeyType); this.defaultPartitionKey = defaultPartitionKey(); this.isMetaColumn = isMetaColumn; this.primaryColumnDefinition = primaryColumnDefinition; }
protected Cell getMetaColumn(Cell firstColumn, Float score) { CellNameType cellNameType = table.getComparator(); ColumnDefinition columnDefinition = resultMapper.tableMapper.primaryColumnDefinition; CellName cellName = cellNameType.create(firstColumn.name(), columnDefinition); return new BufferCell(cellName, UTF8Type.instance.decompose("{\"score\":" + score.toString() + "}")); }
public static boolean isIndexBuilt(String keyspaceName, String indexName) { ColumnFamilyStore cfs = Keyspace.open(Keyspace.SYSTEM_KS).getColumnFamilyStore(INDEX_CF); QueryFilter filter = QueryFilter.getNamesFilter(decorate(ByteBufferUtil.bytes(keyspaceName)), INDEX_CF, FBUtilities.singleton(cfs.getComparator().makeCellName(indexName), cfs.getComparator()), System.currentTimeMillis()); return ColumnFamilyStore.removeDeleted(cfs.getColumnFamily(filter), Integer.MAX_VALUE) != null; }
private static void addColumn(ColumnFamilyStore table, ColumnFamily cleanColumnFamily, ColumnDefinition columnDefinition, Composite prefix, ByteBuffer metaColumnValue) { if (!columnDefinition.type.asCQL3Type().isCollection()) { CellNameType cellNameType = table.getComparator(); CellName cellName = cellNameType.create(prefix, columnDefinition); Cell scoreColumn = new BufferCell(cellName, metaColumnValue); cleanColumnFamily.addColumn(scoreColumn); } }
private SSTableWriter createCompactionWriter(long repairedAt) { MetadataCollector sstableMetadataCollector = new MetadataCollector(cfs.getComparator()); sstableMetadataCollector.sstableLevel(sstable.getSSTableLevel()); return SSTableWriter.create(Descriptor.fromFilename(cfs.getSSTablePath(directory)), estimatedRows, repairedAt, cfs.metadata, sstableMetadataCollector, SerializationHeader.make(cfs.metadata, Sets.newHashSet(sstable)), cfs.indexManager.listIndexes(), transaction); }
private SSTableWriter createCompactionWriter(long repairedAt) { MetadataCollector sstableMetadataCollector = new MetadataCollector(cfs.getComparator()); sstableMetadataCollector.sstableLevel(sstable.getSSTableLevel()); return SSTableWriter.create(Descriptor.fromFilename(cfs.getSSTablePath(directory)), estimatedRows, repairedAt, cfs.metadata, sstableMetadataCollector, SerializationHeader.make(cfs.metadata, Sets.newHashSet(sstable)), cfs.indexManager.listIndexes(), transaction); }
public IndexEntry decodeEntry(DecoratedKey indexedValue, Row indexEntry) { int ckCount = baseCfs.metadata.clusteringColumns().size(); Clustering clustering = indexEntry.clustering(); CBuilder builder = CBuilder.create(baseCfs.getComparator()); for (int i = 0; i < ckCount; i++) builder.add(clustering.get(i + 1)); return new IndexEntry(indexedValue, clustering, indexEntry.primaryKeyLivenessInfo().timestamp(), clustering.get(0), builder.build()); }
public IndexEntry decodeEntry(DecoratedKey indexedValue, Row indexEntry) { int ckCount = baseCfs.metadata.clusteringColumns().size(); Clustering clustering = indexEntry.clustering(); CBuilder builder = CBuilder.create(baseCfs.getComparator()); for (int i = 0; i < ckCount; i++) builder.add(clustering.get(i + 1)); return new IndexEntry(indexedValue, clustering, indexEntry.primaryKeyLivenessInfo().timestamp(), clustering.get(0), builder.build()); }
public IndexedEntry decodeEntry(DecoratedKey indexedValue, Cell indexEntry) { int ckCount = baseCfs.metadata.clusteringColumns().size(); CBuilder builder = baseCfs.getComparator().builder(); for (int i = 0; i < ckCount; i++) builder.add(indexEntry.name().get(i + 1)); return new IndexedEntry(indexedValue, indexEntry.name(), indexEntry.timestamp(), indexEntry.name().get(0), builder.build()); }
public IndexedEntry decodeEntry(DecoratedKey indexedValue, Cell indexEntry) { int count = 1 + baseCfs.metadata.clusteringColumns().size(); CBuilder builder = baseCfs.getComparator().builder(); for (int i = 0; i < count - 1; i++) builder.add(indexEntry.name().get(i + 1)); return new IndexedEntry(indexedValue, indexEntry.name(), indexEntry.timestamp(), indexEntry.name().get(0), builder.build()); }
private SSTableWriter createCompactionWriter(long repairedAt) { MetadataCollector sstableMetadataCollector = new MetadataCollector(cfs.getComparator()); sstableMetadataCollector.sstableLevel(sstable.getSSTableLevel()); return SSTableWriter.create(Descriptor.fromFilename(cfs.getSSTablePath(directory)), estimatedRows, repairedAt, cfs.metadata, sstableMetadataCollector, SerializationHeader.make(cfs.metadata, Sets.newHashSet(sstable)), cfs.indexManager.listIndexes(), transaction); }
public IndexedEntry decodeEntry(DecoratedKey indexedValue, Cell indexEntry) { int prefixSize = columnDef.position(); CellName name = indexEntry.name(); CBuilder builder = baseCfs.getComparator().builder(); for (int i = 0; i < prefixSize; i++) builder.add(name.get(i + 1)); return new IndexedEntry(indexedValue, name, indexEntry.timestamp(), name.get(0), builder.build(), name.get(prefixSize + 1)); }
public IndexedEntry decodeEntry(DecoratedKey indexedValue, Cell indexEntry) { CBuilder builder = baseCfs.getComparator().builder(); for (int i = 0; i < columnDef.position(); i++) builder.add(indexEntry.name().get(i + 1)); return new IndexedEntry(indexedValue, indexEntry.name(), indexEntry.timestamp(), indexEntry.name().get(0), builder.build()); }