int ObMergerScannerEncoder::encode(const ObGetParam & get_param, const ObScanner & org_scanner,
    ObScanner & encoded_scanner)
{
  int ret = OB_SUCCESS;
  ObCellInfo * cur_cell = NULL;
  ObCellInfo * encode_cell = NULL;
  int64_t cell_index = 0;
  ObScanner & input = const_cast<ObScanner &> (org_scanner);
  while (OB_SUCCESS == (ret = input.next_cell()))
  {
    ret = input.get_cell(&cur_cell);
    if (ret != OB_SUCCESS)
    {
      TBSYS_LOG(WARN, "get cell from org scanner failed:ret[%d]", ret);
      break;
    }
    // output(*cur_cell);
    encode_cell = get_param[cell_index];
    if (NULL == encode_cell)
    {
      ret = OB_ERROR;
      TBSYS_LOG(WARN, "check encode cell failed:index[%ld]", cell_index);
      break;
    }
    encode_cell->value_ = cur_cell->value_;
    ret = encoded_scanner.add_cell(*encode_cell);
    if (ret != OB_SUCCESS)
    {
      TBSYS_LOG(WARN, "add cell to encoded scanner failed:ret[%d]", ret);
      break;
    }
    ++cell_index;
  }
  // double check size
  if (cell_index != get_param.get_cell_size())
  {
    ret = OB_ERROR;
    TBSYS_LOG(WARN, "check result scanner cell count not equal get param cell size:"
        "count[%ld], size[%ld]", cell_index, get_param.get_cell_size());
  }
  input.reset_iter();
  // fill all data succ
  if (OB_ITER_END == ret)
  {
    ret = OB_SUCCESS;
  }
  return ret;
}
Example #2
0
int ObFinalResult::get(const ObGetParam &get_param, ObScanner &scanner,bool ret_null)
{
  int err = OB_SUCCESS;
  ObRowInfo row_info;
  ObCellInfo cur_cell;
  map<ObRowInfo, vector<ObCellInfo> >::iterator target;
  bool prev_row_not_exist = false;
  for (int64_t get_idx = 0 ; OB_SUCCESS == err && get_idx < get_param.get_cell_size(); get_idx ++)
  {
    row_info.table_name_ = get_param[get_idx]->table_name_;
    row_info.row_key_ = get_param[get_idx]->row_key_;
    cur_cell = *(get_param[get_idx]);
    target = row_infos_->lower_bound(row_info);
    if (get_idx > 0 
        && prev_row_not_exist 
        && get_param[get_idx]->table_name_ == get_param[get_idx-1]->table_name_
        && get_param[get_idx]->row_key_ == get_param[get_idx-1]->row_key_
       )
    {
      continue;
    }
    if (row_infos_->end() ==  target 
        || row_info < target->first  
        || target->second.size() == 0)
    {
      prev_row_not_exist = true;
      cur_cell.value_.set_ext(ObActionFlag::OP_ROW_DOES_NOT_EXIST);
    }
    else
    {
      prev_row_not_exist = false;
      vector<ObCellInfo>::iterator beg = target->second.begin();
      for (;beg != target->second.end(); beg ++)
      {
        if (beg->column_name_ == cur_cell.column_name_)
        {
          cur_cell = *beg;
          break;
        }
      }
      if (target->second.end() == beg)
      {
        if (ret_null)
        {
          cur_cell.value_.set_null();
        }
        else
        {
          cur_cell.value_.set_ext(ObActionFlag::OP_NOP);
        }
      }
    }
    cur_cell.table_id_ = OB_INVALID_ID;
    cur_cell.column_id_ = OB_INVALID_ID;
    err = scanner.add_cell(cur_cell);
  }
  return err;
}
    int ObTransferSSTableQuery::get(const ObGetParam& get_param, 
                                    ObSSTableReader& reader,
                                    ObIterator* iterator)
    {
      int ret                         = OB_SUCCESS;
      int64_t cell_size               = get_param.get_cell_size();
      int64_t row_size                = get_param.get_row_size();
      ObSSTableGetter* sstable_getter = dynamic_cast<ObSSTableGetter*>(iterator);
      const ObGetParam::ObRowIndex* row_index = get_param.get_row_index();
      static __thread const ObSSTableReader* sstable_reader = NULL;

      if (!inited_)
      {
        TBSYS_LOG(WARN, "transfer sstable query has not inited");
        ret = OB_ERROR;
      }
      else if (cell_size <= 0 || NULL == row_index || row_size <= 0
               || row_size > OB_MAX_GET_ROW_NUMBER)
      {
        TBSYS_LOG(WARN, "invalid get param, cell_size=%ld, row_index=%p, row_size=%ld",
                  cell_size, row_index, row_size);
        ret = OB_INVALID_ARGUMENT;
      }
      else if (NULL == sstable_getter)
      {
        TBSYS_LOG(WARN, "get thread local instance of sstable getter failed");
        ret = OB_ERROR;
      }

      if (OB_SUCCESS == ret)
      {
        if (!reader.empty())
        {
          sstable_reader = &reader;
        }
        else
        {
          sstable_reader = NULL;
        }

        ret = sstable_getter->init(block_cache_, block_index_cache_, 
                                   get_param, &sstable_reader, 1, true,
                                   sstable_row_cache_);
        if (OB_SUCCESS != ret)
        {
          TBSYS_LOG(WARN, "failed to init sstable getter, ret=%d", ret);
        }
        else
        {
          // do nothing
        }
      }

      return ret;
    }
 int get_ups_param(ObGetParam & param, const ObScanner & cs_result)
 {
   int err = OB_SUCCESS;
   ObReadParam &read_param = param;
   err =  get_ups_read_param(read_param,cs_result); 
   if (OB_SUCCESS == err)
   {
     bool is_fullfilled = false;
     int64_t fullfilled_cell_num  = 0;
     err = cs_result.get_is_req_fullfilled(is_fullfilled, fullfilled_cell_num);
     if (OB_SUCCESS == err && fullfilled_cell_num < param.get_cell_size())
     {
       err = param.rollback(param.get_cell_size() - fullfilled_cell_num);
       if ((err != OB_SUCCESS) || (param.get_cell_size() != fullfilled_cell_num))
       {
         TBSYS_LOG(WARN, "check param rollback failed:full_fill[%ld], param_size[%ld]",
             fullfilled_cell_num, param.get_cell_size());
       }
     }
   }
   return err;
 }
Example #5
0
    int ObServerRpc::get(const ObServer& remote_server,
                         const ObGetParam& get_param, 
                         ObScanner& scanner,
                         const int64_t timeout)
    {
      int ret     = OB_SUCCESS;
      int64_t pos = 0;
      ObResultCode result_code;
      ObDataBuffer data_buff;

      if (remote_server.get_ipv4() == 0 || remote_server.get_port() == 0
          || timeout <= 0)
      {
        TBSYS_LOG(WARN, "invalid param, ip=%d, port=%d, timeout=%ld",
                  remote_server.get_ipv4(), remote_server.get_port(),
                  timeout);
        ret = OB_ERROR;
      }
      else if (get_param.get_cell_size() <= 0 || get_param.get_row_size() <= 0)
      {
        TBSYS_LOG(WARN, "invalid param, cell_size=%ld, row_size=%ld", 
                  get_param.get_cell_size(), get_param.get_row_size());
        ret = OB_ERROR;
      }
      else if (NULL == rpc_frame_)
      {
        TBSYS_LOG(WARN, "server rpc doesn't init.");
        ret = OB_ERROR;
      }

      if (OB_SUCCESS == ret)
      {
        ret = get_frame_buffer(data_buff);
        if (OB_SUCCESS != ret)
        {
          TBSYS_LOG(WARN, "get frame buffer failed, ret=%d.", ret);
        }
      }
      
      // step 1. serialize get param to data_buff
      if (OB_SUCCESS == ret)
      {
        ret = get_param.serialize(data_buff.get_data(), 
                                  data_buff.get_capacity(), 
                                  data_buff.get_position());
        if (OB_SUCCESS != ret)
        {
          TBSYS_LOG(WARN, "serialize get_param failed, ret=%d.", ret);
        }
      }
    
      // step 2. send request for get
      if (OB_SUCCESS == ret)
      {
        ret = rpc_frame_->send_request(remote_server, 
                                       OB_GET_REQUEST, DEFAULT_VERSION, 
                                       timeout, data_buff);
        if (OB_SUCCESS != ret)
        {
          TBSYS_LOG(WARN, "send request to remote server for get failed, "
                          "ret=%d.", ret);
        }
      }
    
      // step 3. deserialize the response code
      if (OB_SUCCESS == ret)
      {
        ret = result_code.deserialize(data_buff.get_data(), 
                                      data_buff.get_position(), pos);
        if (OB_SUCCESS != ret)
        {
          TBSYS_LOG(WARN, "deserialize result_code failed,pos=%ld, ret=%d.", 
                    pos, ret);
        }
        else
        {
          ret = result_code.result_code_;
          if (OB_SUCCESS != ret && OB_DATA_NOT_SERVE != ret)
          {
            TBSYS_LOG(WARN, "get response from remote server failed, "
                            "timeout=%ld, ret=%d.", timeout, ret);
          }
        }
      }

      // step 4. deserialize the scanner
      if (OB_SUCCESS == ret)
      {
        ret = scanner.deserialize(data_buff.get_data(), 
                                  data_buff.get_position(), pos);
        if (OB_SUCCESS != ret)
        {
          TBSYS_LOG(WARN, "deserialize scanner from buff failed, "
                          "pos=%ld, ret=%d.", pos, ret);
        }
      }
    
      return ret;
    }
Example #6
0
int MutatorBuilder::build_get_param(ObGetParam &get_param, PageArena<char> &allocer,
                                    const int64_t table_start_version, const bool using_id,
                                    const int64_t row_num, const int64_t cell_num_per_row)
{
  int ret = OB_SUCCESS;
  get_param.reset();
  UNUSED(table_start_version);

  static int64_t row_info_array[OB_MAX_TABLE_NUMBER];
  static int64_t suffix_num_array[OB_MAX_TABLE_NUMBER];
  static int64_t counter = 0;
  static const int64_t ROW_INFO_CACHE_FLUSH_PERIOD = 100;
  //static const int64_t ROW_INFO_CACHE_FLUSH_PERIOD = 1000000000;
  if (0 == (counter++ % ROW_INFO_CACHE_FLUSH_PERIOD))
  {
    memset(row_info_array, 0, sizeof(row_info_array));
    memset(suffix_num_array, 0, sizeof(suffix_num_array));
  }
  for (int64_t i = 0; i < row_num; i++)
  {
    int64_t rand = 0;
    lrand48_r(&table_rand_seed_, &rand);
    int64_t table_pos = range_rand(0, table_num_ - 1, rand);
    const ObSchema &cur_schema = schema_mgr_.begin()[table_pos];

    if (0 == row_info_array[table_pos]
        && 0 == (row_info_array[table_pos] = get_cur_rowkey_info_(cur_schema, using_id, rb_array_[table_pos]->get_prefix_start())))
    {
      assert(OB_SUCCESS == ret);
      ret = OB_ERROR;
      break;
    }
    if (0 == suffix_num_array[table_pos]
        && 0 == (suffix_num_array[table_pos] = get_suffix_num_(cur_schema, using_id, rb_array_[table_pos]->get_prefix_start())))
    {
      assert(OB_SUCCESS == ret);
      ret = OB_ERROR;
      break;
    }
    ObCellInfo ci;
    ci.row_key_ = rb_array_[table_pos]->get_random_rowkey(row_info_array[table_pos], suffix_num_array[table_pos], allocer);
    if (using_id)
    {
      ci.table_id_ = cur_schema.get_table_id();
    }
    else
    {
      ci.table_name_.assign_ptr(const_cast<char*>(cur_schema.get_table_name()), static_cast<int32_t>(strlen(cur_schema.get_table_name())));
    }
    if (using_id)
    {
      ci.column_id_ = SEED_COLUMN_ID;
      ci.column_name_.assign_ptr(NULL, 0);
    }
    else
    {
      ci.column_id_ = OB_INVALID_ID;
      ci.column_name_.assign_ptr((char*)SEED_COLUMN_NAME, static_cast<int32_t>(strlen(SEED_COLUMN_NAME)));
    }
    get_param.add_cell(ci);
    if (using_id)
    {
      ci.column_id_ = CELL_NUM_COLUMN_ID;
      ci.column_name_.assign_ptr(NULL, 0);
    }
    else
    {
      ci.column_id_ = OB_INVALID_ID;
      ci.column_name_.assign_ptr((char*)CELL_NUM_COLUMN_NAME, static_cast<int32_t>(strlen(CELL_NUM_COLUMN_NAME)));
    }
    get_param.add_cell(ci);

    lrand48_r(&table_rand_seed_, &rand);
    int64_t cell_num = range_rand(1, cell_num_per_row, rand);
    int64_t column_num = cur_schema.column_end() - cur_schema.column_begin();
    for (int64_t j = 0; j < cell_num; j++)
    {
      lrand48_r(&table_rand_seed_, &rand);
      int64_t column_pos = range_rand(0, column_num - 1, rand);
      //int64_t column_pos = 0;
      const ObColumnSchema &column_schema = cur_schema.column_begin()[column_pos];
      if (using_id)
      {
        ci.column_id_ = column_schema.get_id();
        ci.column_name_.assign_ptr(NULL, 0);
      }
      else
      {
        ci.column_id_ = OB_INVALID_ID;
        ci.column_name_.assign_ptr(const_cast<char*>(column_schema.get_name()), static_cast<int32_t>(strlen(column_schema.get_name()))); 
      }
      get_param.add_cell(ci);
    }
  }
  ObVersionRange version_range;
  version_range.start_version_ = table_start_version_;
  version_range.border_flag_.set_max_value();
  version_range.border_flag_.set_inclusive_start();
  get_param.set_version_range(version_range);
  char* is_read_consistency_cfg = getenv("is_read_consistency");
  bool is_read_consistency = (NULL != is_read_consistency_cfg && 0 == strcmp(is_read_consistency_cfg, "true"));
  get_param.set_is_read_consistency(is_read_consistency);

  assert(get_param.get_cell_size() > 0);
  return ret;
}
Example #7
0
int ObGetRequestEvent::setup_new_request(const bool retry, const ObGetParam & get_param)
{
  int ret = OB_SUCCESS;
  ObMergerRpcEvent * event = NULL;
  // step 1. create new rpc event and add to the waiting queue
  if (false == check_inner_stat())
  {
    ret = OB_INNER_STAT_ERROR;
    TBSYS_LOG(WARN, "check inner stat failed");
  }
  else
  {
    ret = ObMergerRequestEvent::create(&event);
    if (ret != OB_SUCCESS)
    {
      TBSYS_LOG(ERROR, "add new rpc event failed:request[%lu], ret[%d]", get_request_id(), ret);
    }
  }
  
  // TODO check retry with other cs
  UNUSED(retry);
  ObMergerTabletLocationList list;
  // step 3. select the right cs for request
  if ((OB_SUCCESS == ret)) // && (false == retry))
  {
    ret = get_cache_proxy()->get_tablet_location(get_param[0]->table_id_, get_param[0]->row_key_, list);
    if (ret != OB_SUCCESS)
    {
      TBSYS_LOG(WARN, "get tablet location failed:client[%lu], event[%lu], request[%lu], ret[%d]",
          event->get_client_id(), event->get_event_id(), get_request_id(), ret);
    }
  }
  
  // step 4. send reqeust for get
  if (OB_SUCCESS == ret)
  {
    // TODO access list[0]
    event->set_server(list[0].server_.chunkserver_);
    ret = get_rpc()->get(get_timeout(), list[0].server_.chunkserver_, get_param, *event);
    if (ret != OB_SUCCESS)
    {
      TBSYS_LOG(ERROR, "check async rpc stub failed:client[%lu], event[%lu], request[%lu], ret[%d]",
        event->get_client_id(), event->get_event_id(), get_request_id(), ret);
    }
    else
    {
      TBSYS_LOG(DEBUG, "send get param to server succ:client[%lu], event[%lu], request[%lu], "
          "get_cell[%ld]", event->get_client_id(), event->get_event_id(), get_request_id(),
          get_param.get_cell_size());
    }
  }
  
  /// if not send succ
  if ((event != NULL) && (ret != OB_SUCCESS))
  {
    uint64_t client_id = event->get_client_id();
    uint64_t event_id = event->get_event_id();
    int err = ObMergerRequestEvent::destroy(event);
    if (err != OB_SUCCESS)
    {
      TBSYS_LOG(ERROR, "destroy the event failed when rpc send failed:client[%lu], event[%lu], "
          "request[%lu], ret[%d], err[%d]", client_id, event_id, get_request_id(), ret, err);
    }
    else
    {
      TBSYS_LOG(INFO, "destroy directly succ:client[%lu], event[%lu], request[%lu], ret[%d]",
          client_id, event_id, get_request_id(), ret);
    }
  }
  return ret;
}
Example #8
0
bool check_result(const ObGetParam &get_param,  ObScanner &ob_scanner, 
                  ObFinalResult & local_result)
{
  int err = OB_SUCCESS;
  bool res = true;
  ObScanner local_scanner;
  ObCellInfo *ob_cell = NULL;
  ObCellInfo *local_cell = NULL;
  err = local_result.get(get_param,local_scanner);
  if (OB_SUCCESS != err)
  {
    TBSYS_LOG(WARN,"fail to get local result");
  }
  for (int64_t get_idx = 0; 
      get_idx < get_param.get_cell_size() && OB_SUCCESS == err;
      get_idx ++)
  {
    int ob_err = ob_scanner.next_cell();
    int local_err = local_scanner.next_cell(); 
    if (OB_ITER_END == ob_err && OB_ITER_END == local_err)
    {
      err = OB_SUCCESS;
      break;
    }
    if (OB_SUCCESS != ob_err)
    {
      err = ob_err;
      TBSYS_LOG(WARN,"ob next cell err");
      break;
    }
    if (OB_SUCCESS != local_err)
    {
      err = local_err;
      TBSYS_LOG(WARN,"local next cell err");
      break;
    }

    if (OB_SUCCESS == err)
    {
      err = ob_scanner.get_cell(&ob_cell);
    }
    if (OB_SUCCESS != err)
    {
      TBSYS_LOG(WARN,"fail to get cell from ob result [idx:%lld]", get_idx);
    }
    if (OB_SUCCESS == err)
    {
      if (OB_SUCCESS == err)
      {
        err = local_scanner.get_cell(&local_cell);
      }
      if (OB_SUCCESS != err)
      {
        TBSYS_LOG(WARN,"fail to get cell from local result [idx:%lld]", get_idx);
      }
    }
    if (OB_SUCCESS == err)
    {
      /*
      /// check ob result
      if (ob_cell->table_name_ != get_param[get_idx]->table_name_)
      {
        TBSYS_LOG(WARN,"ob result table name error [idx:%lld,ob.table_name_:%.*s,"
                  "param.table_name_:%.*s]", get_idx,ob_cell->table_name_.length(),
                  ob_cell->table_name_.ptr(), get_param[get_idx]->table_name_.length(), 
                  get_param[get_idx]->table_name_.ptr());
        err = OB_INVALID_ARGUMENT;
      }
      if (ob_cell->row_key_ != get_param[get_idx]->row_key_)
      {
        TBSYS_LOG(WARN,"ob result rowkey error [idx:%lld,ob.row_key_:%.*s,"
                  "param.row_key_:%.*s]", get_idx,ob_cell->row_key_.length(),
                  ob_cell->row_key_.ptr(), get_param[get_idx]->row_key_.length(), 
                  get_param[get_idx]->row_key_.ptr());
        err = OB_INVALID_ARGUMENT;
      }
      if (ob_cell->column_name_ != get_param[get_idx]->column_name_)
      {
        TBSYS_LOG(WARN,"ob result column name error [idx:%lld,ob.column_name_:%.*s,"
                  "param.column_name_:%.*s]", get_idx,ob_cell->column_name_.length(),
                  ob_cell->column_name_.ptr(), get_param[get_idx]->column_name_.length(), 
                  get_param[get_idx]->column_name_.ptr());
        err = OB_INVALID_ARGUMENT;
      } 

      /// check local result
      if (local_cell->table_name_ != get_param[get_idx]->table_name_)
      {
        TBSYS_LOG(WARN,"local result table name error [idx:%lld,ob.table_name_:%.*s,"
                  "param.table_name_:%.*s]", get_idx,local_cell->table_name_.length(),
                  local_cell->table_name_.ptr(), get_param[get_idx]->table_name_.length(), 
                  get_param[get_idx]->table_name_.ptr());
        err = OB_INVALID_ARGUMENT;
      }
      if (local_cell->row_key_ != get_param[get_idx]->row_key_)
      {
        TBSYS_LOG(WARN,"local result rowkey error [idx:%lld,local.row_key_:%.*s,"
                  "param.row_key_:%.*s]", get_idx,local_cell->row_key_.length(),
                  local_cell->row_key_.ptr(), get_param[get_idx]->row_key_.length(), 
                  get_param[get_idx]->row_key_.ptr());
        err = OB_INVALID_ARGUMENT;
      }
      if (local_cell->column_name_ != get_param[get_idx]->column_name_)
      {
        TBSYS_LOG(WARN,"local result column_name error [idx:%lld,local.column_name_:%.*s,"
                  "param.column_name_:%.*s]", get_idx,local_cell->column_name_.length(),
                  local_cell->column_name_.ptr(), get_param[get_idx]->column_name_.length(), 
                  get_param[get_idx]->column_name_.ptr());
        err = OB_INVALID_ARGUMENT;
      }
      */ 
      TBSYS_LOG(DEBUG, "ob.table_name:%.*s,ob.rowkey:%.*s,ob.column_name:%.*s",
                ob_cell->table_name_.length(),ob_cell->table_name_.ptr(),  
                ob_cell->row_key_.length(),ob_cell->row_key_.ptr(),  
                ob_cell->column_name_.length(),ob_cell->column_name_.ptr()
               );
      TBSYS_LOG(DEBUG, "local.table_name:%.*s,local.rowkey:%.*s,local.column_name:%.*s",
                local_cell->table_name_.length(),local_cell->table_name_.ptr(),  
                local_cell->row_key_.length(),local_cell->row_key_.ptr(),  
                local_cell->column_name_.length(),local_cell->column_name_.ptr()
               );
      if (local_cell->table_name_ != ob_cell->table_name_)
      {
        TBSYS_LOG(WARN,"table name not coincident [idx:%lld,ob.table_name_:%.*s,"
                  "local.table_name_:%.*s]", get_idx,ob_cell->table_name_.length(),
                  ob_cell->table_name_.ptr(), local_cell->table_name_.length(), 
                  local_cell->table_name_.ptr());
        err = OB_INVALID_ARGUMENT;
      }
      if (local_cell->row_key_ != ob_cell->row_key_)
      {
        TBSYS_LOG(WARN,"rowkey not coincident [idx:%lld,ob.row_key_:%.*s,"
                  "local.row_key_:%.*s]", get_idx,ob_cell->row_key_.length(),
                  ob_cell->row_key_.ptr(), local_cell->row_key_.length(), 
                  local_cell->row_key_.ptr());
        err = OB_INVALID_ARGUMENT;
      }
      if (local_cell->column_name_ != ob_cell->column_name_)
      {
        TBSYS_LOG(WARN,"column name not coincident [idx:%lld,ob.column_name_:%.*s,"
                  "local.column_name_:%.*s]", get_idx,ob_cell->column_name_.length(),
                  ob_cell->column_name_.ptr(), local_cell->column_name_.length(), 
                  local_cell->column_name_.ptr());
        err = OB_INVALID_ARGUMENT;
      }

      if (OB_SUCCESS == err)
      {
        if (ob_cell->value_.get_ext() != local_cell->value_.get_ext())
        {
          TBSYS_LOG(WARN,"ext info not coincident [idx:%lld,ob.ext:%lld,local.ext:%lld]",
                    get_idx, ob_cell->value_.get_ext(), local_cell->value_.get_ext());
          err = OB_INVALID_ARGUMENT;
        }
        if (OB_SUCCESS == err && ObExtendType != ob_cell->value_.get_type())
        {
          int64_t ob_value;
          int64_t local_value;
          if (ob_cell->value_.get_ext() != local_cell->value_.get_ext())
          {
            TBSYS_LOG(WARN,"ext not coincident [idx:%lld,ob.ext:%lld,"
                      "local.ext:%lld]",get_idx, ob_cell->value_.get_ext(), 
                      local_cell->value_.get_ext());
            err = OB_INVALID_ARGUMENT;
          }
          if (ob_cell->value_.get_ext() == 0  && OB_SUCCESS == err)
          {
            if (ob_cell->value_.get_type() == ObNullType 
                && ob_cell->value_.get_type() == local_cell->value_.get_type())
            {
              /// check pass
            }
            else
            {
              if (OB_SUCCESS == err)
              {
                err = local_cell->value_.get_int(local_value);
                if (OB_SUCCESS != err)
                {
                  TBSYS_LOG(WARN,"fail to get int from local, ext:%lld,type:%d", 
                            local_cell->value_.get_ext(),local_cell->value_.get_type());
                }
                else
                {
                  TBSYS_LOG(DEBUG, "local value:%lld", local_value);
                }
              }
              if (OB_SUCCESS == err)
              {
                err = ob_cell->value_.get_int(ob_value);
                if (OB_SUCCESS != err)
                {
                  TBSYS_LOG(WARN,"fail to get int from ob, ext:%lld,type:%d", 
                            ob_cell->value_.get_ext(),ob_cell->value_.get_type());
                }
                else
                {
                  TBSYS_LOG(DEBUG, "ob value:%lld", ob_value);
                }
              }

              if (OB_SUCCESS != err)
              {
                TBSYS_LOG(WARN,"fail to get int value [idx:%lld]", get_idx);
                err = OB_INVALID_ARGUMENT;
              }
              else
              {
                if (ob_value != local_value)
                {
                  TBSYS_LOG(WARN,"value not coincident [idx:%lld,ob.value:%lld,"
                            "local.value:%lld]",get_idx, ob_value, local_value);
                  err = OB_INVALID_ARGUMENT;
                }
              }
            }
          }
        }
      }
    }
  } 

  if (OB_SUCCESS == err && ob_scanner.next_cell() != OB_ITER_END)
  {
    TBSYS_LOG(WARN,"ob return more result than expected");
  }

  if (OB_SUCCESS == err && local_scanner.next_cell() != OB_ITER_END)
  {
    TBSYS_LOG(WARN,"local return more result than expected");
  }

  if (OB_SUCCESS != err)
  {
    res = false;
    TBSYS_LOG(DEBUG, "check fail");
  }
  else
  {
    res = true;
    TBSYS_LOG(DEBUG, "check pass");
  }
  return res;
}
int ObFakeSqlUpsRpcProxy2::sql_ups_get(const ObGetParam & get_param, ObNewScanner & new_scanner, const int64_t timeout)
{
    UNUSED(timeout);

    int ret = OB_SUCCESS;
    ObUpsRow ups_row;
    ObRowDesc row_desc;

    new_scanner.clear();

    if( 0 == column_count_ )
    {
        ret = OB_INVALID_ARGUMENT;
    }

    for(int i=1; OB_SUCCESS == ret && i<=column_count_; i++)
    {
        if(OB_SUCCESS != (ret = row_desc.add_column_desc(TABLE_ID, i)))
        {
            TBSYS_LOG(WARN, "add column desc fail:ret[%d]", ret);
        }
    }
    if(OB_SUCCESS == ret)
    {
        ups_row.set_row_desc(row_desc);
    }

    if(OB_SUCCESS == ret)
    {
        if(get_param.get_cell_size() / column_count_ > MAX_ROW_COUNT)
        {
            if(OB_SUCCESS != (ret = new_scanner.set_is_req_fullfilled(false, MAX_ROW_COUNT)))
            {
                TBSYS_LOG(WARN, "set is req fullfilled fail:ret[%d]", ret);
            }
        }
        else
        {
            if(OB_SUCCESS != (ret = new_scanner.set_is_req_fullfilled(true, get_param.get_row_size())))
            {
                TBSYS_LOG(WARN, "set is req fullfilled fail:ret[%d]", ret);
            }
        }
    }

    int64_t row_count = 0;
    for(int64_t i=0; OB_SUCCESS == ret && i<get_param.get_cell_size(); i+=column_count_)
    {
        if( row_count >= MAX_ROW_COUNT )
        {
            break;
        }

        ObRowkey rowkey;

        for(int64_t j=0; OB_SUCCESS == ret && j<column_count_; j++)
        {
            ObCellInfo *cell = get_param[i + j];
            rowkey = cell->row_key_;
            if(OB_SUCCESS != (ret = ups_row.raw_set_cell(j, cell->value_)))
            {
                TBSYS_LOG(WARN, "set cell fail:ret[%d]", ret);
            }
        }

        if(OB_SUCCESS == ret)
        {
            row_count ++;
            if(OB_SUCCESS != (ret = new_scanner.add_row(rowkey, ups_row)))
            {
                TBSYS_LOG(WARN, "add row fail:ret[%d]", ret);
            }
        }
    }
    return ret;
}