Examples of withRow()


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

        MutationBatch mutation = getKeyspace(keyspace).prepareMutationBatch();
        ColumnFamily<K, C> columnFamily = new ColumnFamily<K, C>(columnFamilyName,
                (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")
View Full Code Here

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

        for (int i = 0; i < keys.size(); i++) {
            Composite keyName = toKeyName(keys.get(i));
            byte[] bytes = serializer.serialize(values.get(i));
            if (options.ttl != null && options.ttl > 0) {
                mutation.withRow(cf, keyName).putColumn(this.options.columnName, bytes, options.ttl);
            } else {
                mutation.withRow(cf, keyName).putColumn(this.options.columnName, bytes);
            }
        }
        try {
View Full Code Here

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

            Composite keyName = toKeyName(keys.get(i));
            byte[] bytes = serializer.serialize(values.get(i));
            if (options.ttl != null && options.ttl > 0) {
                mutation.withRow(cf, keyName).putColumn(this.options.columnName, bytes, options.ttl);
            } else {
                mutation.withRow(cf, keyName).putColumn(this.options.columnName, bytes);
            }
        }
        try {
            mutation.execute();
        } catch (ConnectionException e) {
View Full Code Here

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

            long incrementAmount = tupleMapper.mapToIncrementAmount(input);
            ColumnFamily<K, C> columnFamily = new ColumnFamily<K, C>(columnFamilyName,
                    (Serializer<K>) serializerFor(tupleMapper.getKeyClass()),
                    (Serializer<C>) serializerFor(tupleMapper.getColumnNameClass()));
            for (C columnName : tupleMapper.mapToColumnList(input)) {
                mutation.withRow(columnFamily, rowKey).incrementCounterColumn(columnName, incrementAmount);
            }
        }
        for(String key : mutations.keySet()) {
            mutations.get(key).execute();
        }
View Full Code Here

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

            ColumnFamily<String, Composite> cf = new ColumnFamily<String, Composite>("composite",
                    StringSerializer.get(), CompositeSerializer.get());

            MutationBatch mutation = ks.prepareMutationBatch();

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

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

            MutationBatch mutation = ks.prepareMutationBatch();

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

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

            MutationBatch mutation = ks.prepareMutationBatch();

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

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

           
            List<String> combinations = combinationsWithRepitition("abcdef", 3);
           
            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
View Full Code Here

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

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

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

    @Override
    public void addReadings(List<Reading> readings) {
        MutationBatch m = keyspace.prepareMutationBatch();

        for (Reading reading : readings) {
            m.withRow(columnFamilyInfo, reading.getSensorId())
                    .putColumn(reading.getTimestamp(), reading, ReadingSerializer.get(), ttl);
        }

        try {
            // note: you still have access to m.execute() if you don't need async feature.
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.