Search in sources :

Example 1 with Engine

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;
    });
}
Also used : Engine(com.cinchapi.concourse.server.storage.Engine) Internal(com.cinchapi.concourse.server.aop.Internal)

Example 2 with 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;
}
Also used : Engine(com.cinchapi.concourse.server.storage.Engine)

Example 3 with Engine

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;
}
Also used : Engine(com.cinchapi.concourse.server.storage.Engine)

Example 4 with Engine

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();
}
Also used : Engine(com.cinchapi.concourse.server.storage.Engine) PluginRestricted(com.cinchapi.concourse.server.plugin.PluginRestricted)

Example 5 with Engine

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");
    }
}
Also used : Engine(com.cinchapi.concourse.server.storage.Engine) PluginRestricted(com.cinchapi.concourse.server.plugin.PluginRestricted)

Aggregations

Engine (com.cinchapi.concourse.server.storage.Engine)5 PluginRestricted (com.cinchapi.concourse.server.plugin.PluginRestricted)2 Internal (com.cinchapi.concourse.server.aop.Internal)1