Examples of withRow()


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

    @Override
    public void deleteRow(String key) throws PaasException {
        invariant();
       
        MutationBatch mb = keyspace.prepareMutationBatch();
        mb.withRow(this.columnFamily, serializers.keyAsByteBuffer(key)).delete();
       
        try {
            mb.execute();
        } catch (ConnectionException e) {
            throw new PaasException(
View Full Code Here

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

        LOG.info("Update row: " + rowData.toString());
        invariant();
       
        MutationBatch mb = keyspace.prepareMutationBatch();
        if (rowData.hasSchemalessRows()) {
            ColumnListMutation<ByteBuffer> mbRow = mb.withRow(this.columnFamily, serializers.keyAsByteBuffer(key));
            for (Entry<String, Map<String, String>> row : rowData.getSrows().getRows().entrySet()) {
                for (Entry<String, String> column : row.getValue().entrySet()) {
                    mbRow.putColumn(serializers.columnAsByteBuffer(column.getKey())
                                    serializers.valueAsByteBuffer(column.getKey(), column.getValue()));
                }
View Full Code Here

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

    public void updateColumn(String key, String column, String value) throws NotFoundException, PaasException {
        LOG.info("Update row");
        invariant();
       
        MutationBatch mb = keyspace.prepareMutationBatch();
        ColumnListMutation<ByteBuffer> mbRow = mb.withRow(this.columnFamily, serializers.keyAsByteBuffer(key));
        mbRow.putColumn(serializers.columnAsByteBuffer(column)
                        serializers.valueAsByteBuffer(column, value));
       
        try {
            mb.execute();
View Full Code Here

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

    public void deleteColumn(String key, String column) throws PaasException {
        LOG.info("Update row");
        invariant();
       
        MutationBatch mb = keyspace.prepareMutationBatch();
        ColumnListMutation<ByteBuffer> mbRow = mb.withRow(this.columnFamily, serializers.keyAsByteBuffer(key));
        mbRow.deleteColumn(serializers.columnAsByteBuffer(column));
        try {
            mb.execute();
        } catch (ConnectionException e) {
            throw new PaasException(
View Full Code Here

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

        MutationBatch batch = keyspace.prepareMutationBatch();

        try {
            for (Locator locator : metaTable.rowKeySet()) {
                Map<String, String> metaRow = metaTable.row(locator);
                ColumnListMutation<String> mutation = batch.withRow(cf, locator);

                for (Map.Entry<String, String> meta : metaRow.entrySet()) {
                    mutation.putColumn(meta.getKey(), meta.getValue(), StringMetadataSerializer.get(), null);
                }
            }
View Full Code Here

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

        Timer.Context ctx = Instrumentation.getWriteTimerContext(cf);
        Multimap<Locator, IMetric> map = asMultimap(metrics);
        MutationBatch batch = keyspace.prepareMutationBatch();
        try {
            for (Locator locator : map.keySet()) {
                ColumnListMutation<Long> mutation = batch.withRow(cf, locator);
               
                // we want to insert a locator only for non-string, non-boolean metrics. If there happen to be string or
                // boolean metrics mixed in with numeric metrics, we still want to insert a locator.  If all metrics
                // are boolean or string, we DO NOT want to insert a locator.
                boolean locatorInsertOk = false;
View Full Code Here

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

    public void persistShardState(int shard, Map<Granularity, Map<Integer, UpdateStamp>> updates) throws ConnectionException {
        Timer.Context ctx = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_STATE);
        try {
            MutationBatch mutationBatch = keyspace.prepareMutationBatch();
            ColumnListMutation<SlotState> mutation = mutationBatch.withRow(CassandraModel.CF_METRICS_STATE, (long)shard);
            for (Map.Entry<Granularity, Map<Integer, UpdateStamp>> granEntry : updates.entrySet()) {
                Granularity g = granEntry.getKey();
                for (Map.Entry<Integer, UpdateStamp> entry : granEntry.getValue().entrySet()) {
                    // granularity,slot,state
                    SlotState slotState = new SlotState(g, entry.getKey(), entry.getValue().getState());
View Full Code Here

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

                        writeContext.getGranularity(),
                        writeContext.getRollup().getRollupType()).toSeconds();
            }
            AbstractSerializer serializer = NumericSerializer.serializerFor(rollup.getClass());
            try {
                mb.withRow(writeContext.getDestinationCF(), writeContext.getLocator())
                        .putColumn(writeContext.getTimestamp(),
                                rollup,
                                serializer,
                                ttl);
            } catch (RuntimeException ex) {
View Full Code Here

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

        final long collectionTimeInSecs = 12345;

        // add a metric to locator
        AstyanaxTester at = new AstyanaxTester();
        MutationBatch mb = at.createMutationBatch();
        mb.withRow(at.getFullCF(), locator)
                .putColumn(collectionTimeInSecs,
                        NumericSerializer.serializerFor(Integer.class).toByteBuffer(123));

        // add another metric
        mb.withRow(at.getFullCF(), locator)
View Full Code Here

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

        mb.withRow(at.getFullCF(), locator)
                .putColumn(collectionTimeInSecs,
                        NumericSerializer.serializerFor(Integer.class).toByteBuffer(123));

        // add another metric
        mb.withRow(at.getFullCF(), locator)
                .putColumn(collectionTimeInSecs + 1,
                        NumericSerializer.serializerFor(Integer.class).toByteBuffer(456));

        mb.execute();
    }
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.