Package com.netflix.astyanax

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


      byte[] json = jsonMapper.writeValueAsBytes(segment);
      MutationBatch mutation = this.keyspace.prepareMutationBatch();
      mutation.withRow(descriptorStorage, key)
        .putColumn("lastmodified", System.currentTimeMillis(), null)
        .putColumn("descriptor", json, null);       
      mutation.execute();
      log.info("Wrote index to C* in [%s] ms", System.currentTimeMillis() - start);
    } catch (Exception e)
    {
      throw new IOException(e);
    }
View Full Code Here


        MutationBatch m;
        OperationResult<Void> result;
        m = ks.prepareMutationBatch();
        m.withRow(dbcf, entity.getRowKey()).putColumn(entity.getName(), entity.getPayLoad(), null);
        try {
            result = m.execute();
            if (entity instanceof PaasTableEntity) {
                String schemaName = ((PaasTableEntity)entity).getSchemaName();
                Keyspace schemaks = kscp.acquireKeyspace(schemaName);
                ColumnFamily<String, String> cf = ColumnFamily.newColumnFamily(entity.getName(), StringSerializer.get(), StringSerializer.get());
                schemaks.createColumnFamily(cf, null);
View Full Code Here

            }
        } catch (ConnectionException e) {
            throw new IndexerException("Failed to get tags : " + tags, e);
        } finally {
            try {
                mb.execute();
            }
            catch (Exception e) {
                // OK to ignore
            }
        }
View Full Code Here

            }
        } catch (ConnectionException e) {
            throw new IndexerException("Failed to get tags : " + tags, e);
        } finally {
            try {
                mb.execute();
            }
            catch (ConnectionException e) {
                // OK to ignore
            }
        }
View Full Code Here

            }
        } catch (ConnectionException e) {
            throw new IndexerException("Failed to get tag : " + indexRowKey, e);
        } finally {
            try {
                mb.execute();
            }
            catch (ConnectionException e) {
                // OK to ignore
            }
        }
View Full Code Here

              .putEmptyColumn(new IndexEntry(id, uuid));
//            idRow.putColumn(tag.getKey(), tag.getValue());
        }
       
        try {
            mb.execute();
        } catch (ConnectionException e) {
            throw new IndexerException("Failed to store tags : " + tags + " for id " + id, e);
        }
    }
View Full Code Here

       
        MutationBatch mb = keyspace.prepareMutationBatch();
        mb.withRow(this.columnFamily, serializers.keyAsByteBuffer(key)).delete();
       
        try {
            mb.execute();
        } catch (ConnectionException e) {
            throw new PaasException(
                    String.format("Failed to update row '%s' in column family '%s.%s'" ,
                                  key, this.keyspace.getKeyspaceName(), this.columnFamily.getName()),
                    e);
View Full Code Here

                }
            }
        }
       
        try {
            mb.execute();
        } catch (ConnectionException e) {
            throw new PaasException(
                    String.format("Failed to update row '%s' in column family '%s.%s'" ,
                                  key, this.keyspace.getKeyspaceName(), this.columnFamily.getName()),
                    e);
View Full Code Here

        ColumnListMutation<ByteBuffer> mbRow = mb.withRow(this.columnFamily, serializers.keyAsByteBuffer(key));
        mbRow.putColumn(serializers.columnAsByteBuffer(column)
                        serializers.valueAsByteBuffer(column, value));
       
        try {
            mb.execute();
        } catch (ConnectionException e) {
            throw new PaasException(
                    String.format("Failed to update row '%s' in column family '%s.%s'" ,
                                  key, this.keyspace.getKeyspaceName(), this.columnFamily.getName()),
                    e);
View Full Code Here

       
        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(
                    String.format("Failed to update row '%s' in column family '%s.%s'" ,
                                  key, this.keyspace.getKeyspaceName(), this.columnFamily.getName()),
                    e);
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.