Class StorageConnection.Default

  • All Implemented Interfaces:
    one.microstream.persistence.types.PersistenceStoring, one.microstream.persistence.types.Persister, one.microstream.persistence.types.Unpersistable, one.microstream.reference.ObjectSwizzling, StorageConnection
    Enclosing interface:
    StorageConnection

    public static final class StorageConnection.Default
    extends Object
    implements StorageConnection, one.microstream.persistence.types.Unpersistable
    • Method Detail

      • issueGarbageCollection

        public final boolean issueGarbageCollection​(long nanoTimeBudget)
        Description copied from interface: StorageConnection
        Issues garbage collection to be executed, limited to the time budget in nanoseconds specified by the passed nanoTimeBudget.
        When the time budget is used up, the garbage collector will keep the current progress and continue there at the next opportunity. The same progress marker is used by the implicit housekeeping, so both mechanisms will continue on the same progress.
        If no store has occurred since the last completed garbage sweep, this method will have no effect and return immediately.
        Specified by:
        issueGarbageCollection in interface StorageConnection
        Parameters:
        nanoTimeBudget - the time budget in nanoseconds to be used to perform garbage collection.
        Returns:
        whether the returned call has completed garbage collection.
        See Also:
        StorageConnection.issueFullGarbageCollection()
      • issueFileCheck

        public final boolean issueFileCheck​(long nanoTimeBudget)
        Description copied from interface: StorageConnection
        Issues a storage file check to be executed, limited to the time budget in nanoseconds specified by the passed nanoTimeBudget.
        When the time budget is used up, the checking logic will keep the current progress and continue there at the next opportunity. The same progress marker is used by the implicit housekeeping, so both mechanisms will continue on the same progress.
        If no store has occurred since the last completed check, this method will have no effect and return immediately.
        Specified by:
        issueFileCheck in interface StorageConnection
        Parameters:
        nanoTimeBudget - the time budget in nanoseconds to be used to perform file checking.
        Returns:
        whether the returned call has completed file checking.
      • issueFullBackup

        public final void issueFullBackup​(StorageLiveFileProvider targetFileProvider,
                                          one.microstream.persistence.types.PersistenceTypeDictionaryExporter typeDictionaryExporter)
        Description copied from interface: StorageConnection
        Issues a full backup of the whole storage to be executed. Keep in mind that this could result in a very long running operation, depending on the storage size.
        Although the full backup may be a valid solution in some circumstances, the incremental backup should be preferred, since it is by far more efficient.
        Specified by:
        issueFullBackup in interface StorageConnection
        Parameters:
        targetFileProvider - file provider for backup files
        typeDictionaryExporter - custom type dictionary exporter
      • exportChannels

        public void exportChannels​(StorageLiveFileProvider fileProvider,
                                   boolean performGarbageCollection)
        Description copied from interface: StorageConnection
        Exports the data of all channels in the storage by using the passed StorageLiveFileProvider instance.
        This is basically a simple file copy applied to all files in the storage, however with the guaranteed safety of no other task / access to the storage's files intervening with the ongoing process. This is useful to safely create a complete copy of the storage, e.g. a full backup.
        Specified by:
        exportChannels in interface StorageConnection
        Parameters:
        fileProvider - the StorageLiveFileProvider logic to be used for the export.
        performGarbageCollection - whether a StorageConnection.issueFullGarbageCollection() shall be issued before performing the export.
      • importFiles

        public void importFiles​(one.microstream.collections.types.XGettingEnum<one.microstream.afs.types.AFile> importFiles)
        Description copied from interface: StorageConnection
        Imports all files specified by the passed Enum (ordered set) of AFile in order.
        The files are assumed to be in the native binary format used internally by the storage.
        All entities contained in the specified files will be imported. If they already exist in the storage (identified by their ObjectId), their current data will be replaced by the imported data.
        Note that importing data that is not reachable from any root entity will have no effect and will eventually be deleted by the garbage collector.
        Specified by:
        importFiles in interface StorageConnection
        Parameters:
        importFiles - the files whose native binary content shall be imported.
      • importData

        public void importData​(one.microstream.collections.types.XGettingEnum<ByteBuffer> importData)
        Description copied from interface: StorageConnection
        Imports all data specified by the passed Enum (ordered set) of ByteBuffer in order.
        The buffers are assumed to be in the native binary format used internally by the storage.
        All entities contained in the specified buffers will be imported. If they already exist in the storage (identified by their ObjectId), their current data will be replaced by the imported data.
        Note that importing data that is not reachable from any root entity will have no effect and will eventually be deleted by the garbage collector.
        Specified by:
        importData in interface StorageConnection
        Parameters:
        importData - the files whose native binary content shall be imported.