use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class TestTDBInternal method exclusive_3.
@Test
public void exclusive_3() {
DatasetGraph dsg = TDBFactory.createDatasetGraph();
TransactionManager txnmgr = TDBInternal.getTransactionManager(dsg);
ReentrantReadWriteLock rwx = (ReentrantReadWriteLock) txnmgr.getExclusivityLock$();
checkLock(rwx, 0, 0);
txnmgr.startExclusiveMode();
checkLock(rwx, 0, 1);
txnmgr.finishExclusiveMode();
checkLock(rwx, 0, 0);
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class TestTDBInternal method basics_1.
@Test
public void basics_1() {
DatasetGraph dsg = TDBFactory.createDatasetGraph();
StoreConnection sConn = TDBInternal.getStoreConnection(dsg);
Assert.assertNotNull(sConn);
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class TestTransControl method journalThresholdSize_02.
// Flush on journal size / small setting.
@Test
public void journalThresholdSize_02() {
TransactionManager.QueueBatchSize = 100;
TransactionManager.MaxQueueThreshold = -1;
// Less than commit size.
TransactionManager.JournalThresholdSize = 10;
DatasetGraph dsg = create();
TransactionManager tMgr = TDBInternal.getTransactionManager(dsg);
txnAddData(dsg);
assertEquals(0, tMgr.getQueueLength());
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class TestTransControl method maxQueueThreshold_01.
// ---- MaxQueueThreshold
@Test
public void maxQueueThreshold_01() {
TransactionManager.MaxQueueThreshold = 1;
DatasetGraph dsg = create();
TransactionManager tMgr = TDBInternal.getTransactionManager(dsg);
Txn.executeWrite(dsg, () -> {
});
assertEquals(1, tMgr.getQueueLength());
Txn.executeWrite(dsg, () -> {
});
assertEquals(0, tMgr.getQueueLength());
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class TestTransControl method queueBatchSize_01.
// ---- QueueBatchSize
@Test
public void queueBatchSize_01() {
// Immediate.
TransactionManager.QueueBatchSize = 0;
DatasetGraph dsg = create();
TransactionManager tMgr = TDBInternal.getTransactionManager(dsg);
Txn.executeWrite(dsg, () -> {
});
assertEquals(0, tMgr.getQueueLength());
Txn.executeWrite(dsg, () -> {
});
assertEquals(0, tMgr.getQueueLength());
}
Aggregations