void BingoPgIndex::readConfigParameters(BingoPgConfig& bingo_config) { /* * Read configuration page */ BingoPgBuffer config_buffer(_index, BINGO_CONFIG_PAGE, BINGO_PG_READ); /* * Deserialize binary stored parameters */ int data_len; void* data = config_buffer.getIndexData(data_len); bingo_config.deserialize(data, data_len); }
RingoPgSearchEngine::RingoPgSearchEngine(BingoPgConfig& bingo_config, const char* rel_name): BingoPgSearchEngine(), _searchType(-1) { _setBingoContext(); // bingoSetErrorHandler(_errorHandler, 0); /* * Set up bingo configuration */ bingo_config.setUpBingoConfiguration(); bingoTautomerRulesReady(0,0,0); bingoIndexBegin(); _relName.readString(rel_name, true); _shadowRelName.readString(rel_name, true); _shadowRelName.appendString("_shadow", true); }
RingoPgBuildEngine::RingoPgBuildEngine(BingoPgConfig& bingo_config, const char* rel_name): BingoPgBuildEngine(), _searchType(-1) { _setBingoContext(); // bingoSetErrorHandler(_errorHandler, 0); /* * Set up bingo configuration */ bingo_config.setUpBingoConfiguration(); bingoTautomerRulesReady(0,0,0); bingoIndexBegin(); _relName.readString(rel_name, true); _shadowRelName.readString(rel_name, true); _shadowRelName.appendString("_shadow", true); elog(DEBUG1, "bingo: ringo build: start building '%s'", _relName.ptr()); }
void BingoPgIndex::_initializeMetaPages(BingoPgConfig& bingo_config) { /* * Initialize meta buffer */ _metaBuffer.writeNewBuffer(_index, BINGO_METAPAGE); _metaBuffer.formIndexTuple(&_metaInfo, sizeof (_metaInfo)); _metaBuffer.changeAccess(BINGO_PG_NOLOCK); ++_metaInfo.n_pages; /* * Initialize config buffer */ indigo::Array<char> config_data; bingo_config.serialize(config_data); BingoPgBuffer config_buffer; config_buffer.writeNewBuffer(_index, BINGO_CONFIG_PAGE); config_buffer.formIndexTuple(config_data.ptr(), config_data.sizeInBytes()); config_buffer.clear(); ++_metaInfo.n_pages; /* * Write section mapping buffers * Fulfil by max size */ for (int block_idx = 0; block_idx < BINGO_SECTION_OFFSET_BLOCKS_NUM; ++block_idx) { BingoPgBuffer buffer; buffer.writeNewBuffer(_index, _metaInfo.n_pages); buffer.formEmptyIndexTuple(BINGO_SECTION_OFFSET_PER_BLOCK * sizeof(int)); buffer.clear(); ++_metaInfo.n_pages; } _sectionOffsetBuffers.expand(BINGO_SECTION_OFFSET_BLOCKS_NUM); /* * Write dictionary buffers * Fulfil by max size */ _metaInfo.offset_dictionary = _metaInfo.n_pages; for (int block_idx = 0; block_idx < BINGO_DICTIONARY_BLOCKS_NUM; ++block_idx) { BingoPgBuffer buffer; buffer.writeNewBuffer(_index, _metaInfo.n_pages); buffer.formEmptyIndexTuple(BingoPgBufferCacheBin::BUFFER_SIZE); buffer.clear(); ++_metaInfo.n_pages; } }