use of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx in project orientdb by orientechnologies.
the class OSchemaBlogClustersEmbeddedTest method before.
@Before
public void before() {
db = new ODatabaseDocumentTx("memory:" + OSchemaBlogClustersEmbeddedTest.class.getSimpleName());
db.create();
}
use of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx in project orientdb by orientechnologies.
the class AlterSuperclassTest method before.
@BeforeMethod
public void before() {
db = new ODatabaseDocumentTx("memory:" + AlterSuperclassTest.class.getSimpleName());
db.create();
}
use of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx in project orientdb by orientechnologies.
the class DefaultValueTest method before.
@Before
public void before() {
database = new ODatabaseDocumentTx("memory:" + DefaultValueTest.class.getSimpleName());
database.create();
}
use of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx in project orientdb by orientechnologies.
the class ODistributedStorage method getAsyncReplicationError.
protected OAsyncReplicationError getAsyncReplicationError() {
if (OExecutionThreadLocal.INSTANCE.get().onAsyncReplicationError != null) {
final OAsyncReplicationError subCallback = OExecutionThreadLocal.INSTANCE.get().onAsyncReplicationError;
final ODatabaseDocumentTx currentDatabase = (ODatabaseDocumentTx) ODatabaseRecordThreadLocal.INSTANCE.get();
final ODatabaseDocumentTx copyDatabase = currentDatabase.copy();
currentDatabase.activateOnCurrentThread();
return new OAsyncReplicationError() {
@Override
public ACTION onAsyncReplicationError(final Throwable iException, final int iRetry) {
copyDatabase.activateOnCurrentThread();
switch(subCallback.onAsyncReplicationError(iException, iRetry)) {
case RETRY:
break;
case IGNORE:
}
return OAsyncReplicationError.ACTION.IGNORE;
}
};
} else
return null;
}
use of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx in project orientdb by orientechnologies.
the class OConflictResolverDatabaseRepairer method check.
private void check() throws Exception {
// OPEN THE DATABASE ONLY IF NEEDED
ODatabaseDocumentTx db = null;
try {
final int batchMax = OGlobalConfiguration.DISTRIBUTED_CONFLICT_RESOLVER_REPAIRER_BATCH.getValueAsInteger();
final List<ORecordId> rids = new ArrayList<ORecordId>(batchMax);
// REPAIR CLUSTER FIRST
for (Integer clusterId : clusters.keySet()) {
//repairCluster(db, clusterId);
}
clusters.clear();
// REPAIR RECORDS
for (ORecordId rid : records.keySet()) {
rids.add(rid);
if (rids.size() >= batchMax)
// REACHED MAXIMUM FOR BATCH
break;
}
if (!rids.isEmpty()) {
// REPAIR RECORDS IN BATCH
db = getDatabase();
if (repairRecords(db, rids)) {
// SUCCEED: REMOVE REPAIRED RECORDS
for (ORecordId rid : rids) records.remove(rid);
}
}
} finally {
if (db != null)
db.close();
}
}
Aggregations