MCPcopy Create free account
hub / github.com/BaseXdb/basex / finishUpdate

Method finishUpdate

basex-core/src/main/java/org/basex/data/DiskData.java:237–252  ·  view source on GitHub ↗
(final MainOptions opts)

Source from the content-addressed store, hash-verified

235 }
236
237 @Override
238 public synchronized void finishUpdate(final MainOptions opts) {
239 // OPTIMIZE ALL will close the database before this function is called
240 if(closed) return;
241
242 // remove updating file
243 final boolean auto = opts.get(MainOptions.AUTOFLUSH);
244 if(auto) {
245 final IOFile upd = meta.updateFile();
246 if(!upd.exists()) throw Util.notExpected("%: lock file does not exist.", meta.name);
247 if(!upd.delete()) throw Util.notExpected("%: could not delete lock file.", meta.name);
248 }
249
250 flush(auto);
251 if(!table.lock(false)) throw Util.notExpected("Database '%': could not unlock.", meta.name);
252 }
253
254 @Override
255 public synchronized void flush(final boolean all) {

Callers

nothing calls this directly

Calls 7

existsMethod · 0.95
notExpectedMethod · 0.95
deleteMethod · 0.95
flushMethod · 0.95
updateFileMethod · 0.80
getMethod · 0.65
lockMethod · 0.45

Tested by

no test coverage detected