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()
double
dataFillRatio()
long
dataLength()
boolean
decrementUserCount()
boolean
delete()
static StorageDataFile.Default
Dummy()
boolean
exists()
long
exportTo(StorageLockedFile file)
long
exportTo(StorageLockedFile file, long sourceOffset, long length)
FileChannel
fileChannel()
boolean
hasNoUsers()
boolean
hasSingleEntity()
Querying method to check if a storage file consists of only one singular live entity.String
identifier()
Returns a string uniquely identifying the file represented by this instance.int
incrementUserCount()
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.void
remove(StorageEntity.Default entity)
String
toString()
long
totalLength()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface one.microstream.storage.types.StorageFile
close, flush, isEmpty, isOpen
-
Methods inherited from interface one.microstream.storage.types.StorageInventoryFile
inventorize
-
Methods inherited from interface one.microstream.storage.types.StorageLockedFile
length
-
-
-
-
Method Detail
-
Dummy
public static final StorageDataFile.Default Dummy()
-
New
public static final StorageDataFile.Default New(StorageFileManager.Default parent, StorageInventoryFile file)
-
exportTo
public final long exportTo(StorageLockedFile file)
- Specified by:
exportTo
in interfaceStorageDataFile<StorageEntity.Default>
-
exportTo
public final long exportTo(StorageLockedFile file, long sourceOffset, long length)
- 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
public void remove(StorageEntity.Default entity)
- Specified by:
remove
in interfaceStorageDataFile<StorageEntity.Default>
-
prependEntry
public final void prependEntry(StorageEntity.Default entry)
- Specified by:
prependEntry
in interfaceStorageDataFile<StorageEntity.Default>
-
appendEntry
public final void appendEntry(StorageEntity.Default entry)
- Specified by:
appendEntry
in interfaceStorageDataFile<StorageEntity.Default>
-
loadEntityData
public final void loadEntityData(StorageEntity.Default entity, long length, long cacheChange)
- Specified by:
loadEntityData
in interfaceStorageDataFile<StorageEntity.Default>
-
incrementUserCount
public int incrementUserCount()
- Specified by:
incrementUserCount
in interfaceStorageLockedFile
-
decrementUserCount
public boolean decrementUserCount()
- Specified by:
decrementUserCount
in interfaceStorageLockedFile
-
hasNoUsers
public boolean hasNoUsers()
- Specified by:
hasNoUsers
in interfaceStorageLockedFile
-
isHeadFile
public boolean isHeadFile()
- Specified by:
isHeadFile
in interfaceStorageDataFile<StorageEntity.Default>
-
channelIndex
public int channelIndex()
- Specified by:
channelIndex
in interfaceStorageHashChannelPart
-
qualifier
public String qualifier()
Description copied from interface:StorageFile
Returns a string that givesStorageFile.name()
a unique identity. Example: The parent directory path of aFile
.- Specified by:
qualifier
in interfaceStorageFile
-
identifier
public String 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
public String 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
public FileChannel fileChannel()
- Specified by:
fileChannel
in interfaceStorageFile
-
-