Package one.microstream.storage.types
Class StorageDataFile.Default
java.lang.Object
one.microstream.storage.types.StorageDataFile.Default
- All Implemented Interfaces:
StorageChannelFile
,StorageDataFile<StorageEntity.Default>
,StorageFile
,StorageHashChannelPart
,StorageInventoryFile
,StorageLockedFile
,StorageNumberedFile
- Enclosing interface:
- StorageDataFile<I extends StorageEntityCacheItem<I>>
public static final class StorageDataFile.Default extends Object implements StorageDataFile<StorageEntity.Default>
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.storage.types.StorageDataFile
StorageDataFile.Default
-
Constructor Summary
Constructors Constructor Description Default()
-
Method Summary
Modifier and Type Method Description void
appendEntry(StorageEntity.Default entry)
int
channelIndex()
boolean
clearUsages(StorageFileUser fileUser)
void
close()
double
dataFillRatio()
long
dataLength()
boolean
delete()
static StorageDataFile.Default
Dummy()
boolean
executeIfUnsued(Consumer<? super StorageLockedFile> action)
boolean
executeIfUnsuedData(Consumer<? super StorageDataFile.Default> action)
boolean
exists()
long
exportTo(StorageLockedFile file)
long
exportTo(StorageLockedFile file, long sourceOffset, long length)
FileChannel
fileChannel()
boolean
hasSingleEntity()
Querying method to check if a storage file consists of only one singular live entity.boolean
hasUsers()
String
identifier()
Returns a string uniquely identifying the file represented by this instance.boolean
isHeadFile()
void
loadEntityData(StorageEntity.Default entity, long length, long cacheChange)
String
name()
Return a compact string containing a specific, but not necessarily unique name of the file represented by this instance.static StorageDataFile.Default
New(StorageFileManager.Default parent, StorageInventoryFile file)
long
number()
void
prependEntry(StorageEntity.Default entry)
String
qualifier()
Returns a string that givesStorageFile.name()
a unique identity.boolean
registerUsage(StorageFileUser fileUser)
void
remove(StorageEntity.Default entity)
String
toString()
long
totalLength()
boolean
tryClose()
boolean
unregisterUsage(StorageFileUser fileUser)
boolean
unregisterUsageClosing(StorageFileUser fileUser, Consumer<? super StorageLockedFile> closingAction)
boolean
unregisterUsageClosingData(StorageFileUser fileUser, Consumer<? super StorageDataFile.Default> closingAction)
-
Constructor Details
-
Default
public Default()
-
-
Method Details
-
Dummy
-
New
public static final StorageDataFile.Default New(StorageFileManager.Default parent, StorageInventoryFile file) -
exportTo
- Specified by:
exportTo
in interfaceStorageDataFile<StorageEntity.Default>
-
exportTo
- Specified by:
exportTo
in interfaceStorageDataFile<StorageEntity.Default>
-
number
public final long number()- Specified by:
number
in interfaceStorageNumberedFile
-
totalLength
public final long totalLength()- Specified by:
totalLength
in interfaceStorageDataFile<StorageEntity.Default>
-
dataLength
public final long dataLength()- Specified by:
dataLength
in interfaceStorageDataFile<StorageEntity.Default>
-
dataFillRatio
public final double dataFillRatio()- Specified by:
dataFillRatio
in interfaceStorageDataFile<StorageEntity.Default>
-
hasSingleEntity
public final boolean hasSingleEntity()Description copied from interface:StorageDataFile
Querying method to check if a storage file consists of only one singular live entity. This is necessary to avoid dissolving files that are oversized because of one single oversized entity.- Specified by:
hasSingleEntity
in interfaceStorageDataFile<StorageEntity.Default>
- Returns:
- true if the file containts exactely one live entity.
-
remove
- Specified by:
remove
in interfaceStorageDataFile<StorageEntity.Default>
-
prependEntry
- Specified by:
prependEntry
in interfaceStorageDataFile<StorageEntity.Default>
-
appendEntry
- Specified by:
appendEntry
in interfaceStorageDataFile<StorageEntity.Default>
-
loadEntityData
- Specified by:
loadEntityData
in interfaceStorageDataFile<StorageEntity.Default>
-
hasUsers
public boolean hasUsers()- Specified by:
hasUsers
in interfaceStorageLockedFile
-
executeIfUnsued
- Specified by:
executeIfUnsued
in interfaceStorageLockedFile
-
registerUsage
- Specified by:
registerUsage
in interfaceStorageLockedFile
-
clearUsages
- Specified by:
clearUsages
in interfaceStorageLockedFile
-
unregisterUsage
- Specified by:
unregisterUsage
in interfaceStorageLockedFile
-
unregisterUsageClosing
public boolean unregisterUsageClosing(StorageFileUser fileUser, Consumer<? super StorageLockedFile> closingAction)- Specified by:
unregisterUsageClosing
in interfaceStorageLockedFile
-
unregisterUsageClosingData
public final boolean unregisterUsageClosingData(StorageFileUser fileUser, Consumer<? super StorageDataFile.Default> closingAction) -
executeIfUnsuedData
-
close
public void close()- Specified by:
close
in interfaceStorageFile
- Specified by:
close
in interfaceStorageLockedFile
-
tryClose
public boolean tryClose()- Specified by:
tryClose
in interfaceStorageLockedFile
-
isHeadFile
public boolean isHeadFile()- Specified by:
isHeadFile
in interfaceStorageDataFile<StorageEntity.Default>
-
channelIndex
public int channelIndex()- Specified by:
channelIndex
in interfaceStorageHashChannelPart
-
qualifier
Description copied from interface:StorageFile
Returns a string that givesStorageFile.name()
a unique identity. Example: The parent directory path of a file.- Specified by:
qualifier
in interfaceStorageFile
-
identifier
Description copied from interface:StorageFile
Returns a string uniquely identifying the file represented by this instance.- Specified by:
identifier
in interfaceStorageFile
- Returns:
- this file's unique identifier.
- See Also:
StorageFile.name()
-
name
Description copied from interface:StorageFile
Return a compact string containing a specific, but not necessarily unique name of the file represented by this instance. Might be the same string returned byStorageFile.identifier()
.- Specified by:
name
in interfaceStorageFile
- Returns:
- this file's name.
- See Also:
StorageFile.identifier()
-
delete
public boolean delete()- Specified by:
delete
in interfaceStorageFile
-
exists
public boolean exists()- Specified by:
exists
in interfaceStorageFile
-
fileChannel
- Specified by:
fileChannel
in interfaceStorageFile
-
toString
-