Пример #1
0
void DummyStMgr::HandleRegisterResponse(void*, proto::tmaster::StMgrRegisterResponse* response,
                                        NetworkErrorCode status) {
  if (status != OK) {
    LOG(ERROR) << "NonOK response message for Register Response";
    delete response;
    Stop();
    ::exit(1);
    return;
  }
  proto::system::StatusCode st = response->status().status();
  bool has_assignment = response->has_pplan();
  delete response;
  if (st != proto::system::OK) {
    LOG(ERROR) << "Register failed with status " << st;
    ::exit(1);
    return Stop();
  } else {
    if (has_assignment) {
      HandleNewPhysicalPlan(response->pplan());
      LOG(INFO) << "Register returned with an already existing pplan";
    } else {
      LOG(INFO) << "Register returned with no existing pplan";
    }
    AddTimer([this]() { this->OnHeartbeatTimer(); }, 10000000);
  }
}
Пример #2
0
void Slave::HandleGatewayData(google::protobuf::Message* msg) {
  if (msg->GetTypeName() == pplan_typename_) {
    LOG(INFO) << "Slave Received a new pplan message from Gateway";
    auto pplan = static_cast<proto::system::PhysicalPlan*>(msg);
    HandleNewPhysicalPlan(pplan);
  } else {
    auto tupleSet = static_cast<proto::system::HeronTupleSet2*>(msg);
    HandleStMgrTuples(tupleSet);
  }
}
Пример #3
0
void DummyStMgr::HandleNewAssignmentMessage(proto::stmgr::NewPhysicalPlanMessage* message) {
  LOG(INFO) << "Got a new assignment";
  HandleNewPhysicalPlan(message->new_pplan());
  delete message;
}