Examples of CellName


Examples of org.apache.cassandra.db.composites.CellName

    public void insert(ByteBuffer rowKey, Cell cell, OpOrder.Group opGroup)
    {
        DecoratedKey valueKey = getIndexKeyFor(getIndexedValue(rowKey, cell));
        ColumnFamily cfi = ArrayBackedSortedColumns.factory.create(indexCfs.metadata);
        CellName name = makeIndexColumnName(rowKey, cell);
        if (cell instanceof ExpiringCell)
        {
            ExpiringCell ec = (ExpiringCell) cell;
            cfi.addColumn(new ExpiringCell(name, ByteBufferUtil.EMPTY_BYTE_BUFFER, ec.timestamp(), ec.getTimeToLive(), ec.getLocalDeletionTime()));
        }
View Full Code Here

Examples of org.apache.cassandra.db.composites.CellName

        }

        public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException
        {
            // delete + append
            CellName name = cf.getComparator().create(prefix, column.name);
            cf.addAtom(params.makeTombstoneForOverwrite(name.slice()));
            Appender.doAppend(t, cf, prefix, column.name, params);
        }
View Full Code Here

Examples of org.apache.cassandra.db.composites.CellName

            List<Cell> existingList = params.getPrefetchedList(rowKey, column.name);
            int idx = ByteBufferUtil.toInt(index);
            if (idx < 0 || idx >= existingList.size())
                throw new InvalidRequestException(String.format("List index %d out of bound, list has size %d", idx, existingList.size()));

            CellName elementName = existingList.get(idx).name();
            if (value == null)
            {
                cf.addColumn(params.makeTombstone(elementName));
            }
            else
View Full Code Here

Examples of org.apache.cassandra.db.composites.CellName

        final AbstractBounds<RowPosition> range = filter.dataRange.keyRange();
        CellNameType type = index.getIndexCfs().getComparator();
        final Composite startKey = range.left instanceof DecoratedKey ? type.make(((DecoratedKey)range.left).key) : Composites.EMPTY;
        final Composite endKey = range.right instanceof DecoratedKey ? type.make(((DecoratedKey)range.right).key) : Composites.EMPTY;

        final CellName primaryColumn = baseCfs.getComparator().cellFromByteBuffer(primary.column);

        return new ColumnFamilyStore.AbstractScanIterator()
        {
            private Composite lastSeenKey = startKey;
            private Iterator<Cell> indexColumns;
View Full Code Here

Examples of org.apache.cassandra.db.composites.CellName

            List<Cell> existingList = params.getPrefetchedList(rowKey, column.name);
            int idx = ByteBufferUtil.toInt(((Constants.Value)index).bytes);
            if (idx < 0 || idx >= existingList.size())
                throw new InvalidRequestException(String.format("List index %d out of bound, list has size %d", idx, existingList.size()));

            CellName elementName = existingList.get(idx).name();
            cf.addColumn(params.makeTombstone(elementName));
        }
View Full Code Here

Examples of org.apache.cassandra.db.composites.CellName

            // Note: for counters we must be careful to not add a column that was already there (to avoid overcount). That is
            // why we do the dance of avoiding to query any column we already have (it's also more efficient anyway)
            SortedSet<CellName> columns = new TreeSet<CellName>(cfs.getComparator());
            for (IndexExpression expr : clause)
            {
                CellName name = data.getComparator().cellFromByteBuffer(expr.column);
                if (data.getColumn(name) == null)
                    columns.add(name);
            }
            assert !columns.isEmpty();
            return new NamesQueryFilter(columns);
View Full Code Here

Examples of org.apache.cassandra.db.composites.CellName

                         ? rowKey
                         : ((CompositeType)data.metadata().getKeyValidator()).split(rowKey)[def.position()];
                case CLUSTERING_COLUMN:
                    return prefix.get(def.position());
                case REGULAR:
                    CellName cname = prefix == null
                                   ? data.getComparator().cellFromByteBuffer(def.name.bytes)
                                   : data.getComparator().create(prefix, def.name);

                    Cell cell = data.getColumn(cname);
                    return cell == null ? null : cell.value();
View Full Code Here

Examples of org.apache.cassandra.db.composites.CellName

    }

    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));
    }
View Full Code Here

Examples of org.apache.cassandra.db.composites.CellName

            && comp.compare(name.get(columnDef.position()), columnDef.name.bytes) == 0;
    }

    public boolean isStale(IndexedEntry entry, ColumnFamily data, long now)
    {
        CellName name = data.getComparator().create(entry.indexedEntryPrefix, columnDef.name, entry.indexedEntryCollectionKey);
        Cell liveCell = data.getColumn(name);
        if (liveCell == null || liveCell.isMarkedForDelete(now))
            return true;

        ByteBuffer liveValue = liveCell.value();
View Full Code Here

Examples of org.apache.cassandra.db.composites.CellName

        // (don't need to worry about cfNew containing Columns that are shadowed by
        // the delete tombstone, since cfNew was generated by CF.resolve, which
        // takes care of those for us.)
        for (Cell cellExternal : cfComposite)
        {
            CellName cName = cellExternal.name();
            Cell cellInternal = getColumn(cName);
            if (cellInternal == null)
            {
                cfDiff.addColumn(cellExternal);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.