Examples of BatchSizeHint


Examples of me.prettyprint.cassandra.service.BatchSizeHint

     * @param columns   the columns to be deleted by name
     */
    @Override
    public void deleteColumns(String colFamily, String key, String... columns) {
        Keyspace keyspace = HFactory.createKeyspace(getDefaultKeySpace(), cluster);
        Mutator<String> mutator = HFactory.createMutator(keyspace, StringSerializer.get(), new BatchSizeHint(1, columns.length));
        for (String property : columns) {
            fireColumnEvent(Event.Column.PRE_COLUMN_DELETION, null, property, key, colFamily, null);
            mutator.addDeletion(key, colFamily, property, StringSerializer.get());
            log.debug(String.format("\tD: %s", property));
            fireColumnEvent(Event.Column.POST_COLUMN_DELETION, null, property, key, colFamily, null);
View Full Code Here

Examples of me.prettyprint.cassandra.service.BatchSizeHint

     * @param keyValuePairs the map with keys and values
     */
    @Override
    public void insertColumns(String colFamily, String key, Map<String, Object> keyValuePairs) {
        Keyspace keyspace = HFactory.createKeyspace(getDefaultKeySpace(), cluster);
        Mutator<String> mutator = HFactory.createMutator(keyspace, StringSerializer.get(), new BatchSizeHint(1, keyValuePairs.size()));
        for (Map.Entry<String, Object> entry : keyValuePairs.entrySet()) {
            String property = entry.getKey();
            Object value = entry.getValue();
            HColumn<String, Object> column = createColumn(property, value, StringSerializer.get(), new TypeConverterSerializer<Object>(value));
            fireColumnEvent(Event.Column.PRE_COLUMN_MUTATION, null, property, key, colFamily, column);
View Full Code Here

Examples of me.prettyprint.cassandra.service.BatchSizeHint

     */
    private Mutator<String> getMutator(ClassMetadata classMetadata) {
        String keySpace = classMetadata.getKeySpace();
        keySpace = keySpace != null ? keySpace : getDefaultKeySpace();
        Keyspace keyspace = HFactory.createKeyspace(keySpace, cluster, getColumnFamilyConsistencyLevel(classMetadata));
        return HFactory.createMutator(keyspace, StringSerializer.get(), new BatchSizeHint(1, classMetadata.getMutationProperties().size()));
    }
View Full Code Here

Examples of me.prettyprint.cassandra.service.BatchSizeHint

  @Override
  public Void call() throws Exception {
    log.info("In call on counter insert");
    Mutator<String> counterMutator =
      HFactory.createMutator(commandArgs.keyspace, StringSerializer.get(), new BatchSizeHint(500,2));
    int rows = 0;
    for (;rows < commandArgs.getKeysPerThread(); rows++) {

      log.info("current count {}", rows);
      // build all bucket - 1 row
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.