public ColumnFamily getColumnFamily(DecoratedKey key, Composite start, Composite finish, boolean reversed, int limit, long timestamp) { return getColumnFamily(QueryFilter.getSliceFilter(key, name, start, finish, reversed, limit, timestamp)); }
private static Row serializedColumnFamilies(DecoratedKey ksNameKey) { ColumnFamilyStore cfsStore = SystemKeyspace.schemaCFS(SystemKeyspace.SCHEMA_COLUMNFAMILIES_CF); return new Row(ksNameKey, cfsStore.getColumnFamily(QueryFilter.getIdentityFilter(ksNameKey, SystemKeyspace.SCHEMA_COLUMNFAMILIES_CF, System.currentTimeMillis()))); }
private static Row serializedUserTypes(DecoratedKey ksNameKey) { ColumnFamilyStore cfsStore = SystemKeyspace.schemaCFS(SystemKeyspace.SCHEMA_USER_TYPES_CF); return new Row(ksNameKey, cfsStore.getColumnFamily(QueryFilter.getIdentityFilter(ksNameKey, SystemKeyspace.SCHEMA_USER_TYPES_CF, System.currentTimeMillis()))); }
private Map<CellName, ColumnFamily> getCellNameColumnFamilyMap(DecoratedKey dk, ColumnSlice[] columnSlices) { SliceQueryFilter sliceQueryFilter = new SliceQueryFilter(columnSlices, false, Integer.MAX_VALUE); QueryFilter queryFilter = new QueryFilter(dk, tableMapper.table.name, sliceQueryFilter, filter.timestamp); ColumnFamily columnFamily = tableMapper.table.getColumnFamily(queryFilter); return tableMapper.getRows(columnFamily); }
public Row getRow(QueryFilter filter) { ColumnFamilyStore cfStore = getColumnFamilyStore(filter.getColumnFamilyName()); ColumnFamily columnFamily = cfStore.getColumnFamily(filter); return new Row(filter.key, columnFamily); }
/** * Fetches a subset of schema (table data, columns metadata or triggers) for the keyspace. * * @param schemaCfName the schema table to get the data from (schema_keyspaces, schema_columnfamilies, schema_columns or schema_triggers) * @param ksName the keyspace of the tables we are interested in * @return a Row containing the schema data of a particular type for the keyspace */ public static Row readSchemaRow(String schemaCfName, String ksName) { DecoratedKey key = StorageService.getPartitioner().decorateKey(getSchemaKSKey(ksName)); ColumnFamilyStore schemaCFS = SystemKeyspace.schemaCFS(schemaCfName); ColumnFamily result = schemaCFS.getColumnFamily(QueryFilter.getIdentityFilter(key, schemaCfName, System.currentTimeMillis())); return new Row(key, result); }
private void loadOldRow(DecoratedKey dk, ByteBuffer pkBuf, List<Field> fields) { CellName clusteringKey = tableMapper.makeClusteringKey(pkBuf); Composite start = tableMapper.start(clusteringKey); Composite end = tableMapper.end(start); ColumnSlice columnSlice = new ColumnSlice(start, end); SliceQueryFilter sliceQueryFilter = new SliceQueryFilter(columnSlice, false, Integer.MAX_VALUE); QueryFilter queryFilter = new QueryFilter(dk, tableMapper.table.name, sliceQueryFilter, new Date().getTime()); ColumnFamily columnFamily = tableMapper.table.getColumnFamily(queryFilter); Map<CellName, ColumnFamily> fullSlice = tableMapper.getRows(columnFamily); ColumnFamily oldDocument = fullSlice.get(clusteringKey); for (Cell cell : oldDocument) { CellName cellName = cell.name(); ColumnIdentifier cql3ColName = cellName.cql3ColumnName(tableMapper.cfMetaData); String actualColName = cql3ColName.toString(); ColumnDefinition columnDefinition = tableMapper.cfMetaData.getColumnDefinition(cql3ColName); if (options.shouldIndex(actualColName)) { addFields(cell, actualColName, columnDefinition, fields); } } }
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; }
/** * Fetches a subset of schema (table data, columns metadata or triggers) for the keyspace+table pair. * * @param schemaCfName the schema table to get the data from (schema_columnfamilies, schema_columns or schema_triggers) * @param ksName the keyspace of the table we are interested in * @param cfName the table we are interested in * @return a Row containing the schema data of a particular type for the table */ public static Row readSchemaRow(String schemaCfName, String ksName, String cfName) { DecoratedKey key = StorageService.getPartitioner().decorateKey(getSchemaKSKey(ksName)); ColumnFamilyStore schemaCFS = SystemKeyspace.schemaCFS(schemaCfName); Composite prefix = schemaCFS.getComparator().make(cfName); ColumnFamily cf = schemaCFS.getColumnFamily(key, prefix, prefix.end(), false, Integer.MAX_VALUE, System.currentTimeMillis()); return new Row(key, cf); }
rowsPerQuery, filter.timestamp); ColumnFamily indexRow = index.getIndexCfs().getColumnFamily(indexFilter); logger.trace("fetched {}", indexRow); if (indexRow == null) ColumnFamily data = baseCfs.getColumnFamily(new QueryFilter(dk, baseCfs.name, filter.columnFilter(lastSeenKey.toByteBuffer()), filter.timestamp)); if (extraFilter != null) ColumnFamily cf = baseCfs.getColumnFamily(new QueryFilter(dk, baseCfs.name, extraFilter, filter.timestamp)); if (cf != null) data.addAll(cf);
indexCellsPerQuery, filter.timestamp); ColumnFamily indexRow = index.getIndexCfs().getColumnFamily(indexFilter); if (indexRow == null || !indexRow.hasColumns()) return makeReturn(currentKey, data); : new ColumnSlice[]{ dataSlice }; SliceQueryFilter dataFilter = new SliceQueryFilter(slices, false, Integer.MAX_VALUE, baseCfs.metadata.clusteringColumns().size()); ColumnFamily newData = baseCfs.getColumnFamily(new QueryFilter(dk, baseCfs.name, dataFilter, filter.timestamp)); if (newData == null || index.isStale(entry, newData, filter.timestamp))
if (extraFilter != null) ColumnFamily cf = filter.cfs.getColumnFamily(new QueryFilter(rawRow.key, name, extraFilter, filter.timestamp)); if (cf != null) data.addAll(cf);
now); ColumnFamily hintsPage = ColumnFamilyStore.removeDeleted(hintStore.getColumnFamily(filter), (int) (now / 1000));