MCPcopy Index your code
hub / github.com/questdb/questdb / addShutdownHook

Method addShutdownHook

core/src/main/java/io/questdb/ServerMain.java:275–293  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

273 }
274
275 private void addShutdownHook() {
276 Runtime.getRuntime().addShutdownHook(new Thread(() -> {
277 try {
278 System.err.println("SIGTERM received");
279 System.out.println("SIGTERM received");
280 // It's fine if the magic number doesn't get its way to logs.
281 // We log it merely to make sure that LOAD instructions generated by
282 // AsyncFilterAtom#preTouchColumns() aren't optimized away by JVM's JIT compiler.
283 bootstrap.getLog().debug().$("Pre-touch magic number: ").$(AsyncFilterAtom.PRE_TOUCH_BLACK_HOLE.sum()).$();
284 close();
285 LogFactory.closeInstance();
286 } catch (Error ignore) {
287 // ignore
288 } finally {
289 System.err.println("QuestDB is shutdown.");
290 System.out.println("QuestDB is shutdown.");
291 }
292 }));
293 }
294
295 private synchronized void initialize(Log log) {
296 initialized = true;

Callers 2

startMethod · 0.95
ensureDataMethod · 0.80

Calls 7

closeMethod · 0.95
closeInstanceMethod · 0.95
sumMethod · 0.80
$Method · 0.65
debugMethod · 0.65
printlnMethod · 0.45
getLogMethod · 0.45

Tested by

no test coverage detected