Package com.netflix.astyanax

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


                                                                                   .build()
                                                                   )
                    .execute()
                    .getResult();
            m = queue.keyspace.prepareMutationBatch().setConsistencyLevel(queue.consistencyLevel);
            rowMutation = m.withRow(queue.queueColumnFamily, shardName);
            rowMutation.deleteColumn(lockColumn);
            int lockCount = 0;
            boolean lockAcquired = false;
            lockColumnCount = result.size();
            for (Column<MessageQueueEntry> column : result) {
View Full Code Here


            }
        }
        long curTimeMicros = TimeUUIDUtils.getMicrosTimeFromUUID(lockColumn.getTimestamp());
        m = queue.keyspace.prepareMutationBatch().setConsistencyLevel(queue.consistencyLevel);
        // First, release the lock column
        rowMutation = m.withRow(queue.queueColumnFamily, shardName);
        rowMutation.deleteColumn(lockColumn);
        return readMessagesInternal(shardName, itemsToPop, lockColumnCount, lockColumn, rowMutation, m, curTimeMicros);
    }

    @Override
View Full Code Here

   
    Random random = new Random();
   
    for (int year = 2001; year <= 2014; year++) {
     
      m.withRow(CF_POPULATION, year)
        .putColumn(NewYork.clone(), random.nextInt(25000))
        .putColumn(SanDiego.clone(), random.nextInt(25000))
        .putColumn(SanFrancisco.clone(), random.nextInt(25000))
        .putColumn(Seattle.clone(), random.nextInt(25000));
    }
View Full Code Here

  private void deleteRowsForCFPopulation() throws Exception {
   
    MutationBatch m = keyspace.prepareMutationBatch();
   
    for (int year = 2001; year <= 2014; year ++) {
      m.withRow(CF_POPULATION, year).delete();
    }
   
    m.execute();
  }
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.discardMutations();
       
        int startTime = 100;
        int endTime = 200;

        m.withRow(CF_TIME_UUID, rowKey).putColumn(columnName, 42, null);
        for (int i = startTime; i < endTime; i++) {
            // UUID c = TimeUUIDUtils.getTimeUUID(i);
            LOG.info(TimeUUIDUtils.getTimeUUID(columnTime + i).toString());

            m.withRow(CF_TIME_UUID, rowKey).putColumn(
View Full Code Here

        m.withRow(CF_TIME_UUID, rowKey).putColumn(columnName, 42, null);
        for (int i = startTime; i < endTime; i++) {
            // UUID c = TimeUUIDUtils.getTimeUUID(i);
            LOG.info(TimeUUIDUtils.getTimeUUID(columnTime + i).toString());

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

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

        MutationBatch m;
        try {
            m = keyspace.prepareMutationBatch();
            // Add 10 rows
            for (long i = 0; i < 10; i++) {
                m.withRow(CF_ALL_ROWS, i)
                    .putColumn("A", 1)
                    .putColumn("B", 1)
                    ;
            }
            // Add 10 rows
View Full Code Here

                    .putColumn("B", 1)
                    ;
            }
            // Add 10 rows
            for (long i = 10; i < 20; i++) {
                m.withRow(CF_ALL_ROWS, i)
                    .putColumn("B", 1)
                    .putColumn("C", 1)
                    ;
            }
            // Add 10 rows
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.