Package org.apache.cassandra.db.composites

Examples of org.apache.cassandra.db.composites.Composite.end()


        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


        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);
    }
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

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

    public CFRowAdder resetCollection(String cql3ColumnName)
    {
        ColumnDefinition def = getDefinition(cql3ColumnName);
        assert def.type.isCollection() && def.type.isMultiCell();
        Composite name = cf.getComparator().create(prefix, def);
        cf.addAtom(new RangeTombstone(name.start(), name.end(), timestamp - 1, ldt));
        return this;
    }

    public CFRowAdder addMapEntry(String cql3ColumnName, Object key, Object value)
    {
View Full Code Here

        Mutation mutation = makeSchemaMutation(name);
        ColumnFamily cf = mutation.addOrGet(SystemKeyspace.SCHEMA_FUNCTIONS_TABLE);

        Composite prefix = SystemKeyspace.SchemaFunctionsTable.comparator.make(name.name, computeSignature(argTypes));
        int ldt = (int) (System.currentTimeMillis() / 1000);
        cf.addAtom(new RangeTombstone(prefix, prefix.end(), timestamp, ldt));

        return mutation;
    }

    public Mutation toSchemaUpdate(long timestamp)
View Full Code Here

    {
        ColumnFamily cf = mutation.addOrGet(SystemKeyspace.SCHEMA_TRIGGERS_TABLE);
        int ldt = (int) (System.currentTimeMillis() / 1000);

        Composite prefix = SystemKeyspace.SchemaTriggersTable.comparator.make(cfName, name);
        cf.addAtom(new RangeTombstone(prefix, prefix.end(), timestamp, ldt));
    }

    @Override
    public boolean equals(Object o)
    {
View Full Code Here

        Mutation mutation = new Mutation(SystemKeyspace.NAME, SystemKeyspace.getSchemaKSKey(droppedType.keyspace));
        ColumnFamily cf = mutation.addOrGet(SystemKeyspace.SCHEMA_USER_TYPES_TABLE);
        int ldt = (int) (System.currentTimeMillis() / 1000);

        Composite prefix = SystemKeyspace.SchemaUserTypesTable.comparator.make(droppedType.name);
        cf.addAtom(new RangeTombstone(prefix, prefix.end(), timestamp, ldt));

        return mutation;
    }

    public UserType getType(ByteBuffer typeName)
View Full Code Here

        ColumnFamily cf = mutation.addOrGet(SystemKeyspace.SchemaColumnsTable);
        int ldt = (int) (System.currentTimeMillis() / 1000);

        // Note: we do want to use name.toString(), not name.bytes directly for backward compatibility (For CQL3, this won't make a difference).
        Composite prefix = SystemKeyspace.SchemaColumnsTable.comparator.make(cfName, name.toString());
        cf.addAtom(new RangeTombstone(prefix, prefix.end(), timestamp, ldt));
    }

    public void toSchema(Mutation mutation, long timestamp)
    {
        ColumnFamily cf = mutation.addOrGet(SystemKeyspace.SchemaColumnsTable);
View Full Code Here

    public CFRowAdder resetCollection(String cql3ColumnName)
    {
        ColumnDefinition def = getDefinition(cql3ColumnName);
        assert def.type.isCollection();
        Composite name = cf.getComparator().create(prefix, def);
        cf.addAtom(new RangeTombstone(name.start(), name.end(), timestamp - 1, ldt));
        return this;
    }

    public CFRowAdder addMapEntry(String cql3ColumnName, Object key, Object value)
    {
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.