// ObSeqSSTableScanner stored pointer of ObScanParam but not param's value // this usage maybe a problem when user free %param before call next_cell // TODO: ObSeqSSTableScanner need store %param for itself. int ObSeqSSTableScanner::set_scan_param( const common::ObScanParam& param, ObBlockCache& block_cache, ObBlockIndexCache& block_index_cache, bool not_exit_col_ret_nop) { int ret = OB_SUCCESS; if (NULL == param.get_range() || param.get_range()->empty()) { TBSYS_LOG(ERROR, "input scan param range is empty, cannot scan."); ret = OB_INVALID_ARGUMENT; } else { if (TBSYS_LOGGER._level >= TBSYS_LOG_LEVEL_DEBUG) { char range_buf[OB_RANGE_STR_BUFSIZ]; param.get_range()->to_string(range_buf, OB_RANGE_STR_BUFSIZ); TBSYS_LOG(DEBUG, "scan input param range, range=%s", range_buf); } block_cache_ = &block_cache; block_index_cache_ = &block_index_cache; scan_param_ = ¶m; cur_iter_idx_ = 0; cur_iter_status_ = NOT_START; sstable_array_.clear(); not_exit_col_ret_nop_ = not_exit_col_ret_nop; } return ret; }
int ObChunkServerMergerProxy::cs_scan(const common::ObScanParam & scan_param, mergeserver::ObMergerTabletLocation & addr, common::ObScanner & scanner, common::ObIterator * &it_out) { int ret = OB_SUCCESS; ObCellInfo cell_ext; UNUSED(addr); it_out = NULL; cell_array_.clear(); if ((ret = cs_reader_.scan(scan_param)) != OB_SUCCESS) { TBSYS_LOG(DEBUG,"scan chunkserver failed"); } else { it_out = &cs_reader_; } if (OB_SUCCESS == ret) { cell_ext.column_id_ = 2; //meaninglessness,just to suppress the scanner warn log cell_ext.table_id_ = scan_param.get_table_id(); cell_ext.row_key_ = scan_param.get_range()->end_key_; scanner.clear(); scanner.set_range(*scan_param.get_range()); //data version scanner.set_data_version(scan_param.get_version_range().start_version_); scanner.set_is_req_fullfilled(true,1); if ( (ret = scanner.add_cell(cell_ext)) != OB_SUCCESS) { TBSYS_LOG(DEBUG,"add cell failed(%d)",ret); } } TBSYS_LOG(DEBUG," merger proxy ret [%d]",ret); return ret; }