Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Aggregation Operation

Code Block
for(uint64_t i = 0; i < range; ++i)
   {
        LogEntryHandle handle = objectMap.lookup(tableId, i);
        const Object* obj = handle->userData<Object>();
        int *p;
        p = (int*) obj->data;
        sum += (uint64_t)*p;
   }
Code Block

/**
* Aggregation Callback
*/
void
aggregateCallback(LogEntryHandle handle, uint8_t type,
                      void *cookie)
{
        const Object* obj = handle->userData<Object>();
        MasterServer *server = reinterpret_cast<MasterServer*>(cookie);

        int *p;
        p = (int*) obj->data;
        server->sum += (uint64_t)*p;
}

...