Skip to content
Snippets Groups Projects
Commit 61d30013 authored by Andrei Kazarov's avatar Andrei Kazarov
Browse files

use sleep instead of Thread.yield to proper block

parent ab7294a4
Branches master
No related tags found
No related merge requests found
Pipeline #
......@@ -148,13 +148,16 @@ public final class AALEngine {
* there is basic initialization, specifically the ConfigReader initialization.
* We need to do that before the directives are loaded.
*/
log.info("Configuring ESPER in Replay mode, calling replay.ReplayInjector constructor");
replayInjectorInstance = (Injector)(Class.forName("ch.cern.tdaq.cassandra.replay.ReplayInjector")).newInstance();
log.info("ReplayInjector constructed, continue with ESPER configuration");
// ReplayInjector may throw RuntimeException, catch all that in Main, no way to continue
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new RuntimeException(e) ;
} catch (InstantiationException e) {
e.printStackTrace();
throw new RuntimeException(e) ;
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new RuntimeException(e) ;
}
}
......@@ -162,13 +165,14 @@ public final class AALEngine {
/**
* Creating an RDB or an OKS configuration
*/
log.info("Loading OKS/RDB directives configuration: " + configuration.getRDBConfig());
db = new config.Configuration(configuration.getRDBConfig());
AALSchema = new Schema(db);
/**
* Setting up basic statements
*/
log.info("Creating initial statements... ");
log.info("Registering initial statements... ");
esper.registerStatementsFromDatabase(AALSchema);
ConfigurationEvent c = new ConfigurationEvent("INIT");
......@@ -216,8 +220,6 @@ public final class AALEngine {
}
log.info("Configuration phase done.");
}
......@@ -323,8 +325,12 @@ public final class AALEngine {
*/
periodicScheduler.scheduleWithFixedDelay(IScheck, 0, 10, SECONDS);
log.trace("Waiting forever...");
Thread.yield();
log.info("Waiting forever...");
try { Thread.sleep(Long.MAX_VALUE); }
catch ( final InterruptedException ex ) {} ;
log.info("Forever finished...");
// while (true) {
//
......@@ -345,7 +351,7 @@ public final class AALEngine {
//
}
} // start()
public void shutdown() {
......@@ -366,6 +372,7 @@ public final class AALEngine {
//Destroy the engine thread pools used for inbound and outbound processing
CEPProvider.getInstance().stop();
log.info("Shutdown completed");
}
public String getRootWriter() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment