Package com.netflix.astyanax

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


    long ts1 = System.currentTimeMillis();     
    logger.debug("event=delete column_family=" + columnFamily + " key=" + key + " column=" + column);

    try {
      MutationBatch m = getKeyspace(keyspace).prepareMutationBatch();
      ColumnListMutation<N> clm = m.withRow((ColumnFamily<K, N>)getColumnFamily(columnFamily), key);
      if (column != null) {
        clm.deleteColumn((N)getComposite(column));
      } else {
        clm.delete();
      }
View Full Code Here


    try {
      MutationBatch m = getKeyspace(keyspace).prepareMutationBatch();
      if (columnList == null || columnList.isEmpty()) {
        for (K k : keyList) {
          ColumnListMutation<N> clm = m.withRow((ColumnFamily<K, N>)getColumnFamily(columnFamily), k);
          clm.delete();
          CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraWrite, 1L);
        }
      } else {
        // TODO: review this logic with jane
View Full Code Here

          CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraWrite, 1L);
        }
      } else {
        // TODO: review this logic with jane
        for (int i=0; i< keyList.size();i++) {
          ColumnListMutation<N> clm = m.withRow((ColumnFamily<K, N>)getColumnFamily(columnFamily), keyList.get(i));
          clm.deleteColumn((N)getComposite(columnList.get(i)));
          CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraWrite, 1L);
        }
      }
      OperationResult<Void> result = m.execute();
View Full Code Here

   */
  public void saveValues(Map<Ky, Collection<WideRowValue<Ky, Col, Val>>> grouped)throws ConnectionException {
    MutationBatch m = getKeyspace().prepareMutationBatch();
    for(Ky kee: grouped.keySet()) {
      Iterable<WideRowValue<Ky, Col, Val>> itb = grouped.get(kee);
      ColumnListMutation<Col> clm = m.withRow(getColumnFamily(), kee);
      Iterator<WideRowValue<Ky, Col, Val>> it = itb.iterator();
      while(it.hasNext()) {
        WideRowValue<Ky, Col, Val> value = it.next();
        putColumn(clm, value);
      }
View Full Code Here

 
  public void saveValuesWithUniqueKeys(Map<Ky, WideRowValue<Ky, Col, Val>> values)throws ConnectionException {
    MutationBatch m = getKeyspace().prepareMutationBatch();
    for(Ky kee: values.keySet()) {
      WideRowValue<Ky, Col, Val> value = values.get(kee);
      ColumnListMutation<Col> clm = m.withRow(getColumnFamily(), kee);
      putColumn(clm, value);
    }
    m.execute();
  }
 
View Full Code Here

            MutationBatch m = keyspace.prepareMutationBatch();

            for (long row = 0; row < ROW_COUNT; row++) {
                long value = row * 100;
                m.withRow(CF_DATA, row).putColumn("A", "ABC", null)
                        .putColumn("B", "DEF", null);
                m.withRow(CF_INDEX, "B_" + (row % SHARD_COUNT)).putColumn(
                        new IndexEntry(value, row), row, null);
            }

View Full Code Here

            for (long row = 0; row < ROW_COUNT; row++) {
                long value = row * 100;
                m.withRow(CF_DATA, row).putColumn("A", "ABC", null)
                        .putColumn("B", "DEF", null);
                m.withRow(CF_INDEX, "B_" + (row % SHARD_COUNT)).putColumn(
                        new IndexEntry(value, row), row, null);
            }

            // System.out.println(m);
            m.execute();
View Full Code Here

            OperationResult<Void> result;
            m = keyspace.prepareMutationBatch();

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

                        .putColumn("Index1", (int) (keyName - 'A') + 1, null);
                cfmStandard.putColumn("Index2", 42, null);
                m.execute();
            }

            m.withRow(CF_STANDARD1, "Prefixes").putColumn("Prefix1_a", 1, null)
                    .putColumn("Prefix1_b", 2, null)
                    .putColumn("prefix2_a", 3, null);

            result = m.execute();
View Full Code Here

            m.execute();
           
            m = keyspace.prepareMutationBatch();
            for (int i = 0; i < ALL_ROWS_COUNT; i++) {
                m.withRow(CF_ALL_ROWS,  i).putColumn(0true);
                if (m.getRowCount() == 50) {
                    m.execute();
                }
            }
            m.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.