public OChannelBinary(final Socket iSocket, final OContextConfiguration iConfig) throws IOException { super(iSocket, iConfig); maxChunkSize = iConfig.getValueAsInteger(OGlobalConfiguration.NETWORK_BINARY_MAX_CONTENT_LENGTH); debug = iConfig.getValueAsBoolean(OGlobalConfiguration.NETWORK_BINARY_DEBUG); buffer = new byte[maxChunkSize]; if (debug) OLogManager.instance().info(this, "%s - Connected", socket.getRemoteSocketAddress()); }
private void clear() { fileTemplate = new OStorageSegmentConfiguration(); charset = DEFAULT_CHARSET; synchronized (properties) { properties.clear(); } version = -1; name = null; schemaRecordId = null; dictionaryRecordId = null; indexMgrRecordId = null; dateFormat = DEFAULT_DATE_FORMAT; dateTimeFormat = DEFAULT_DATETIME_FORMAT; binaryFormatVersion = 0; clusters = Collections.synchronizedList(new ArrayList<>()); localeLanguage = Locale.getDefault().getLanguage(); localeCountry = Locale.getDefault().getCountry(); timeZone = TimeZone.getDefault(); localeInstance = null; clusterSelection = null; conflictStrategy = null; getContextConfiguration().setValue(OGlobalConfiguration.CLASS_MINIMUM_CLUSTERS, OGlobalConfiguration.CLASS_MINIMUM_CLUSTERS.getValueAsInteger()); // 0 = AUTOMATIC autoInitClusters(); recordSerializer = null; recordSerializerVersion = 0; indexEngines = new ConcurrentHashMap<>(); validation = getContextConfiguration().getValueAsBoolean(OGlobalConfiguration.DB_VALIDATION); binaryFormatVersion = CURRENT_BINARY_FORMAT_VERSION; }
public OChannelBinary(final Socket iSocket, final OContextConfiguration iConfig) throws IOException { super(iSocket, iConfig); maxChunkSize = iConfig.getValueAsInteger(OGlobalConfiguration.NETWORK_BINARY_MAX_CONTENT_LENGTH) * 1024; debug = iConfig.getValueAsBoolean(OGlobalConfiguration.NETWORK_BINARY_DEBUG); responseTimeout = iConfig.getValueAsInteger(OGlobalConfiguration.NETWORK_REQUEST_TIMEOUT); if (debug) OLogManager.instance().info(this, "%s - Connected", socket.getRemoteSocketAddress()); }
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(); }
private OSocketFactory(final OContextConfiguration iConfig) { config = iConfig; useSSL = iConfig.getValueAsBoolean(OGlobalConfiguration.CLIENT_USE_SSL); keyStorePath = (String) iConfig.getValue(OGlobalConfiguration.CLIENT_SSL_KEYSTORE); keyStorePassword = (String) iConfig.getValue(OGlobalConfiguration.CLIENT_SSL_KEYSTORE_PASSWORD); trustStorePath = (String) iConfig.getValue(OGlobalConfiguration.CLIENT_SSL_TRUSTSTORE); trustStorePassword = (String) iConfig.getValue(OGlobalConfiguration.CLIENT_SSL_TRUSTSTORE_PASSWORD); }
private OSocketFactory(OContextConfiguration iConfig) { config = iConfig; useSSL = iConfig.getValueAsBoolean(OGlobalConfiguration.CLIENT_USE_SSL); keyStorePath = (String) iConfig .getValue(OGlobalConfiguration.CLIENT_SSL_KEYSTORE); keyStorePassword = (String) iConfig .getValue(OGlobalConfiguration.CLIENT_SSL_KEYSTORE_PASSWORD); trustStorePath = (String) iConfig .getValue(OGlobalConfiguration.CLIENT_SSL_TRUSTSTORE); trustStorePassword = (String) iConfig .getValue(OGlobalConfiguration.CLIENT_SSL_TRUSTSTORE_PASSWORD); }
@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; } }
@Override public void recreateIndexes(ODatabaseDocumentInternal database) { acquireExclusiveLock(); try { if (recreateIndexesThread != null && recreateIndexesThread.isAlive()) // BUILDING ALREADY IN PROGRESS return; document = database.load(new ORecordId(database.getStorage().getConfiguration().getIndexMgrRecordId())); Runnable recreateIndexesTask = new RecreateIndexesTask(database.getStorage()); recreateIndexesThread = new Thread(recreateIndexesTask, "OrientDB rebuild indexes"); recreateIndexesThread.setUncaughtExceptionHandler(new OUncaughtExceptionHandler()); recreateIndexesThread.start(); } finally { releaseExclusiveLock(); } if (database.getConfiguration().getValueAsBoolean(OGlobalConfiguration.INDEX_SYNCHRONOUS_AUTO_REBUILD)) { waitTillIndexRestore(); database.getMetadata().reload(); } }
private boolean fetchFromTarget(final Iterator<? extends OIdentifiable> iTarget) { fetchLimit = getQueryFetchLimit(); final long startFetching = System.currentTimeMillis(); final int[] clusterIds = iTarget instanceof ORecordIteratorClusters ? ((ORecordIteratorClusters) iTarget).getClusterIds() : null; parallel = (parallel || getDatabase().getConfiguration().getValueAsBoolean(OGlobalConfiguration.QUERY_PARALLEL_AUTO)) && canRunParallel(clusterIds, iTarget); try { if (parallel) return parallelExec(iTarget); boolean prefetchPages = false; if (canScanStorageCluster(clusterIds)) prefetchPages = true; // WORK WITH ITERATOR ODatabaseDocumentInternal database = getDatabase(); database.setPrefetchRecords(prefetchPages); try { return serialIterator(iTarget); } finally { database.setPrefetchRecords(false); } } finally { context.setVariable("fetchingFromTargetElapsed", (System.currentTimeMillis() - startFetching)); } }
} else { indexDefinition.setNullValuesIgnored( database.getConfiguration().getValueAsBoolean(OGlobalConfiguration.INDEX_IGNORE_NULL_VALUES_DEFAULT));
pessimisticLock = contextConfiguration.getValueAsBoolean(OGlobalConfiguration.STORAGE_PESSIMISTIC_LOCKING); if (contextConfiguration.getValueAsBoolean(OGlobalConfiguration.STORAGE_MAKE_FULL_CHECKPOINT_AFTER_CREATE)) { makeFullCheckpoint();
.getValueAsBoolean(OGlobalConfiguration.CREATE_DEFAULT_USERS);
pessimisticLock = contextConfiguration.getValueAsBoolean(OGlobalConfiguration.STORAGE_PESSIMISTIC_LOCKING);
.getValueAsBoolean(OGlobalConfiguration.CREATE_DEFAULT_USERS);
.getValueAsBoolean(OGlobalConfiguration.CREATE_DEFAULT_USERS);