当前位置: 首页>>代码示例>>C++>>正文


C++ ObScanner::reset_row_iter方法代码示例

本文整理汇总了C++中ObScanner::reset_row_iter方法的典型用法代码示例。如果您正苦于以下问题:C++ ObScanner::reset_row_iter方法的具体用法?C++ ObScanner::reset_row_iter怎么用?C++ ObScanner::reset_row_iter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObScanner的用法示例。


在下文中一共展示了ObScanner::reset_row_iter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

int ObMetaTable3::MyIterator::scan_beginning(ConstIterator &meta_it, const KeyRange &search_range, ObScanner& scanner)
{
  int ret = OB_SUCCESS;
  scanner.reset();
  ObString null_string;
  ObScanParam *scan_param = aggr_.scan_param_allocator_.alloc();
  ObScanner *my_location = aggr_.scanner_allocator_.alloc();
  if (NULL == scan_param)
  {
    TBSYS_LOG(ERROR, "failed to alloc scan param");
    ret = OB_ALLOCATE_MEMORY_FAILED;
  }
  else if (NULL == my_location)
  {
    TBSYS_LOG(ERROR, "failed to alloc scanner");
    ret = OB_ALLOCATE_MEMORY_FAILED;
  }
  else
  {
    scan_param->reset();
    my_location->reset();
    scan_param->set(my_tid_, null_string, search_range);
    if (OB_SUCCESS != (ret = scan_param->set_limit_info(0, SCAN_LIMIT_COUNT)))
    {
      TBSYS_LOG(WARN, "failed to set limit info, err=%d", ret);
    }
    // scan all columns
    else if (OB_SUCCESS != (ret = add_scan_columns(*scan_param)))
    {
      TBSYS_LOG(WARN, "failed to add scan columsn, err=%d", ret);
    }
    // find the locations of the tablet which the startkey is in
    else if (OB_SUCCESS != (ret = get_location(meta_it, search_range.start_key_,
                                               search_range.border_flag_.inclusive_start(), *my_location)))
    {
      TBSYS_LOG(WARN, "failed to get location, err=%d", ret);
    }
    else if (OB_SUCCESS != (ret = scan_param->set_location_info(*my_location)))
    {
      TBSYS_LOG(WARN, "failed to add location, err=%d", ret);
    }
    else if (OB_SUCCESS != (ret = aggr_.scan(*scan_param, scanner)))
    {
      TBSYS_LOG(WARN, "scan error, err=%d range=%s", ret, to_cstring(search_range));
    }
    else
    {
      scanner.reset_row_iter();
      read_scanner_row_count_ = 0;
      TBSYS_LOG(DEBUG, "scan meta table succ, range=%s", to_cstring(search_range));
    }
  }
  if (NULL != scan_param)
  {
    aggr_.scan_param_allocator_.free(scan_param);
  }
  if (NULL != my_location)
  {
    aggr_.scanner_allocator_.free(my_location);
  }
  return ret;
}
开发者ID:Alibaba-boonya,项目名称:oceanbase,代码行数:62,代码来源:ob_meta_table3.cpp


注:本文中的ObScanner::reset_row_iter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。