Search in sources :

Example 1 with TupleLoader

use of org.apache.jena.sdb.store.TupleLoader in project jena by apache.

the class LoaderTuplesNodes method close.

/**
     * Close this loader and finish the thread (if required)
     *
     */
@Override
public void close() {
    if (!initialized)
        return;
    try {
        if (threading && commitThread.isAlive()) {
            queue.put(finishSignal);
            commitThread.join();
        } else {
            flushTriples();
        }
    } catch (Exception e) {
        log.error("Problem closing loader: " + e.getMessage());
        throw new SDBException("Problem closing loader", e);
    } finally {
        for (TupleLoader loader : this.tupleLoaders.values()) loader.close();
        this.initialized = false;
        this.commitThread = null;
        this.queue = null;
        this.tupleLoaderClass = null;
        this.tupleLoaders = null;
    }
}
Also used : TupleLoader(org.apache.jena.sdb.store.TupleLoader) SDBException(org.apache.jena.sdb.SDBException) SQLException(java.sql.SQLException) SDBException(org.apache.jena.sdb.SDBException)

Example 2 with TupleLoader

use of org.apache.jena.sdb.store.TupleLoader in project jena by apache.

the class LoaderTuplesNodes method init.

private void init() {
    if (initialized)
        return;
    tupleLoaders = new HashMap<String, TupleLoader>();
    currentLoader = null;
    count = 0;
    if (threading) {
        queue = new ArrayBlockingQueue<TupleChange>(chunkSize);
        threadException = new AtomicReference<Throwable>();
        threadFlushing = new AtomicBoolean();
        commitThread = new Thread(new Commiter());
        commitThread.setDaemon(true);
        commitThread.start();
        log.debug("Threading started");
    }
    initialized = true;
}
Also used : TupleLoader(org.apache.jena.sdb.store.TupleLoader) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean)

Example 3 with TupleLoader

use of org.apache.jena.sdb.store.TupleLoader in project jena by apache.

the class StoreTriplesNodesHashDB2 method loaderSimple.

static StoreLoader loaderSimple(SDBConnection connection) {
    // Temporary - simple loader for development. 
    //new LoaderTuplesNodes(connection, TupleLoaderHashDerby.class),
    TupleLoader tLoader = new TupleLoaderOneHash(connection, new TableDescTriples());
    StoreLoader sLoader = new TupleGraphLoader(tLoader);
    return sLoader;
}
Also used : TupleLoader(org.apache.jena.sdb.store.TupleLoader) TupleGraphLoader(org.apache.jena.sdb.store.TupleGraphLoader) TableDescTriples(org.apache.jena.sdb.layout2.TableDescTriples) StoreLoader(org.apache.jena.sdb.store.StoreLoader)

Aggregations

TupleLoader (org.apache.jena.sdb.store.TupleLoader)3 SQLException (java.sql.SQLException)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 SDBException (org.apache.jena.sdb.SDBException)1 TableDescTriples (org.apache.jena.sdb.layout2.TableDescTriples)1 StoreLoader (org.apache.jena.sdb.store.StoreLoader)1 TupleGraphLoader (org.apache.jena.sdb.store.TupleGraphLoader)1