Package com.netflix.astyanax

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


                insertMetric(metric, mutationBatch);
                Instrumentation.markFullResMetricWritten();
            }
            // insert it
            try {
                mutationBatch.execute();
            } catch (ConnectionException e) {
                Instrumentation.markWriteError(e);
                log.error("Connection exception during insertFull", e);
                throw e;
            }
View Full Code Here


                for (Map.Entry<String, String> meta : metaRow.entrySet()) {
                    mutation.putColumn(meta.getKey(), meta.getValue(), StringMetadataSerializer.get(), null);
                }
            }
            try {
                batch.execute();
            } catch (ConnectionException e) {
                Instrumentation.markWriteError(e);
                log.error("Connection exception persisting metadata", e);
                throw e;
            }
View Full Code Here

                        insertLocator(locator, batch);
                    AstyanaxWriter.setLocatorCurrent(locator);
                }
            }
            try {
                batch.execute();
            } catch (ConnectionException e) {
                Instrumentation.markWriteError(e);
                log.error("Connection exception persisting data", e);
                throw e;
            }
View Full Code Here

                     */
                }
            }
            if (!mutationBatch.isEmpty())
                try {
                    mutationBatch.execute();
                } catch (ConnectionException e) {
                    Instrumentation.markWriteError(e);
                    log.error("Error persisting shard state", e);
                    throw e;
                }
View Full Code Here

                // let's not let stupidness prevent the rest of this put.
                log.warn(String.format("Cannot save %s", writeContext.getLocator().toString()), ex);
            }
        }
        try {
            mb.execute();
        } catch (ConnectionException e) {
            Instrumentation.markWriteError(e);
            log.error("Error writing rollup batch", e);
            throw e;
        } finally {
View Full Code Here

        // add another metric
        mb.withRow(at.getFullCF(), locator)
                .putColumn(collectionTimeInSecs + 1,
                        NumericSerializer.serializerFor(Integer.class).toByteBuffer(456));

        mb.execute();
    }

    @Test
    // Testing an edge case when there are no metrics available for a locator
    // in the database
View Full Code Here

                .putColumn(collectionTimeInSecs, "HTTP GET succeeded")
                .putColumn(collectionTimeInSecs + 1, "HTTP GET failed");
        mb.withRow(at.getStringCF(), otherLocator)
                .putColumn(collectionTimeInSecs + 2, "false");

        mb.execute();
    }

    @Test
    // Testing an edge case when there are no metrics available for a locator
    // in the database
View Full Code Here

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

        return locators;
    }

    private void writeFullData(
View Full Code Here

                                        }
                                        columnsTransferred.addAndGet(colCount);
                                       
                                        // save it, submit a log message to be shown later.
                                        try {
                                            batch.execute();
                                            if (verify && random.nextFloat() < VERIFY_PERCENT) {
                                                verifyExecutor.submit(new Runnable() {public void run() {
                                                    try {
                                                        ColumnList<Long> srcData = srcKeyspace.prepareQuery(columnFamily).getKey(locatorCapture)
                                                                .withColumnRange(range)
View Full Code Here

      }
    }
   
    long time = System.currentTimeMillis();
        try {
            m.execute();
        } catch (TokenRangeOfflineException e) {
            throw new RuntimeException(
                    "It appears your CL_LEVEL is CL_QUOROM and there are not enough nodes on line to service that request.  Either lower your CL_LEVEL or make sure all nodes are operational");
        }
   
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.