usage(NULL);
exit(0);
}
-
-// else if (ceph_argparse_binary_flag(args, i, &allow_coll_dest, NULL,
-// "--allow-coll-destruction", (char*) NULL)) {
-// m_allow_coll_destruction = (allow_coll_dest ? true : false);
-// }
}
}
bool destroy_collection = should_destroy_collection();
coll_entry_t *entry = get_rnd_coll_entry(destroy_collection);
+ Context *c;
if (destroy_collection) {
do_destroy_collection(t, entry);
+ c = new C_WorkloadGeneratorOnDestroyed(this, t, entry);
} else {
int obj_nr = get_random_object_nr(entry->id);
hobject_t obj = get_object_by_nr(obj_nr);
do_setattr_object(t, entry->coll, obj);
do_setattr_collection(t, entry->coll);
do_append_log(t, entry->coll);
+ c = new C_WorkloadGeneratorOnReadable(this, t);
}
- m_store->queue_transaction(&(entry->osr), t,
- new C_WorkloadGeneratorOnReadable(this, t));
+ m_store->queue_transaction(&(entry->osr), t, c);
m_in_flight++;
}
void finish(int r) {
- dout(0) << "Got one back!" << dendl;
+// dout(0) << "Got one back!" << dendl;
Mutex::Locker locker(m_state->m_lock);
m_state->m_in_flight--;
m_state->m_nr_runs++;
}
};
+ class C_WorkloadGeneratorOnDestroyed: public C_WorkloadGeneratorOnReadable {
+// WorkloadGenerator *m_state;
+// ObjectStore::Transaction *m_tx;
+ coll_entry_t *m_entry;
+
+ public:
+ C_WorkloadGeneratorOnDestroyed(WorkloadGenerator *state,
+ ObjectStore::Transaction *t, coll_entry_t *entry) :
+ C_WorkloadGeneratorOnReadable(state, t), m_entry(entry) {}
+
+ void finish(int r) {
+ C_WorkloadGeneratorOnReadable::finish(r);
+ dout(0) << "Destroyed collection " << m_entry->coll.to_str() << dendl;
+ delete m_entry;
+ }
+ };
+
void run(void);
void print_results(void);
};