Package com.netflix.astyanax

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


    public void ackPoisonMessage(MessageContext context) throws MessageQueueException {
        // TODO: Remove bad message and add to poison queue
        MutationBatch mb = queue.keyspace.prepareMutationBatch().setConsistencyLevel(queue.consistencyLevel);
        fillAckMutation(context, mb);
        try {
            mb.execute();
        } catch (ConnectionException e) {
            queue.stats.incPersistError();
            throw new MessageQueueException("Failed to ack messages", e);
        }
    }
View Full Code Here


        .putColumn(SanDiego.clone(), random.nextInt(25000))
        .putColumn(SanFrancisco.clone(), random.nextInt(25000))
        .putColumn(Seattle.clone(), random.nextInt(25000));
    }
   
    m.execute();
  }

  private void deleteRowsForCFPopulation() throws Exception {
   
    MutationBatch m = keyspace.prepareMutationBatch();
View Full Code Here

   
    for (int year = 2001; year <= 2014; year ++) {
      m.withRow(CF_POPULATION, year).delete();
    }
   
    m.execute();
  }

  private void testReadSingleRowAllColumns(boolean rowDeleted) throws Exception {
   
    for (int year = 2001; year <= 2014; year++) {
View Full Code Here

        UUID columnName = TimeUUIDUtils.getUniqueTimeUUIDinMillis();
        long columnTime = TimeUUIDUtils.getTimeFromUUID(columnName);
        String rowKey = "Key1";

        m.withRow(CF_TIME_UUID, rowKey).delete();
        m.execute();
        m.discardMutations();
       
        int startTime = 100;
        int endTime = 200;
View Full Code Here

            m.withRow(CF_TIME_UUID, rowKey).putColumn(
                    TimeUUIDUtils.getTimeUUID(columnTime + i), i, null);
        }

        m.execute();

        OperationResult<Column<UUID>> result = keyspace
            .prepareQuery(CF_TIME_UUID).getKey(rowKey)
            .getColumn(columnName).execute();
View Full Code Here

      CF_TIME_UUID.describe(keyspace);
   
        MutationBatch m = keyspace.prepareMutationBatch();
        String rowKey = "Key2";
        m.withRow(CF_TIME_UUID, rowKey).delete();
        m.execute();
        m.discardMutations();

        long now = System.currentTimeMillis();
        long msecPerDay = 86400000;
        for (int i = 0; i < 100; i++) {
View Full Code Here

        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
            .prepareQuery(CF_TIME_UUID)
            .getKey(rowKey)
            .withColumnRange(
View Full Code Here

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

                    .delete();
            }
           
            // CF_ALL_ROWS should have 13 rows + 17 tombstones
           
            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);
View Full Code Here

            // 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) {
            System.out.println(e.getMessage());
            Assert.fail();
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.