public static OBinaryConverter getConverter() { boolean useUnsafe = OGlobalConfiguration.MEMORY_USE_UNSAFE.getValueAsBoolean(); if (useUnsafe && unsafeWasDetected) return OUnsafeBinaryConverter.INSTANCE; return OSafeBinaryConverter.INSTANCE; } }
/** * Returns {@link Comparator} instance if applicable one exist or <code>null</code> otherwise. * * @param clazz * Class of object that is going to be compared. * @param <T> * Class of object that is going to be compared. * @return {@link Comparator} instance if applicable one exist or <code>null</code> otherwise. */ @SuppressWarnings("unchecked") public <T> Comparator<T> getComparator(Class<T> clazz) { boolean useUnsafe = OGlobalConfiguration.MEMORY_USE_UNSAFE.getValueAsBoolean(); if (clazz.equals(byte[].class)) { if (useUnsafe && unsafeWasDetected) return (Comparator<T>) OUnsafeByteArrayComparator.INSTANCE; return (Comparator<T>) OByteArrayComparator.INSTANCE; } return null; } }
public OLuceneIndexEngine(OLuceneIndexManagerAbstract delegate, String indexType) { super(OGlobalConfiguration.ENVIRONMENT_CONCURRENT.getValueAsBoolean(), OGlobalConfiguration.MVRBTREE_TIMEOUT .getValueAsInteger(), true); this.lucene = delegate; this.indexType = indexType; }
public void create() throws IOException { lock.lock(); try { if (Files.exists(dirtyFilePath)) { Files.delete(dirtyFilePath); } channel = FileChannel.open(dirtyFilePath, StandardOpenOption.READ, StandardOpenOption.CREATE, StandardOpenOption.WRITE); if (OGlobalConfiguration.FILE_LOCK.getValueAsBoolean()) { lockFile(); } final ByteBuffer buffer = ByteBuffer.allocate(1); buffer.put((byte) 1); buffer.position(0); OIOUtils.writeByteBuffer(buffer, channel, 0); dirtyFlag = true; } finally { lock.unlock(); } }
@Override public void onStartup() { if (OGlobalConfiguration.PROFILER_ENABLED.getValueAsBoolean()) // ACTIVATE RECORDING OF THE PROFILER startRecording(); installMemoryChecker(); }
public void open() throws IOException { lock.lock(); try { if (!Files.exists(dirtyFilePath)) { channel = FileChannel.open(dirtyFilePath, StandardOpenOption.WRITE, StandardOpenOption.READ, StandardOpenOption.CREATE); ByteBuffer buffer = ByteBuffer.allocate(1); OIOUtils.writeByteBuffer(buffer, channel, 0); } else { channel = FileChannel.open(dirtyFilePath, StandardOpenOption.WRITE, StandardOpenOption.READ, StandardOpenOption.CREATE); } if (OGlobalConfiguration.FILE_LOCK.getValueAsBoolean()) { lockFile(); } ByteBuffer buffer = ByteBuffer.allocate(1); OIOUtils.readByteBuffer(buffer, channel, 0, true); buffer.position(0); dirtyFlag = buffer.get() > 0; } finally { lock.unlock(); } }
public OLuceneIndexManagerAbstract() { super(OGlobalConfiguration.ENVIRONMENT_CONCURRENT.getValueAsBoolean(), OGlobalConfiguration.MVRBTREE_TIMEOUT .getValueAsInteger(), true); Orient.instance().registerListener(this); }
if (!OGlobalConfiguration.STORAGE_KEEP_DISK_CACHE_STATE.getValueAsBoolean()) { return;
@Override public void contextInitialized(ServletContextEvent sce) { if (OGlobalConfiguration.INIT_IN_SERVLET_CONTEXT_LISTENER.getValueAsBoolean()) { OLogManager.instance().infoNoDb(this, "Start web application is detected, OrientDB engine is staring up..."); Orient.startUp(true); OLogManager.instance().infoNoDb(this, "OrientDB engine is started"); } }
@Override public void contextDestroyed(ServletContextEvent sce) { if (OGlobalConfiguration.INIT_IN_SERVLET_CONTEXT_LISTENER.getValueAsBoolean()) { final Orient orient = Orient.instance(); if (orient != null) { OLogManager.instance().infoNoDb(this, "Shutting down of OrientDB engine because web application is going to be stopped"); orient.shutdown(); OLogManager.instance().shutdown(); } } } }
@Override public void startup() { final String userName = System.getProperty("user.name", "unknown"); OLogManager.instance().infoNoDb(this, "System is started under an effective user : `%s`", userName); OMemoryAndLocalPaginatedEnginesInitializer.INSTANCE.initialize(); super.startup(); readCache = new O2QCache(calculateReadCacheMaxMemory(OGlobalConfiguration.DISK_CACHE_SIZE.getValueAsLong() * 1024 * 1024), OGlobalConfiguration.DISK_CACHE_PAGE_SIZE.getValueAsInteger() * 1024, true, OGlobalConfiguration.DISK_CACHE_PINNED_PAGES.getValueAsInteger(), OGlobalConfiguration.DISK_CACHE_PRINT_CACHE_STATISTICS.getValueAsBoolean(), OGlobalConfiguration.DISK_CACHE_STATISTICS_INTERVAL.getValueAsInteger()); }
if (OGlobalConfiguration.ENVIRONMENT_DUMP_CFG_AT_STARTUP.getValueAsBoolean()) OGlobalConfiguration.dumpConfiguration(System.out);
walActive = OGlobalConfiguration.USE_WAL.getValueAsBoolean(); if (walActive) OGlobalConfiguration.USE_WAL.setValue(false);
walActive = OGlobalConfiguration.USE_WAL.getValueAsBoolean(); if (walActive) OGlobalConfiguration.USE_WAL.setValue(false);
boolean oldValue = OGlobalConfiguration.INDEX_IGNORE_NULL_VALUES_DEFAULT.getValueAsBoolean(); OGlobalConfiguration.INDEX_IGNORE_NULL_VALUES_DEFAULT.setValue(indexDefinition.isNullValuesIgnored()); final OIndex index = indexManager
else if (record.getSize() > iOutput.length() && !OGlobalConfiguration.RECORD_DOWNSIZING_ENABLED.getValueAsBoolean()) {