MCPcopy Create free account
hub / github.com/bitshares/bitshares-core / load

Method load

libraries/plugins/es_objects/es_objects.cpp:156–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154
155 template<typename ObjType>
156 void load( const es_objects_plugin_impl::plugin_options::object_options& opt,
157 bool force_delete = false )
158 {
159 if( !opt.enabled )
160 return;
161
162 // If no_delete or store_updates is true, do not delete
163 if( force_delete || !( opt.no_delete || opt.store_updates ) )
164 {
165 ilog( "Deleting all data in index " + my->_options.index_prefix + opt.index_name );
166 my->delete_all_from_database( opt );
167 }
168
169 ilog( "Loading data into index " + my->_options.index_prefix + opt.index_name );
170 db.get_index( ObjType::space_id, ObjType::type_id ).inspect_all_objects(
171 [this, &opt](const graphene::db::object &o) {
172 my->prepareTemplate( static_cast<const ObjType&>(o), opt );
173 });
174 my->send_bulk_if_ready(true);
175 my->docs_sent_batch = 0;
176 }
177};
178
179void es_objects_plugin_impl::sync_db( bool delete_before_load )

Callers 15

mainFunction · 0.80
mainFunction · 0.80
python_format.pyFile · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 4

inspect_all_objectsMethod · 0.80
prepareTemplateMethod · 0.80
send_bulk_if_readyMethod · 0.80

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64