~maria-captains/maria/5.5-cassandra-parallel

« back to all changes in this revision

Viewing changes to storage/cassandra/cassandra_se.cc

  • Committer: Sergey Petrunya
  • Date: 2012-09-20 14:32:37 UTC
  • Revision ID: psergey@askmonty.org-20120920143237-og4d9qh8uiojasmi
Casandra SE:
- Introduce asynchronous operations
- parallel INSERT operation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
  void on_set_keyspace_fail();
155
155
  void on_describe_keyspace(org::apache::cassandra::KsDef ks_def_arg);
156
156
  void on_batch_mutate_done();
157
 
  void on_batch_mutate_fail();
158
157
 
159
158
  uint connected;
160
159
  uint keyspace_set;
467
466
  batch_mutations_to_do--;
468
467
}
469
468
 
470
 
void Cassandra_se_impl::on_batch_mutate_fail()
471
 
{
472
 
  batch_mutations_to_do--;
473
 
  error_happened= true;
474
 
}
475
 
 
476
469
 
477
470
bool Cassandra_se_impl::do_insert(bool flush)
478
471
{
488
481
      return false;
489
482
    }
490
483
  }
491
 
  
492
 
  batch_mutations_to_do= 0;
493
 
  error_happened= false;
 
484
 
494
485
  for (uint i= 0; i < size; i++)
495
486
  {
496
487
    /*
503
494
 
504
495
    batch_mutations_to_do++;
505
496
    async_clients[i]->batch_mutate(batch_mutations[i], cur_consistency_level).
506
 
      setCallback(boost::bind(&Cassandra_se_impl::on_batch_mutate_done, this)).
507
 
        setErrback(boost::bind(&Cassandra_se_impl::on_batch_mutate_fail, this));
 
497
      setCallback(boost::bind(&Cassandra_se_impl::on_batch_mutate_done, this));
508
498
 
509
499
    cassandra_counters.row_inserts+= batch_mutations[i].size();
510
500
    cassandra_counters.row_insert_batches++;
516
506
    //fprintf(stderr, "bm processed %d events\n", (int)cnt);
517
507
  }
518
508
  res= false;
519
 
  if (error_happened)
520
 
    res= true;
521
509
 
522
510
  clear_insert_buffer();
523
511