Versions Compared

Key

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

...

An aggregation operations adds up the values of a number of objects. When executing such an operation in RAMCloud three questions, among others, are of interest:1)

  1. Where to execute the aggregation operation (client or server side)?

...

  1. How to describe the range of objects which should be included in the operation?

...

  1. How to interpret the objects themselves?

The experiments below are centered around the question about where to execute execute the operation. Three different scenarios are implemented:

  • Client-side aggregation
Code Block
titleListing 1: Aggregation via looking up a certain range of keys in MasterServer.cc
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
titleListing 2:Aggregation using a callback in MasterServer.cc that gets invoked via objectMap.forEach()
/**
* 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;
}

...