mateuszkojro / daos-cxx

C++ wrapper over libdaos
MIT License
0 stars 0 forks source link

High 32bits are not used while generating OIDs #3

Open github-actions[bot] opened 2 years ago

github-actions[bot] commented 2 years ago

https://github.com/mateuszkojro/daos-cxx/blob/a380d5164deb10a3df1836dc4a415a0d8d2ef345/src/Container.cxx#L34


  }
}

// TODO: High 32bits are not used while generating OIDs
uint64_t generate_oid_low() {
  static uint64_t counter = 0;
  return counter++;
}
uint64_t generate_oid_high() {
  uint64_t counter = 0xffffffffL << 32;
  return counter;
}

// TODO: Optimisations with placment of the objects can be made using OIDs
daos_obj_id_t generate_oid() {
  daos_obj_id_t object_id = {0};
  object_id.hi = generate_oid_high();
  object_id.lo = generate_oid_low();
  return object_id;
}

KeyValuePtr Container::create_kv_object() {
  daos_obj_id_t object_id = generate_oid();

  // TODO: Look at the cid parameter in the documentation it could speed things
  // up

┆Issue is synchronized with this Trello card by Unito