public OLocalPaginatedStorage(final String name, final String filePath, final String mode, final int id, OReadCache readCache, OClosableLinkedContainer<Long, OFileClassic> files, final long walMaxSegSize) throws IOException { super(name, filePath, mode, id); this.walMaxSegSize = walMaxSegSize; this.files = files; this.readCache = readCache; String sp = OSystemVariableResolver.resolveSystemVariables(OFileUtils.getPath(new File(url).getPath())); storagePath = Paths.get(OIOUtils.getPathFromDatabaseName(sp)); variableParser = new OStorageVariableParser(storagePath); configuration = new OStorageConfigurationSegment(this); DELETE_MAX_RETRIES = getConfiguration().getContextConfiguration().getValueAsInteger(OGlobalConfiguration.FILE_DELETE_RETRY); DELETE_WAIT_TIME = getConfiguration().getContextConfiguration().getValueAsInteger(OGlobalConfiguration.FILE_DELETE_DELAY); dirtyFlag = new OPaginatedStorageDirtyFlag(storagePath.resolve("dirty.fl")); }
public OCommandCacheSoftRefs(final OStorage storage) { databaseName = storage.getName(); if (storage instanceof OLocalPaginatedStorage) { fileConfigPath = ((OLocalPaginatedStorage) storage).getStoragePath().resolve(CONFIG_FILE).toString(); } else fileConfigPath = null; OContextConfiguration configuration = storage.getConfiguration().getContextConfiguration(); enable = configuration.getValueAsBoolean(OGlobalConfiguration.COMMAND_CACHE_ENABLED); minExecutionTime = configuration.getValueAsInteger(OGlobalConfiguration.COMMAND_CACHE_MIN_EXECUTION_TIME); maxResultsetSize = configuration.getValueAsInteger(OGlobalConfiguration.COMMAND_CACHE_MAX_RESULSET_SIZE); initCache(); }
@Override public OContextConfiguration getConfiguration() { checkIfActive(); if (getStorage() != null) return getStorage().getConfiguration().getContextConfiguration(); return null; }
@Override protected void initWalAndDiskCache(OContextConfiguration contextConfiguration) throws IOException { if (configuration.getContextConfiguration().getValueAsBoolean(OGlobalConfiguration.USE_WAL)) { if (writeAheadLog == null) writeAheadLog = new OMemoryWriteAheadLog(); } else writeAheadLog = null; final ODirectMemoryOnlyDiskCache diskCache = new ODirectMemoryOnlyDiskCache( OGlobalConfiguration.DISK_CACHE_PAGE_SIZE.getValueAsInteger() * ONE_KB, 1, getPerformanceStatisticManager()); if (readCache == null) { readCache = diskCache; } if (writeCache == null) { writeCache = diskCache; } }
+ " Please close the database (or stop OrientDB), make room on your hard drive and then reopen the database. " + "The minimal required space is " + (lowDiskSpace.requiredSpace / (1024 * 1024)) + " MB. " + "Required space is now set to " + configuration.getContextConfiguration() .getValueAsInteger(OGlobalConfiguration.DISK_CACHE_FREE_SPACE_LIMIT) + "MB (you can change it by setting parameter " + OGlobalConfiguration.DISK_CACHE_FREE_SPACE_LIMIT.getKey()
ODatabaseRecordThreadLocal.instance().get().getStorage().getConfiguration().getContextConfiguration() .getValueAsString(OGlobalConfiguration.STORAGE_ENCRYPTION_KEY)); break;
ODatabaseRecordThreadLocal.instance().get().getStorage().getConfiguration().getContextConfiguration() .getValueAsString(OGlobalConfiguration.STORAGE_ENCRYPTION_KEY)); break;
@Override public void configure(final OStorage storage, final int id, final String clusterName, final Object... parameters) throws IOException { acquireExclusiveLock(); try { final OContextConfiguration ctxCfg = storage.getConfiguration().getContextConfiguration(); final String cfgCompression = ctxCfg.getValueAsString(OGlobalConfiguration.STORAGE_COMPRESSION_METHOD); final String cfgEncryption = ctxCfg.getValueAsString(OGlobalConfiguration.STORAGE_ENCRYPTION_METHOD); final String cfgEncryptionKey = ctxCfg.getValueAsString(OGlobalConfiguration.STORAGE_ENCRYPTION_KEY); config = new OStoragePaginatedClusterConfiguration(storage.getConfiguration(), id, clusterName, null, true, OStoragePaginatedClusterConfiguration.DEFAULT_GROW_FACTOR, OStoragePaginatedClusterConfiguration.DEFAULT_GROW_FACTOR, cfgCompression, cfgEncryption, cfgEncryptionKey, null, OStorageClusterConfiguration.STATUS.ONLINE, BINARY_VERSION); config.name = clusterName; init((OAbstractPaginatedStorage) storage, config); } finally { releaseExclusiveLock(); } }
@Override public void configure(final OStorage storage, final int id, final String clusterName, final Object... parameters) throws IOException { acquireExclusiveLock(); try { final OContextConfiguration ctxCfg = storage.getConfiguration().getContextConfiguration(); final String cfgCompression = ctxCfg.getValueAsString(OGlobalConfiguration.STORAGE_COMPRESSION_METHOD); final String cfgEncryption = ctxCfg.getValueAsString(OGlobalConfiguration.STORAGE_ENCRYPTION_METHOD); final String cfgEncryptionKey = ctxCfg.getValueAsString(OGlobalConfiguration.STORAGE_ENCRYPTION_KEY); config = new OStoragePaginatedClusterConfiguration(storage.getConfiguration(), id, clusterName, null, true, OStoragePaginatedClusterConfiguration.DEFAULT_GROW_FACTOR, OStoragePaginatedClusterConfiguration.DEFAULT_GROW_FACTOR, cfgCompression, cfgEncryption, cfgEncryptionKey, null, OStorageClusterConfiguration.STATUS.ONLINE, BINARY_VERSION); config.name = clusterName; init((OAbstractPaginatedStorage) storage, config); } finally { releaseExclusiveLock(); } }
public OSharedContextEmbedded(OStorage storage) { schema = new OSchemaEmbedded(this); security = OSecurityManager.instance().newSecurity(); indexManager = new OIndexManagerShared(storage); functionLibrary = new OFunctionLibraryImpl(); scheduler = new OSchedulerImpl(); sequenceLibrary = new OSequenceLibraryImpl(); liveQueryOps = new OLiveQueryHook.OLiveQueryOps(); liveQueryOpsV2 = new OLiveQueryHookV2.OLiveQueryOps(); commandCache = new OCommandCacheSoftRefs(storage.getUnderlying()); statementCache = new OStatementCache( storage.getConfiguration().getContextConfiguration().getValueAsInteger(OGlobalConfiguration.STATEMENT_CACHE_SIZE)); executionPlanCache = new OExecutionPlanCache( storage.getConfiguration().getContextConfiguration().getValueAsInteger(OGlobalConfiguration.STATEMENT_CACHE_SIZE)); this.registerListener(executionPlanCache); queryStats = new OQueryStats(); activeDistributedQueries = new HashMap<>(); ((OAbstractPaginatedStorage) storage).setStorageConfigurationUpdateListener(update -> { for (OMetadataUpdateListener listener : browseListeners()) { listener.onStorageConfigurationUpdate(storage.getName(), update); } }); }
engineProperties, metadata); final OContextConfiguration ctxCfg = configuration.getContextConfiguration(); final String cfgEncryption = ctxCfg.getValueAsString(OGlobalConfiguration.STORAGE_ENCRYPTION_METHOD); final String cfgEncryptionKey = ctxCfg.getValueAsString(OGlobalConfiguration.STORAGE_ENCRYPTION_KEY);
final OContextConfiguration ctxCfg = configuration.getContextConfiguration(); final String cfgEncryptionKey = ctxCfg.getValueAsString(OGlobalConfiguration.STORAGE_ENCRYPTION_KEY);
final OContextConfiguration ctxCfg = configuration.getContextConfiguration(); final String cfgEncryptionKey = ctxCfg.getValueAsString(OGlobalConfiguration.STORAGE_ENCRYPTION_KEY);
boolean createDefUsers = getDatabase().getStorage().getConfiguration().getContextConfiguration() .getValueAsBoolean(OGlobalConfiguration.CREATE_DEFAULT_USERS);
boolean createDefUsers = getDatabase().getStorage().getConfiguration().getContextConfiguration() .getValueAsBoolean(OGlobalConfiguration.CREATE_DEFAULT_USERS);
boolean createDefUsers = getDatabase().getStorage().getConfiguration().getContextConfiguration() .getValueAsBoolean(OGlobalConfiguration.CREATE_DEFAULT_USERS);