use of com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage in project orientdb by orientechnologies.
the class WriteAheadLogConcurrencyTest method beforeClass.
@BeforeClass(enabled = false)
public void beforeClass() throws Exception {
OWALRecordsFactory.INSTANCE.registerNewRecord((byte) 128, WriteAheadLogTest.TestRecord.class);
String buildDirectory = System.getProperty("buildDirectory");
if (buildDirectory == null || buildDirectory.isEmpty())
buildDirectory = ".";
testDir = new File(buildDirectory, "WriteAheadLogConcurrencyTest");
if (!testDir.exists())
testDir.mkdir();
OLocalPaginatedStorage localPaginatedStorage = mock(OLocalPaginatedStorage.class);
when(localPaginatedStorage.getStoragePath()).thenReturn(testDir.getAbsolutePath());
when(localPaginatedStorage.getName()).thenReturn("WriteAheadLogConcurrencyTest");
writeAheadLog = new ODiskWriteAheadLog(200, 500, OWALPage.PAGE_SIZE * 800, null, true, localPaginatedStorage, 10);
writerExecutor = Executors.newCachedThreadPool();
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage in project orientdb by orientechnologies.
the class WriteAheadLogTest method createWAL.
private ODiskWriteAheadLog createWAL(int maxPagesCacheSize, int maxSegmentSize) throws IOException {
OLocalPaginatedStorage paginatedStorage = mock(OLocalPaginatedStorage.class);
when(paginatedStorage.getName()).thenReturn("WriteAheadLogTest");
when(paginatedStorage.getStoragePath()).thenReturn(testDir.getAbsolutePath());
OStorageConfiguration configurationMock = mock(OStorageConfiguration.class);
when(configurationMock.getLocaleInstance()).thenReturn(Locale.getDefault());
when(paginatedStorage.getConfiguration()).thenReturn(configurationMock);
when(paginatedStorage.getPerformanceStatisticManager()).thenReturn(new OPerformanceStatisticManager(paginatedStorage, Long.MAX_VALUE, -1));
return new ODiskWriteAheadLog(maxPagesCacheSize, -1, maxSegmentSize, null, true, paginatedStorage, 10);
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage in project orientdb by orientechnologies.
the class OLuceneIndexEngineAbstract method delete.
@Override
public void delete() {
if (mgrWriter != null && mgrWriter.getIndexWriter() != null) {
try {
mgrWriter.getIndexWriter().deleteUnusedFiles();
} catch (IOException e) {
e.printStackTrace();
}
close();
}
final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) storage.getUnderlying();
if (storageLocalAbstract instanceof OLocalPaginatedStorage) {
OLocalPaginatedStorage localAbstract = (OLocalPaginatedStorage) storageLocalAbstract;
deleteIndexFolder(indexName(), localAbstract);
}
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage in project orientdb by orientechnologies.
the class OLuceneIndexEngineAbstract method internalDelete.
protected void internalDelete(String indexName) {
if (mgrWriter != null && mgrWriter.getIndexWriter().isOpen()) {
close();
}
final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) storage.getUnderlying();
if (storageLocalAbstract instanceof OLocalPaginatedStorage) {
OLocalPaginatedStorage localAbstract = (OLocalPaginatedStorage) storageLocalAbstract;
deleteIndexFolder(indexName, localAbstract);
}
}
use of com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage in project orientdb by orientechnologies.
the class OServerInfo method getStorages.
public static void getStorages(final OServer server, final OJSONWriter json) throws IOException {
json.beginCollection(1, true, "storages");
Collection<OStorage> storages = Orient.instance().getStorages();
for (OStorage s : storages) {
json.beginObject(2);
writeField(json, 2, "name", s.getName());
writeField(json, 2, "type", s.getClass().getSimpleName());
writeField(json, 2, "path", s instanceof OLocalPaginatedStorage ? ((OLocalPaginatedStorage) s).getStoragePath().replace('\\', '/') : "");
writeField(json, 2, "activeUsers", "n.a.");
json.endObject(2);
}
json.endCollection(1, false);
}
Aggregations