Package org.apache.cassandra.cql3

Examples of org.apache.cassandra.cql3.Term$Terminal


        return new ColumnSpecification(column.ksName, column.cfName, new ColumnIdentifier("idx(" + column.name + ")", true), Int32Type.instance);
    }

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


                                                                itemId));
            logger.trace("Retrieved prepared statement #{} with {} bind markers", itemId, statement.getBoundsTerms());

            return org.apache.cassandra.cql3.QueryProcessor.processPrepared(statement,
                                                                            cState.getQueryState(),
                                                                            new QueryOptions(ThriftConversion.fromThrift(cLevel), bindVariables)).toThriftResult();
        }
        catch (RequestExecutionException e)
        {
            throw ThriftConversion.rethrow(e);
        }
View Full Code Here

                                                                itemId, org.apache.cassandra.cql3.QueryProcessor.MAX_CACHE_PREPARED, itemId));
            logger.trace("Retrieved prepared statement #{} with {} bind markers", itemId, statement.getBoundsTerms());

            return org.apache.cassandra.cql3.QueryProcessor.processPrepared(statement,
                                                                            cState.getQueryState(),
                                                                            new QueryOptions(ThriftConversion.fromThrift(cLevel), bindVariables)).toThriftResult();
        }
        catch (RequestExecutionException e)
        {
            throw ThriftConversion.rethrow(e);
        }
View Full Code Here

    private ResultMessage resultMessage(List<PermissionDetails> details)
    {
        if (details.isEmpty())
            return new ResultMessage.Void();

        ResultSet result = new ResultSet(metadata);
        for (PermissionDetails pd : details)
        {
            result.addColumnValue(UTF8Type.instance.decompose(pd.username));
            result.addColumnValue(UTF8Type.instance.decompose(pd.resource.toString()));
            result.addColumnValue(UTF8Type.instance.decompose(pd.permission.toString()));
        }
        return new ResultMessage.Rows(result);
    }
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

    }

    private void doSet(ColumnFamily cf, ColumnNameBuilder builder, UpdateParameters params, CollectionType validator, List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
    {
        int idx = validateListIdx(values.get(0), list);
        Term value = values.get(1);

        ByteBuffer name = list.get(idx).right.name();
        cf.addColumn(params.makeColumn(name, value.getByteBuffer(validator.valueComparator(), params.variables)));
    }
View Full Code Here

        ListType lt = (ListType)column.type;
        if (kind == Kind.SET_IDX)
        {
            assert values.size() == 2;
            Term idx = values.get(0);
            Term value = values.get(1);
            if (idx.isBindMarker())
                boundNames[idx.bindIndex] = indexSpecOf(column);
            if (value.isBindMarker())
                boundNames[value.bindIndex] = valueSpecOf(column, lt);
        }
        else
        {
            for (Term t : values)
View Full Code Here

            List<Term> parameters = new ArrayList<Term>(terms.size());
            boolean allTerminal = true;
            for (int i = 0; i < terms.size(); i++)
            {
                Term t = terms.get(i).prepare(Functions.makeArgSpec(receiver, fun, i));
                if (t instanceof NonTerminal)
                    allTerminal = false;
                parameters.add(t);
            }
View Full Code Here

            List<Term> parameters = new ArrayList<Term>(terms.size());
            boolean allTerminal = true;
            for (int i = 0; i < terms.size(); i++)
            {
                Term t = terms.get(i).prepare(Functions.makeArgSpec(receiver, fun, i));
                if (t instanceof NonTerminal)
                    allTerminal = false;
                parameters.add(t);
            }
View Full Code Here

    }

    private void doSet(ColumnFamily cf, ColumnNameBuilder builder, UpdateParameters params, CollectionType validator, List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
    {
        int idx = validateListIdx(values.get(0), list);
        Term value = values.get(1);

        ByteBuffer name = list.get(idx).right.name();
        cf.addColumn(params.makeColumn(name, value.getByteBuffer(validator.valueComparator(), params.variables)));
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.cql3.Term$Terminal

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.