Class OLocalPaginatedStorage
java.lang.Object
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage
com.orientechnologies.orient.core.storage.disk.OLocalPaginatedStorage
- All Implemented Interfaces:
OBackgroundExceptionListener,OCheckpointRequestListener,OFreezableStorageComponent,OPageIsBrokenListener,OIdentifiableStorage,OStorage,OStorageInfo,OBackupable
- Since:
- 28.03.13
- 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
FieldsModifier and TypeFieldDescriptionprotected byte[]protected static final Stringprotected static final longFields inherited from class com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage
atomicOperationsManager, atomicOperationsTable, componentsFactory, configuration, context, DATABASE_INSTANCE_ID, error, fuzzyCheckpointExecutor, name, readCache, sbTreeCollectionManager, stateLock, status, storageThreadGroup, url, writeAheadLog, writeCacheFields inherited from interface com.orientechnologies.orient.core.storage.OStorage
CLUSTER_DEFAULT_NAME -
Constructor Summary
ConstructorsConstructorDescriptionOLocalPaginatedStorage(String name, String filePath, int id, OReadCache readCache, OClosableLinkedContainer<Long, OFile> files, long walMaxSegSize, long doubleWriteLogMaxSegSize, 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 iOutput, int compressionLevel, int bufferSize) Executes a backup of the database.protected voidprotected OStartupMetadataprotected voidprotected OLogSequenceNumbercopyWALToIncrementalBackup(ZipOutputStream zipOutputStream, long startSegment) voidcreate(OContextConfiguration contextConfiguration) protected OWriteAheadLogcreateWalFromIBUFiles(File directory, OContextConfiguration contextConfiguration, Locale locale, byte[] iv) protected Filestatic voiddeleteFilesFromDisc(String name, int maxRetries, int waitTime, String databaseDirectory) final booleanexists()static booleanprotected byte[]getIv()protected Stringfinal PathgetType()Returns the storage's type.getURL()protected voidinitConfiguration(OAtomicOperation atomicOperation, OContextConfiguration contextConfiguration) protected voidinitIv()protected voidinitWalAndDiskCache(OContextConfiguration contextConfiguration) protected booleanisDirty()protected booleanprotected voidprotected voidpostCloseSteps(boolean onDelete, boolean internalError, long lastTxId) protected voidpostCloseStepsAfterLock(Map<String, Object> params) protected voidprotected voidprotected voidreadIv()final voidrestore(InputStream in, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener) Executes a restore of a database backup.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, checkName, checkOpennessAndMigration, cleanOutRecord, clearIndex, clearProperties, close, close, closeClusters, closeIndexes, command, commit, commit, commitPreAllocated, count, count, count, count, countRecords, createRecord, delete, deleteIndexEngine, deleteRecord, deleteTreeRidBag, dropCluster, dropCluster, endDDL, executeCommand, extractEngineAPIVersion, extractTransactionsFromWal, fireConfigurationUpdateNotifications, floorPhysicalPositions, flushAllData, 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, getLastCloseTime, getLastClusterPosition, getLastMetadata, getLSN, getMode, getName, getPhysicalClusterNameById, getReadCache, getRecordConflictStrategy, getRecordMetadata, getRecordScanned, getRecordStatus, getRecoverListener, getRidsGroupedByCluster, getSBtreeCollectionManager, getSessionCount, getSize, getStatus, getUnderlying, getUuid, getVersion, getVersionForKey, getWALInstance, getWriteCache, hasIndexRangeQuerySupport, higherPhysicalPositions, incOnOpen, incrementalBackup, isAssigningClusterIds, isClosed, isDeleted, isDistributed, isInError, isMemory, isRemote, isSystemCluster, iterateIndexEntriesBetween, iterateIndexEntriesMajor, iterateIndexEntriesMinor, loadEncryption, loadExternalIndexEngine, loadIndexEngine, logAndPrepareForRethrow, logAndPrepareForRethrow, logAndPrepareForRethrow, logAndPrepareForRethrow, logAndPrepareForRethrow, logAndPrepareForRethrow, lowerPhysicalPositions, makeFuzzyCheckpoint, metadataOnly, moveToErrorStateIfNeeded, normalizeName, onException, open, open, openClusters, openIndexes, pageIsBroken, pauseConfigurationUpdateNotifications, postCreateSteps, preallocateRids, putIndexValue, putRidIndexEntry, readDatabaseInstanceId, readRecord, readRecordIfVersionIsNotLatest, registerRecoverListener, release, releaseReadLock, releaseWriteLock, reload, removeKeyFromIndex, removeProperty, removeRidIndexEntry, requestCheckpoint, resolveObjectSerializer, restoreAtomicUnit, restoreFrom, restoreFromIncrementalBackup, restoreFullIncrementalBackup, setCharset, setClusterAttribute, setClusterSelection, setConflictStrategy, setDateFormat, setDateTimeFormat, setDefaultClusterId, setIndexMgrRecordId, setLocaleCountry, setLocaleLanguage, setMinimumClusters, setProperty, setRecordSerializer, setSchemaRecordId, setStorageConfigurationUpdateListener, setTimeZone, setValidation, shutdown, startDDL, supportIncremental, synch, toString, unregisterRecoverListener, updateIndexEntry, updateRecord, validatedPutIndexValue, wereDataRestoredAfterOpen, wereNonTxOperationsPerformedInPreviousOpenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.orientechnologies.orient.core.storage.OStorage
isIcrementalBackupRunning
-
Field Details
-
IV_SEED
protected static final long IV_SEED- See Also:
-
IV_NAME
- See Also:
-
iv
protected volatile byte[] iv
-
-
Constructor Details
-
OLocalPaginatedStorage
public OLocalPaginatedStorage(String name, String filePath, int id, OReadCache readCache, OClosableLinkedContainer<Long, OFile> files, long walMaxSegSize, long doubleWriteLogMaxSegSize, OrientDBInternal context)
-
-
Method Details
-
create
- Specified by:
createin interfaceOStorage- Overrides:
createin classOAbstractPaginatedStorage
-
exists
public final boolean exists() -
getURL
- Specified by:
getURLin interfaceOStorageInfo- Overrides:
getURLin classOAbstractPaginatedStorage
-
getStoragePath
-
getType
Description copied from interface:OStorageReturns the storage's type. -
backup
public final List<String> backup(OutputStream out, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iOutput, 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 lockediOutput- 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 final 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) throws IOException - Specified by:
copyWALToIncrementalBackupin classOAbstractPaginatedStorage- Throws:
IOException
-
createWalTempDirectory
- Specified by:
createWalTempDirectoryin classOAbstractPaginatedStorage
-
addFileToDirectory
protected void addFileToDirectory(String name, InputStream stream, File directory) throws IOException - Specified by:
addFileToDirectoryin classOAbstractPaginatedStorage- Throws:
IOException
-
createWalFromIBUFiles
protected OWriteAheadLog createWalFromIBUFiles(File directory, OContextConfiguration contextConfiguration, Locale locale, byte[] iv) throws IOException - Specified by:
createWalFromIBUFilesin classOAbstractPaginatedStorage- Throws:
IOException
-
checkIfStorageDirty
- Overrides:
checkIfStorageDirtyin classOAbstractPaginatedStorage- Throws:
IOException
-
initConfiguration
protected void initConfiguration(OAtomicOperation atomicOperation, OContextConfiguration contextConfiguration) throws IOException - Overrides:
initConfigurationin classOAbstractPaginatedStorage- Throws:
IOException
-
preCloseSteps
- Overrides:
preCloseStepsin classOAbstractPaginatedStorage
-
postCloseStepsAfterLock
- Overrides:
postCloseStepsAfterLockin classOAbstractPaginatedStorage
-
preCreateSteps
- Overrides:
preCreateStepsin classOAbstractPaginatedStorage- Throws:
IOException
-
postCloseSteps
protected void postCloseSteps(boolean onDelete, boolean internalError, long lastTxId) throws IOException - Specified by:
postCloseStepsin classOAbstractPaginatedStorage- Throws:
IOException
-
postDeleteSteps
protected void postDeleteSteps()- Overrides:
postDeleteStepsin classOAbstractPaginatedStorage
-
deleteFilesFromDisc
-
makeStorageDirty
- Overrides:
makeStorageDirtyin classOAbstractPaginatedStorage- Throws:
IOException
-
clearStorageDirty
- Overrides:
clearStorageDirtyin classOAbstractPaginatedStorage- Throws:
IOException
-
isDirty
protected boolean isDirty()- Overrides:
isDirtyin classOAbstractPaginatedStorage
-
getOpenedAtVersion
- Overrides:
getOpenedAtVersionin classOAbstractPaginatedStorage
-
isWriteAllowedDuringIncrementalBackup
protected boolean isWriteAllowedDuringIncrementalBackup()- Specified by:
isWriteAllowedDuringIncrementalBackupin classOAbstractPaginatedStorage
-
initIv
- Specified by:
initIvin classOAbstractPaginatedStorage- Throws:
IOException
-
readIv
- Specified by:
readIvin classOAbstractPaginatedStorage- Throws:
IOException
-
getIv
protected byte[] getIv()- Specified by:
getIvin classOAbstractPaginatedStorage
-
initWalAndDiskCache
protected void initWalAndDiskCache(OContextConfiguration contextConfiguration) throws IOException, InterruptedException - Specified by:
initWalAndDiskCachein classOAbstractPaginatedStorage- Throws:
IOExceptionInterruptedException
-
exists
-
checkBackupRunning
protected void checkBackupRunning()- Specified by:
checkBackupRunningin classOAbstractPaginatedStorage
-