Class ODirectMemoryStorage
java.lang.Object
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage
com.orientechnologies.orient.core.storage.memory.ODirectMemoryStorage
- All Implemented Interfaces:
OBackgroundExceptionListener,OCheckpointRequestListener,OFreezableStorageComponent,OPageIsBrokenListener,OIdentifiableStorage,OStorage,OStorageInfo,OBackupable
- Since:
- 7/9/14
- Author:
- Andrey Lomakin (a.lomakin-at-orientdb.com)
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.orientechnologies.orient.core.storage.OStorage
OStorage.LOCKING_STRATEGY, OStorage.STATUS -
Field Summary
Fields inherited from class com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage
ALGORITHM_NAME, atomicOperationsManager, atomicOperationsTable, componentsFactory, configuration, context, DATABASE_INSTANCE_ID, ENCRYPTION_IV, error, fuzzyCheckpointExecutor, IV_EXT, IV_NAME, name, readCache, sbTreeCollectionManager, stateLock, status, storageThreadGroup, TRANSFORMATION, url, writeAheadLog, writeCacheFields inherited from interface com.orientechnologies.orient.core.storage.OStorage
CLUSTER_DEFAULT_NAME -
Constructor Summary
ConstructorsConstructorDescriptionODirectMemoryStorage(String name, String filePath, int id, OrientDBInternal context) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFileToDirectory(String name, InputStream stream, File directory) backup(OutputStream out, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener, int compressionLevel, int bufferSize) Executes a backup of the database.protected PathcheckAndCleanPath(String zipPath) protected voidprotected OLogSequenceNumbercopyWALToIncrementalBackup(ZipOutputStream zipOutputStream, long startSegment) protected OWriteAheadLogcreateWalFromIBUFiles(File directory, OContextConfiguration contextConfiguration, Locale locale, byte[] iv) protected Filebooleanexists()voidprotected byte[]getIv()getType()Returns the storage's type.getURL()protected voidinitIv()protected voidinitWalAndDiskCache(OContextConfiguration contextConfiguration) booleanisMemory()protected booleanprotected voidpostCloseSteps(boolean onDelete, boolean internalError, long lastTxId) protected voidreadIv()voidrestore(InputStream in, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener) Executes a restore of a database backup.voidshutdown()This method is called inOrient.shutdown()method.Methods inherited from class com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage
acquireReadLock, acquireReadLock, acquireWriteLock, acquireWriteLock, addCluster, addCluster, addIndexEngine, browseCluster, callIndexEngine, ceilingPhysicalPositions, check, checkDatabaseInstanceId, checkErrorState, checkForRecordValidity, checkIfStorageDirty, checkName, checkOpennessAndMigration, cleanOutRecord, clearIndex, clearProperties, clearStorageDirty, close, closeClusters, closeIndexes, commit, commit, commitPreAllocated, count, count, countRecords, create, createRecord, createSBTree, delete, deleteIndexEngine, deleteRecord, deleteTreeRidBag, doCreate, doEncryptionDecryption, doShutdown, dropCluster, dropCluster, endBackup, endDDL, extractEngineAPIVersion, extractTransactionsFromWal, fireConfigurationUpdateNotifications, floorPhysicalPositions, freeze, fullIncrementalBackup, generateDatabaseInstanceId, getAtomicOperationsManager, getClusterDataRange, getClusterEncryption, getClusterIdByName, getClusterInstances, getClusterName, getClusterNameById, getClusterNames, getClusterNextPosition, getClusterRecordConflictStrategy, getClusterRecordsSizeById, getClusterRecordsSizeByName, getClusters, getClustersIds, getComponentsFactory, getConfiguration, getContext, getCreatedAtVersion, getDefaultClusterId, getId, getIdGen, getIndexDescStream, getIndexEngine, getIndexKeyStream, getIndexSize, getIndexStream, getIndexValue, getIndexValues, getLastClusterPosition, getLastMetadata, getLSN, getName, getOpenedAtVersion, getPhysicalClusterNameById, getReadCache, getRecordConflictStrategy, getRecordMetadata, getRecordScanned, getRecordStatus, getRecoverListener, getRidsGroupedByCluster, getSBtreeCollectionManager, getSize, getStatus, getUuid, getVersion, getVersionForKey, getWALInstance, getWriteCache, hasIndexRangeQuerySupport, higherPhysicalPositions, incrementalBackup, incrementalBackup, incrementalBackup, incrementalSync, initConfiguration, isAssigningClusterIds, isClosed, isClosedInternal, isDDLRunning, isDeleted, isDirty, isIcrementalBackupRunning, isInError, isSystemCluster, iterateIndexEntriesBetween, iterateIndexEntriesMajor, iterateIndexEntriesMinor, loadEncryption, loadIndexEngine, logAndPrepareForRethrow, logAndPrepareForRethrow, logAndPrepareForRethrow, logAndPrepareForRethrow, logAndPrepareForRethrow, lowerPhysicalPositions, makeFuzzyCheckpoint, makeStorageDirty, metadataOnly, moveToErrorStateIfNeeded, normalizeName, onException, open, openClusters, openIndexes, pageIsBroken, pauseConfigurationUpdateNotifications, postCreateSteps, postDeleteSteps, postProcessIncrementalRestore, preallocateRids, preCloseSteps, preCreateSteps, preprocessingIncrementalRestore, readDatabaseInstanceId, readRecord, readRecordIfVersionIsNotLatest, registerRecoverListener, release, releaseReadLock, releaseWriteLock, reload, removeIndexValuesContainer, removeProperty, requestCheckpoint, resolveObjectSerializer, restoreAtomicUnit, restoreFrom, restoreFromIncrementalBackup, restoreFromIncrementalBackup, restoreFullIncrementalBackup, setCharset, setClusterAttribute, setClusterSelection, setConflictStrategy, setDateFormat, setDateTimeFormat, setDefaultClusterId, setIndexMgrRecordId, setLocaleCountry, setLocaleLanguage, setMinimumClusters, setProperty, setRecordSerializer, setSchemaRecordId, setStorageConfigurationUpdateListener, setTimeZone, setValidation, startBackup, startDDL, supportIncremental, synch, toString, unregisterRecoverListener, updateRecord, wereDataRestoredAfterOpen, wereNonTxOperationsPerformedInPreviousOpen
-
Constructor Details
-
ODirectMemoryStorage
-
-
Method Details
-
initWalAndDiskCache
- Specified by:
initWalAndDiskCachein classOAbstractPaginatedStorage
-
postCloseSteps
protected void postCloseSteps(boolean onDelete, boolean internalError, long lastTxId) - Specified by:
postCloseStepsin classOAbstractPaginatedStorage
-
exists
public boolean exists() -
getType
Description copied from interface:OStorageReturns the storage's type. -
getURL
- Specified by:
getURLin interfaceOStorageInfo- Overrides:
getURLin classOAbstractPaginatedStorage
-
flushAllData
public void flushAllData()- Overrides:
flushAllDatain classOAbstractPaginatedStorage
-
readIv
protected void readIv()- Specified by:
readIvin classOAbstractPaginatedStorage
-
getIv
protected byte[] getIv()- Specified by:
getIvin classOAbstractPaginatedStorage
-
initIv
protected void initIv()- Specified by:
initIvin classOAbstractPaginatedStorage
-
backup
public List<String> backup(OutputStream out, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener, int compressionLevel, int bufferSize) Description copied from interface:OBackupableExecutes a backup of the database. During the backup the database will be frozen in read-only mode.- Parameters:
out- OutputStream used to write the backup content. Use a FileOutputStream to make the backup persistent on diskoptions- Backup options as Map<String, Object> objectcallable- Callback to execute when the database is lockediListener- Listener called for backup messagescompressionLevel- ZIP Compression level between 1 (the minimum) and 9 (maximum). The bigger is the compression, the smaller will be the final backup content, but will consume more CPU and time to executebufferSize- Buffer size in bytes, the bigger is the buffer, the more efficient will be the compression- See Also:
-
restore
public void restore(InputStream in, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener) Description copied from interface:OBackupableExecutes a restore of a database backup. During the restore the database will be frozen in read-only mode.- Parameters:
in- InputStream used to read the backup content. Use a FileInputStream to read a backup on a diskoptions- Backup options as Map<String, Object> objectcallable- Callback to execute when the database is lockediListener- Listener called for backup messages- See Also:
-
copyWALToIncrementalBackup
protected OLogSequenceNumber copyWALToIncrementalBackup(ZipOutputStream zipOutputStream, long startSegment) - Specified by:
copyWALToIncrementalBackupin classOAbstractPaginatedStorage
-
isWriteAllowedDuringIncrementalBackup
protected boolean isWriteAllowedDuringIncrementalBackup()- Specified by:
isWriteAllowedDuringIncrementalBackupin classOAbstractPaginatedStorage
-
createWalTempDirectory
- Specified by:
createWalTempDirectoryin classOAbstractPaginatedStorage
-
addFileToDirectory
- Specified by:
addFileToDirectoryin classOAbstractPaginatedStorage
-
createWalFromIBUFiles
protected OWriteAheadLog createWalFromIBUFiles(File directory, OContextConfiguration contextConfiguration, Locale locale, byte[] iv) - Specified by:
createWalFromIBUFilesin classOAbstractPaginatedStorage
-
shutdown
public void shutdown()Description copied from interface:OStorageThis method is called inOrient.shutdown()method. For most of the storages it means that storage will be merely closed, but sometimes additional operations are need to be taken in account.- Specified by:
shutdownin interfaceOStorage- Overrides:
shutdownin classOAbstractPaginatedStorage
-
checkBackupRunning
protected void checkBackupRunning()- Overrides:
checkBackupRunningin classOAbstractPaginatedStorage
-
checkAndCleanPath
- Specified by:
checkAndCleanPathin classOAbstractPaginatedStorage
-
isMemory
public boolean isMemory()- Specified by:
isMemoryin interfaceOStorage- Overrides:
isMemoryin classOAbstractPaginatedStorage
-