Interface OBackupable
- All Known Subinterfaces:
ODatabase<T>,ODatabaseDocument,ODatabaseDocumentInternal,ODatabaseInternal<T>,ODatabaseObject,ODatabaseSession
- All Known Implementing Classes:
ODatabaseDocumentAbstract,ODatabaseDocumentDistributed,ODatabaseDocumentDistributedPooled,ODatabaseDocumentEmbedded,ODatabaseDocumentEmbeddedPooled,ODatabaseDocumentRemote,ODatabaseDocumentRemotePooled,ODatabaseWrapperAbstract,OObjectDatabaseTx
public interface OBackupable
Interface to claim the resource can be backed up ad restored.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com) (l.garulli-at-orientdb.com)
-
Method Summary
Modifier and TypeMethodDescriptionbackup(OutputStream out, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener, int compressionLevel, int bufferSize) Executes a backup of the database.voidrestore(InputStream in, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener) Executes a restore of a database backup.
-
Method Details
-
backup
List<String> backup(OutputStream out, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener, int compressionLevel, int bufferSize) throws IOExceptionExecutes 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- Throws:
IOException- See Also:
-
restore
void restore(InputStream in, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener) throws IOExceptionExecutes 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- Throws:
IOException- See Also:
-