Package com.netflix.astyanax

Examples of com.netflix.astyanax.MutationBatch.execute()


        MutationBatch mutation = getKeyspace(keyspace).prepareMutationBatch();
        ColumnFamily<K, C> columnFamily = new ColumnFamily<K, C>(columnFamilyName,
                (Serializer<K>) serializerFor(tupleMapper.getKeyClass()),
                (Serializer<C>) serializerFor(tupleMapper.getColumnNameClass()));
        this.addTupleToMutation(input, columnFamily, rowKey, mutation, tupleMapper);
        mutation.execute();
    }

    @SuppressWarnings("unchecked")
    public void writeTuple(TridentTuple input, TridentTupleMapper<K, C, V> tupleMapper) throws Exception {
        String columnFamilyName = tupleMapper.mapToColumnFamily(input);
View Full Code Here


        MutationBatch mutation = getKeyspace(keyspace).prepareMutationBatch();
        ColumnFamily<K, C> columnFamily = new ColumnFamily<K, C>(columnFamilyName,
                (Serializer<K>) serializerFor(tupleMapper.getKeyClass()),
                (Serializer<C>) serializerFor(tupleMapper.getColumnNameClass()));
        this.addTupleToMutation(input, columnFamily, rowKey, mutation, tupleMapper);
        mutation.execute();
    }
   
    @SuppressWarnings({ "static-access", "unchecked" })
    public void writeTuples(List<TridentTuple> inputs, TridentTupleMapper<K, C, V> tupleMapper) throws Exception {
        Map<String, MutationBatch> mutations = new HashMap<String, MutationBatch>();
View Full Code Here

                (Serializer<K>) serializerFor(tupleMapper.getKeyClass()),
                (Serializer<C>) serializerFor(tupleMapper.getColumnNameClass()));
        for (C columnName : tupleMapper.mapToColumnList(input)) {
            mutation.withRow(columnFamily, rowKey).incrementCounterColumn(columnName, incrementAmount);
        }
        mutation.execute();
    }

    @SuppressWarnings("unchecked")
  public void incrementCountColumns(List<Tuple> inputs, TupleCounterMapper<K,C> tupleMapper) throws Exception {   
        Map<String, MutationBatch> mutations = new HashMap<String, MutationBatch>();
View Full Code Here

            } else {
                mutation.withRow(cf, keyName).putColumn(this.options.columnName, bytes);
            }
        }
        try {
            mutation.execute();
        } catch (ConnectionException e) {
            throw new RuntimeException("Batch mutation for state failed.", e);
        }
    }
View Full Code Here

            mutation.withRow(cf, "mykey").putColumn(makeStringComposite("foo", "bar"),
                    "Hello Composite Column Range Query");
            mutation.withRow(cf, "mykey").putColumn(makeStringComposite("foo", "baz"), "My dog has fleas");
            mutation.withRow(cf, "mykey").putColumn(makeStringComposite("fzz", "baz"), "It is snowing");

            mutation.execute();

            // simple column fetch
            ColumnFamilyQuery<String, Composite> query = ks.prepareQuery(cf);
            Column<Composite> result = query.getKey("mykey").getColumn(makeStringComposite("foo", "bar")).execute()
                    .getResult();
View Full Code Here

            for(String str : combinations){
                LOG.debug("Will insert '{}'", str);
                mutation.withRow(cf, rowkey).putColumn(makeStringComposite(str.substring(0,1), str.substring(1,2), str.substring(2,3)), str);
            }

            mutation.execute();

            // build up a composite range query
            Composite start = makeStringEqualityComposite(new String[] { "a", "a", "a"}, new ComponentEquality[] {
                    ComponentEquality.EQUAL,ComponentEquality.EQUAL, ComponentEquality.EQUAL });
            Composite end = makeStringEqualityComposite(new String[] { "a", "a", "b"}, new ComponentEquality[] {
View Full Code Here

       
       
       
        mutation.withRow(cf, "foo").putColumn(c2, "Hello World");
       
        mutation.execute();
       
       
    }
   
   
View Full Code Here

            m.withRow(cfs, key).incrementCounterColumn(colName, (Long) value);
        else
            m.withRow(cfs, key).putColumn(colName, value, valueSerializer, null);
        try
        {
            OperationResult<Void> result = m.execute();
            return new AstyanaxResponseData("", 0, result, key, colName, value);
        }
        catch (ConnectionException e)
        {
            throw new OperationException(e);
View Full Code Here

            else
                cf.putColumn(entry.getKey(), entry.getValue(), valueSerializer, null);
        }
        try
        {
            OperationResult<Void> result = m.execute();
            return new AstyanaxResponseData("", 0, result, key, nv);
        }
        catch (ConnectionException e)
        {
            throw new OperationException(e);
View Full Code Here

        removeColumn((RemoveColumn) action, ormSession, m);
      }
    }
   
    long time = System.currentTimeMillis();
    m.execute();
   
    if(log.isTraceEnabled()) {
      long total = System.currentTimeMillis()-time;
      log.trace("astyanx save took="+total+" ms");
    }
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.