Examples of withRow()


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

    private void populateMetricsFull() throws Exception {
        final long collectionTimeInSecs = 12345;

        AstyanaxTester at = new AstyanaxTester();
        MutationBatch mb = at.createMutationBatch();
        mb.withRow(at.getStringCF(), locator)
                .putColumn(collectionTimeInSecs, "HTTP GET succeeded")
                .putColumn(collectionTimeInSecs + 1, "HTTP GET failed");
        mb.withRow(at.getStringCF(), otherLocator)
                .putColumn(collectionTimeInSecs + 2, "false");
View Full Code Here

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

        AstyanaxTester at = new AstyanaxTester();
        MutationBatch mb = at.createMutationBatch();
        mb.withRow(at.getStringCF(), locator)
                .putColumn(collectionTimeInSecs, "HTTP GET succeeded")
                .putColumn(collectionTimeInSecs + 1, "HTTP GET failed");
        mb.withRow(at.getStringCF(), otherLocator)
                .putColumn(collectionTimeInSecs + 2, "false");

        mb.execute();
    }
View Full Code Here

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

        AstyanaxTester at = new AstyanaxTester();
        MutationBatch mb = at.createMutationBatch();

        for (Locator locator : locators) {
            int shard = Util.computeShard(locator.toString());
            mb.withRow(at.getLocatorCF(), (long)shard)
                    .putColumn(locator, "", 100000);
        }
        mb.execute();

        return locators;
View Full Code Here

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

                                            return;
                                        }
                                       
                                        // copy the column.
                                        MutationBatch batch = dstKeyspace.prepareMutationBatch();
                                        ColumnListMutation<Long> mutation = batch.withRow(columnFamily, locatorCapture);

                                        assert ttl != 0;
                                        long colCount = 0;
                                        for (Column<Long> c : row.getColumns()) {
                                            mutation.putColumn(c.getName(), c.getByteBufferValue(), ttl);
View Full Code Here

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

    protected Void run() throws Exception {
        try {
            MutationBatch m = keyspace.prepareMutationBatch().setConsistencyLevel(ConsistencyLevel.CL_QUORUM);

            // Setting columns in a standard column
            ColumnListMutation<String> cm = m.withRow(columnFamily, rowKey);
            for (String key : attributes.keySet()) {
                Object o = attributes.get(key);
                if (o != null) {
                    // unfortunately the 'putColumn' method does not nicely figure out what type the Object is so we need to do it manually
                    if (o instanceof String) {
View Full Code Here

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

   */
  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

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

 
  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

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

    try {
      MutationBatch m =
          getKeyspace(keyspace).
          prepareMutationBatch();
      m.withRow((ColumnFamily)getColumnFamily(columnFamily), key).
        putColumn(getComposite(column), value, getSerializer(valueSerializer), ttl);
      m.execute();
    } catch (ConnectionException ex) {
      throw new PersistenceException(ex);
    } finally {
View Full Code Here

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

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

    try {
      MutationBatch m = getKeyspace(keyspace).prepareMutationBatch();
      ColumnListMutation<N> clm = m.withRow((ColumnFamily<K, N>)getColumnFamily(columnFamily), rowKey);
      for (N columnName : columnValues.keySet()) {
        clm.putColumn((N)getComposite(columnName), columnValues.get(columnName), getSerializer(valueSerializer), ttl);
        CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraWrite, 1L);
      }
      OperationResult<Void> result = m.execute();
View Full Code Here

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

    logger.debug("event=insert_rows column_family=" + columnFamily);

    try {
      MutationBatch m = getKeyspace(keyspace).prepareMutationBatch();
      for (K rowKey : rowColumnValues.keySet()) {
        ColumnListMutation<N> clm = m.withRow((ColumnFamily<K, N>)getColumnFamily(columnFamily), rowKey);
        for (N columnName : rowColumnValues.get(rowKey).keySet()) {
          clm.putColumn((N)getComposite(columnName), rowColumnValues.get(rowKey).get(columnName), getSerializer(valueSerializer), ttl);
          CMBControllerServlet.valueAccumulator.addToCounter(AccumulatorName.CassandraWrite, 1L);
        }
      }
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.