use of com.cinchapi.concourse.server.storage.Engine in project concourse by cinchapi.
the class ConcourseServer method getEngineUnsafe.
/**
* Return the {@link Engine} that is associated with {@code env} without
* performing any sanitization on the name. If such an Engine does not
* exist, create a new one and add it to the collection.
*/
@Internal
private Engine getEngineUnsafe(String env) {
return engines.computeIfAbsent(env, $ -> {
String buffer = bufferStore + File.separator + env;
String db = dbStore + File.separator + env;
Engine engine = new Engine(buffer, db, env);
engine.start();
numEnginesInitialized.incrementAndGet();
return engine;
});
}
use of com.cinchapi.concourse.server.storage.Engine in project concourse by cinchapi.
the class StoresTest method getStore.
/**
* Return an {@link AtomicSupport} {@link Store} that can be used in unit
* tests.
*
* @return an {@link AtomicSupport} store
*/
protected AtomicSupport getStore() {
String directory = TestData.DATA_DIR + File.separator + Time.now();
Engine store = new Engine(directory + File.separator + "buffer", directory + File.separator + "database");
store.start();
return store;
}
use of com.cinchapi.concourse.server.storage.Engine in project concourse by cinchapi.
the class OperationsTest method getStore.
/**
* Return an {@link AtomicSupport} {@link Store} that can be used in unit
* tests.
*
* @return an {@link AtomicSupport} store
*/
protected AtomicSupport getStore() {
String directory = TestData.DATA_DIR + File.separator + Time.now();
Engine store = new Engine(directory + File.separator + "buffer", directory + File.separator + "database");
store.start();
return store;
}
use of com.cinchapi.concourse.server.storage.Engine in project concourse by cinchapi.
the class ConcourseServer method start.
/**
* Start the server.
*
* @throws TTransportException
*/
@PluginRestricted
public void start() throws TTransportException {
for (Engine engine : engines.values()) {
engine.start();
}
httpServer.start();
pluginManager.start();
Thread mgmtThread = new Thread(() -> {
mgmtServer.serve();
}, "management-server");
mgmtThread.setDaemon(true);
mgmtThread.start();
System.out.println("The Concourse server has started");
server.serve();
}
use of com.cinchapi.concourse.server.storage.Engine in project concourse by cinchapi.
the class ConcourseServer method stop.
/**
* Stop the server.
*/
@PluginRestricted
public void stop() {
if (server.isServing()) {
mgmtServer.stop();
server.stop();
pluginManager.stop();
httpServer.stop();
for (Engine engine : engines.values()) {
engine.stop();
}
numEnginesInitialized.set(0);
System.out.println("The Concourse server has stopped");
}
}
Aggregations