Package org.apache.cassandra.db.composites

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


            return true;

        if (start().isEmpty() || finish().isEmpty() || !cf.hasColumns())
            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
View Full Code Here


    {
        Mutation mutation = new Mutation(Keyspace.SYSTEM_KS, SystemKeyspace.getSchemaKSKey(ksName));
        ColumnFamily cf = mutation.addOrGet(SchemaColumnFamiliesCf);
        int ldt = (int) (System.currentTimeMillis() / 1000);

        Composite prefix = SchemaColumnFamiliesCf.comparator.make(cfName);
        cf.addAtom(new RangeTombstone(prefix, prefix.end(), timestamp, ldt));

        for (ColumnDefinition cd : allColumns())
            cd.deleteFromSchema(mutation, timestamp);

        for (TriggerDefinition td : triggers.values())
View Full Code Here

    private void toSchemaNoColumnsNoTriggers(Mutation mutation, long timestamp)
    {
        // For property that can be null (and can be changed), we insert tombstones, to make sure
        // we don't keep a property the user has removed
        ColumnFamily cf = mutation.addOrGet(SchemaColumnFamiliesCf);
        Composite prefix = SchemaColumnFamiliesCf.comparator.make(cfName);
        CFRowAdder adder = new CFRowAdder(cf, prefix, timestamp);

        adder.add("cf_id", cfId);
        adder.add("type", cfType.toString());
View Full Code Here

            RangeTombstoneList tombstones = new RangeTombstoneList(type, size);

            for (int i = 0; i < size; i++)
            {
                Composite start = type.serializer().deserialize(in);
                Composite end = type.serializer().deserialize(in);
                int delTime =  in.readInt();
                long markedAt = in.readLong();

                if (version >= MessagingService.VERSION_20)
                {
View Full Code Here

        ByteBuffer key = keys.get(0);

        long now = options.getTimestamp(queryState);
        CQL3CasConditions conditions = new CQL3CasConditions(cfm, now);
        Composite prefix = createClusteringPrefix(options);
        ColumnFamily updates = ArrayBackedSortedColumns.factory.create(cfm);
        addUpdatesAndConditions(key, prefix, updates, conditions, options, getTimestamp(now, options));

        ColumnFamily result = StorageProxy.cas(keyspace(),
                                               columnFamily(),
View Full Code Here

     */
    private Collection<? extends IMutation> getMutations(QueryOptions options, boolean local, long now)
    throws RequestExecutionException, RequestValidationException
    {
        List<ByteBuffer> keys = buildPartitionKeyNames(options);
        Composite clusteringPrefix = createClusteringPrefix(options);

        UpdateParameters params = makeUpdateParameters(keys, clusteringPrefix, options, local, now);

        Collection<IMutation> mutations = new ArrayList<IMutation>(keys.size());
        for (ByteBuffer key: keys)
View Full Code Here

        }
        // ...a range (slice) of column names
        else
        {
            AbstractType<?> at = metadata.comparator.asAbstractType();
            Composite start = metadata.comparator.fromByteBuffer(select.getColumnStart().getByteBuffer(at,variables));
            Composite finish = metadata.comparator.fromByteBuffer(select.getColumnFinish().getByteBuffer(at,variables));

            for (Term rawKey : select.getKeys())
            {
                ByteBuffer key = rawKey.getByteBuffer(metadata.getKeyValidator(),variables);
View Full Code Here

    {
        Mutation mutation = new Mutation(Keyspace.SYSTEM_KS, SystemKeyspace.getSchemaKSKey(ksName));
        ColumnFamily cf = mutation.addOrGet(SchemaColumnFamiliesCf);
        int ldt = (int) (System.currentTimeMillis() / 1000);

        Composite prefix = SchemaColumnFamiliesCf.comparator.make(cfName);
        cf.addAtom(new RangeTombstone(prefix, prefix.end(), timestamp, ldt));

        for (ColumnDefinition cd : allColumns())
            cd.deleteFromSchema(mutation, timestamp);

        for (TriggerDefinition td : triggers.values())
View Full Code Here

    private void toSchemaNoColumnsNoTriggers(Mutation mutation, long timestamp)
    {
        // For property that can be null (and can be changed), we insert tombstones, to make sure
        // we don't keep a property the user has removed
        ColumnFamily cf = mutation.addOrGet(SchemaColumnFamiliesCf);
        Composite prefix = SchemaColumnFamiliesCf.comparator.make(cfName);
        CFRowAdder adder = new CFRowAdder(cf, prefix, timestamp);

        adder.add("cf_id", cfId);
        adder.add("type", cfType.toString());
View Full Code Here

        logger.info("Started hinted handoff for host: {} with IP: {}", hostId, endpoint);
        final ByteBuffer hostIdBytes = ByteBuffer.wrap(UUIDGen.decompose(hostId));
        DecoratedKey epkey =  StorageService.getPartitioner().decorateKey(hostIdBytes);

        final AtomicInteger rowsReplayed = new AtomicInteger(0);
        Composite startColumn = Composites.EMPTY;

        int pageSize = calculatePageSize();
        logger.debug("Using pageSize of {}", pageSize);

        // rate limit is in bytes per second. Uses Double.MAX_VALUE if disabled (set to 0 in cassandra.yaml).
View Full Code Here

TOP

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

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.