Package com.netflix.astyanax

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


        m.discardMutations();

        long now = System.currentTimeMillis();
        long msecPerDay = 86400000;
        for (int i = 0; i < 100; i++) {
            m.withRow(CF_TIME_UUID, rowKey).putColumn(
                    TimeUUIDUtils.getTimeUUID(now - i * msecPerDay), i, null);
        }
        m.execute();
       
        OperationResult<ColumnList<UUID>> result = keyspace
View Full Code Here


                    .putColumn("C", 1)
                    ;
            }
            // Add 10 rows
            for (long i = 20; i < 30; i++) {
                m.withRow(CF_ALL_ROWS, i)
                    .putColumn("B", 1)
                    .putColumn("C", 1)
                    ;
            }
            for (long i = 0; i < 100; i++) {
View Full Code Here

                    .putColumn("B", 1)
                    .putColumn("C", 1)
                    ;
            }
            for (long i = 0; i < 100; i++) {
                m.withRow(CF_ALL_ROWS_TOMBSTONE, i)
                 .delete()
                ;
            }
            m.execute();
           
View Full Code Here

            m.execute();
           
            m = keyspace.prepareMutationBatch();
            // Delete 7
            for (long i = 0; i < 20; i += 3) {
                m.withRow(CF_ALL_ROWS, i)
                    .delete();
            }
            // Delete 10
            for (long i = 20; i < 30; i ++ ) {
                m.withRow(CF_ALL_ROWS, i)
View Full Code Here

                m.withRow(CF_ALL_ROWS, i)
                    .delete();
            }
            // Delete 10
            for (long i = 20; i < 30; i ++ ) {
                m.withRow(CF_ALL_ROWS, i)
                    .delete();
            }
           
            // CF_ALL_ROWS should have 13 rows + 17 tombstones
           
View Full Code Here

            m.execute();           
           
            // Add 10,000 rows
            m = keyspace.prepareMutationBatch();
            for (long i = 0; i < LOTS_OF_ROWS_COUNT; i++) {
                m.withRow(CF_LOTS_OF_ROWS, i).putColumn("DATA", "TEST" + i);
            }
            m.execute();
           
           
        } catch (Exception e) {
View Full Code Here

   
        MutationBatch m = keyspace.prepareMutationBatch();

        for (char keyName = 'A'; keyName <= 'Z'; keyName++) {
          String rowKey = Character.toString(keyName);
          ColumnListMutation<String> colMutation = m.withRow(CF_COLUMN_RANGE_TEST, rowKey);
              for (char cName = 'a'; cName <= 'z'; cName++) {
                colMutation.putColumn(Character.toString(cName), (int) (cName - 'a') + 1, null);
              }
              m.withCaching(true);
              m.execute();
View Full Code Here

  private void deleteRowsForColumnRange() throws Exception {
   
        for (char keyName = 'A'; keyName <= 'Z'; keyName++) {
            MutationBatch m = keyspace.prepareMutationBatch();
          String rowKey = Character.toString(keyName);
          m.withRow(CF_COLUMN_RANGE_TEST, rowKey).delete();
          m.execute();
          m.discardMutations();
        }
  }
 
View Full Code Here

    public void clearMessages() throws MessageQueueException {
        LOG.info("Clearing messages from '" + getName() + "'");
        MutationBatch mb = keyspace.prepareMutationBatch().setConsistencyLevel(consistencyLevel);

        for (MessageQueueShard partition : shardReaderPolicy.listShards()) {
            mb.withRow(queueColumnFamily, partition.getName()).delete();
        }

        try {
            mb.execute();
        } catch (ConnectionException e) {
View Full Code Here

    public void deleteQueue() throws MessageQueueException {
        LOG.info("Deleting queue '" + getName() + "'");
        MutationBatch mb = keyspace.prepareMutationBatch().setConsistencyLevel(consistencyLevel);

        for (MessageQueueShard partition : shardReaderPolicy.listShards()) {
            mb.withRow(queueColumnFamily, partition.getName()).delete();
        }

        mb.withRow(queueColumnFamily, getName());

        try {
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.