void StoreDelegateRddActor::handleRddCreate(const ActorMessagePtr& msg) {
  DVLOG(2) << "StoreDelegateRddActor : handle create store delegate.";
  rawMsg = msg;
  CreateDelegateRddRequest* request = dynamic_cast<CreateDelegateRddRequest*>(msg->getPayload().get());

  idgs::store::MetadataHelper::loadStoreMetadata(request->store_name(), metadata.get());

  ClusterFramework& cluster = ::idgs::util::singleton<ClusterFramework>::getInstance();
  for (int32_t partition = 0; partition < partitionSize; ++partition) {
    int32_t memberId = cluster.getPartitionManager()->getPartition(partition)->getPrimaryMemberId();
    shared_ptr<CreateDelegatePartitionRequest> payload(new CreateDelegatePartitionRequest);
    payload->set_store_name(request->store_name());
    payload->set_partition(partition);
    payload->set_rdd_name(getRddName());

    ActorMessagePtr reqMsg = createActorMessage();
    reqMsg->setOperationName(CREATE_DELEGATE_PARTITION);
    reqMsg->setDestActorId(RDD_SERVICE_ACTOR);
    reqMsg->setDestMemberId(memberId);
    reqMsg->setPayload(payload);

    DVLOG(3) << "RDD \"" << getRddName() << "\" sending create RDD partition to member " << memberId;

    ::idgs::actor::postMessage(reqMsg);
  }
}
void AggregatorActor::sendResponse(const std::string& opName, const shared_ptr<Message>& response) {
  ActorMessagePtr am = clientMsg->createResponse();
  am->setOperationName(opName);
  am->setPayload(response);
  idgs::actor::sendMessage(am);
}