~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 17:52:24 UTC
  • Revision ID: psergey@askmonty.org-20120920175224-mgeb9lxj0s89uudb
Parallel load fixes

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