Ejemplo n.º 1
0
int ObRootServerRpcStub::get_frame_buffer(common::ObDataBuffer & data_buffer) const
{
  int ret = OB_SUCCESS;
  if (!check_inner_stat())
  {
    TBSYS_LOG(ERROR, "check inner stat failed.");
    ret = OB_ERROR;
  }

  common::ThreadSpecificBuffer::Buffer* rpc_buffer = get_thread_buffer();
  if (OB_SUCCESS == ret)
  {
    if (NULL == rpc_buffer)
    {
      TBSYS_LOG(ERROR, "get thread rpc buff failed:buffer[%p].", rpc_buffer);
      ret = OB_ERROR;
    }
    else
    {
      rpc_buffer->reset();
      data_buffer.set_data(rpc_buffer->current(), rpc_buffer->remain());
    }
  }
  return ret;
}
Ejemplo n.º 2
0
int ObMonitor::get_rpc_buffer(common::ObDataBuffer &data_buffer)const                        
{ 
  int err = OB_SUCCESS;
  common::ThreadSpecificBuffer::Buffer* rpc_buffer = rpc_buffer_.get_buffer();            
  if(NULL == rpc_buffer)
  { 
    TBSYS_LOG(ERROR, "get thread rpc buff fail.buffer[%p]", rpc_buffer);                  
    err = OB_INNER_STAT_ERROR;                                                            
  }                                                                                       
  else
  { 
    rpc_buffer->reset();                                                                  
    data_buffer.set_data(rpc_buffer->current(), rpc_buffer->remain());                    
  }                                                                                       
  return err;                                                                             
}
Ejemplo n.º 3
0
int ObRootRpcStub::get_thread_buffer_(common::ObDataBuffer& data_buffer)
{
  int ret = OB_SUCCESS;
  if (NULL == thread_buffer_)
  {
    TBSYS_LOG(ERROR, "thread_buffer_ = NULL");
    ret = OB_ERROR;
  }
  else
  {
    common::ThreadSpecificBuffer::Buffer* buff = thread_buffer_->get_buffer();
    if (NULL == buff)
    {
      TBSYS_LOG(ERROR, "thread_buffer_ = NULL");
      ret = OB_ERROR;
    }
    else
    {
      buff->reset();
      data_buffer.set_data(buff->current(), buff->remain());
    }
  }
  return ret;
}