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;
}
}
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;
}
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;
}
Aggregations