Package org.apache.cassandra.db.composites

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


    {
        private int idx;

        public boolean isDeleted(Cell cell)
        {
            CellName name = cell.name();
            long timestamp = cell.timestamp();

            while (idx < size)
            {
                int cmp = comparator.compare(name, starts[idx]);
View Full Code Here


        // (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

            return false;

        Composite low = isReversed() ? finish() : start();
        Composite high = isReversed() ? start() : finish();

        CellName first = cf.iterator(ColumnSlice.ALL_COLUMNS_ARRAY).next().name();
        CellName last = cf.reverseIterator(ColumnSlice.ALL_COLUMNS_ARRAY).next().name();

        return cf.getComparator().compare(first, low) <= 0
            && cf.getComparator().compare(high, last) <= 0;
    }
View Full Code Here

        }

        public Future<Pair<CounterCacheKey, ClockAndCount>> deserialize(DataInputStream in, final ColumnFamilyStore cfs) throws IOException
        {
            final ByteBuffer partitionKey = ByteBufferUtil.readWithLength(in);
            final CellName cellName = cfs.metadata.comparator.cellFromByteBuffer(ByteBufferUtil.readWithLength(in));
            return StageManager.getStage(Stage.READ).submit(new Callable<Pair<CounterCacheKey, ClockAndCount>>()
            {
                public Pair<CounterCacheKey, ClockAndCount> call() throws Exception
                {
                    DecoratedKey key = cfs.partitioner.decorateKey(partitionKey);
View Full Code Here

            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

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

    }

    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

            && 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, entry.indexedEntryCollectionKey);
        Cell cell = data.getColumn(name);
        return cell == null || !cell.isLive(now) || ((CollectionType) columnDef.type).valueComparator().compare(entry.indexValue.getKey(), cell.value()) != 0;
    }
View Full Code Here

        // (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

            // 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

TOP

Related Classes of org.apache.cassandra.db.composites.CellName

Copyright © 2018 www.massapicom. 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.