예제 #1
0
void StatsInterface::HandleStmgrsRegistrationSummaryRequest(IncomingHTTPRequest* _request) {
  LOG(INFO) << "Request for stream managers registration summary " << _request->GetQuery();
  unsigned char* request_data =
    _request->ExtractFromPostData(0, _request->GetPayloadSize());
  heron::proto::tmaster::StmgrsRegistrationSummaryRequest stmgrs_reg_request;
  if (!stmgrs_reg_request.ParseFromArray(request_data, _request->GetPayloadSize())) {
    LOG(ERROR) << "Unable to deserialize post data specified in" <<
      "StmgrsRegistrationSummaryRequest" << std::endl;
    http_server_->SendErrorReply(_request, 400);
    delete _request;
    return;
  }
  auto stmgrs_reg_summary_response = tmaster_->GetStmgrsRegSummary();
  sp_string response_string;
  CHECK(stmgrs_reg_summary_response->SerializeToString(&response_string));
  auto http_response = new OutgoingHTTPResponse(_request);
  http_response->AddHeader("Content-Type", "application/octet-stream");
  http_response->AddHeader("Content-Length", std::to_string(response_string.size()));
  http_response->AddResponse(response_string);
  http_server_->SendReply(_request, 200, http_response);
  delete _request;
  LOG(INFO) << "Returned stream managers registration summary response";
}
예제 #2
0
String Color::SerializeToCodeString() const
{
    return "Color(" + SerializeToString() + ")";
}
예제 #3
0
파일: Quat.cpp 프로젝트: Garfield-Chen/tng
std::string Quat::SerializeToCodeString() const
{
	return "Quat(" + SerializeToString() + ")";
}