Package org.apache.cassandra.cql3

Examples of org.apache.cassandra.cql3.CFDefinition


    {
        KsDef ksDef = client.describe_keyspace(ks);
        for (CfDef cfDef : ksDef.cf_defs)
        {
            if (cfDef.name.equalsIgnoreCase(cf))
                return new CFDefinition(CFMetaData.fromThrift(cfDef));
        }
        return null;
    }
View Full Code Here


                keys.add(cDef);
            }
            // classic thrift tables
            if (keys.size() == 0)
            {
                CFDefinition cfDefinition = getCfDefinition(keyspace, column_family, client);
                for (ColumnIdentifier column : cfDefinition.keys.keySet())
                {
                    String key = column.toString();
                    logger.debug("name: {} ", key);
                    ColumnDef cDef = new ColumnDef();
View Full Code Here

        }
    }

    public static ColumnSpecification keySpecOf(ColumnSpecification column, MapType type)
    {
        return new ColumnSpecification(column.ksName, column.cfName, new ColumnIdentifier("key(" + column.name + ")", true), type.keys);
    }
View Full Code Here

        return new ColumnSpecification(column.ksName, column.cfName, new ColumnIdentifier("key(" + column.name + ")", true), type.keys);
    }

    public static ColumnSpecification valueSpecOf(ColumnSpecification column, MapType type)
    {
        return new ColumnSpecification(column.ksName, column.cfName, new ColumnIdentifier("value(" + column.name + ")", true), type.values);
    }
View Full Code Here

        {
            Set<?> s = validator.compose(params.variables.get(values.bindIndex));
            Iterator<?> iter = s.iterator();
            while (iter.hasNext())
            {
                ColumnNameBuilder b = iter.hasNext() ? builder.copy() : builder;
                ByteBuffer name = b.add(validator.nameComparator().decompose(iter.next())).build();
                cf.addColumn(params.makeColumn(name, ByteBufferUtil.EMPTY_BYTE_BUFFER));
            }
        }
        catch (MarshalException e)
        {
View Full Code Here

        {
            Set<?> s = validator.compose(params.variables.get(values.bindIndex));
            Iterator<?> iter = s.iterator();
            while (iter.hasNext())
            {
                ColumnNameBuilder b = iter.hasNext() ? builder.copy() : builder;
                ByteBuffer name = b.add(validator.nameComparator().decompose(iter.next())).build();
                cf.addColumn(params.makeTombstone(name));
            }
        }
        catch (MarshalException e)
        {
View Full Code Here

        }
    }

    public static ColumnSpecification keySpecOf(ColumnSpecification column, MapType type)
    {
        return new ColumnSpecification(column.ksName, column.cfName, new ColumnIdentifier("key(" + column.name + ")", true), type.keys);
    }
View Full Code Here

        return new ColumnSpecification(column.ksName, column.cfName, new ColumnIdentifier("key(" + column.name + ")", true), type.keys);
    }

    public static ColumnSpecification valueSpecOf(ColumnSpecification column, MapType type)
    {
        return new ColumnSpecification(column.ksName, column.cfName, new ColumnIdentifier("value(" + column.name + ")", true), type.values);
    }
View Full Code Here

            throw new InvalidRequestException(String.format("Invalid operation, %s is not of map type", column.name));

        MapType mt = (MapType)column.type;
        for (Map.Entry<Term, Term> entry : values.entrySet())
        {
            Term key = entry.getKey();
            Term value = entry.getValue();
            if (key.isBindMarker())
                boundNames[key.bindIndex] = keySpecOf(column, mt);
            if (value.isBindMarker())
                boundNames[value.bindIndex] = valueSpecOf(column, mt);
        }
    }
View Full Code Here

    }

    public static Map<UUID, ReplayPosition> getTruncationPositions()
    {
        String req = "SELECT truncated_at FROM system.%s WHERE key = '%s'";
        UntypedResultSet rows = processInternal(String.format(req, LOCAL_CF, LOCAL_KEY));
        if (rows.isEmpty())
            return Collections.emptyMap();

        UntypedResultSet.Row row = rows.one();
        Map<UUID, ByteBuffer> rawMap = row.getMap("truncated_at", UUIDType.instance, BytesType.instance);
        if (rawMap == null)
            return Collections.emptyMap();

        Map<UUID, ReplayPosition> positions = new HashMap<UUID, ReplayPosition>();
View Full Code Here

TOP

Related Classes of org.apache.cassandra.cql3.CFDefinition

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.