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 voidappendEntry(StorageEntity.Default entry)intchannelIndex()doubledataFillRatio()longdataLength()booleandecrementUserCount()booleandelete()static StorageDataFile.DefaultDummy()booleanexists()longexportTo(StorageLockedFile file)longexportTo(StorageLockedFile file, long sourceOffset, long length)FileChannelfileChannel()booleanhasNoUsers()booleanhasSingleEntity()Querying method to check if a storage file consists of only one singular live entity.Stringidentifier()Returns a string uniquely identifying the file represented by this instance.intincrementUserCount()booleanisHeadFile()voidloadEntityData(StorageEntity.Default entity, long length, long cacheChange)Stringname()Return a compact string containing a specific, but not necessarily unique name of the file represented by this instance.static StorageDataFile.DefaultNew(StorageFileManager.Default parent, StorageInventoryFile file)longnumber()voidprependEntry(StorageEntity.Default entry)Stringqualifier()Returns a string that givesStorageFile.name()a unique identity.voidremove(StorageEntity.Default entity)StringtoString()longtotalLength()-
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:
exportToin interfaceStorageDataFile<StorageEntity.Default>
-
exportTo
public final long exportTo(StorageLockedFile file, long sourceOffset, long length)
- Specified by:
exportToin interfaceStorageDataFile<StorageEntity.Default>
-
number
public final long number()
- Specified by:
numberin interfaceStorageNumberedFile
-
totalLength
public final long totalLength()
- Specified by:
totalLengthin interfaceStorageDataFile<StorageEntity.Default>
-
dataLength
public final long dataLength()
- Specified by:
dataLengthin interfaceStorageDataFile<StorageEntity.Default>
-
dataFillRatio
public final double dataFillRatio()
- Specified by:
dataFillRatioin interfaceStorageDataFile<StorageEntity.Default>
-
hasSingleEntity
public final boolean hasSingleEntity()
Description copied from interface:StorageDataFileQuerying 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:
hasSingleEntityin interfaceStorageDataFile<StorageEntity.Default>- Returns:
- true if the file containts exactely one live entity.
-
remove
public void remove(StorageEntity.Default entity)
- Specified by:
removein interfaceStorageDataFile<StorageEntity.Default>
-
prependEntry
public final void prependEntry(StorageEntity.Default entry)
- Specified by:
prependEntryin interfaceStorageDataFile<StorageEntity.Default>
-
appendEntry
public final void appendEntry(StorageEntity.Default entry)
- Specified by:
appendEntryin interfaceStorageDataFile<StorageEntity.Default>
-
loadEntityData
public final void loadEntityData(StorageEntity.Default entity, long length, long cacheChange)
- Specified by:
loadEntityDatain interfaceStorageDataFile<StorageEntity.Default>
-
incrementUserCount
public int incrementUserCount()
- Specified by:
incrementUserCountin interfaceStorageLockedFile
-
decrementUserCount
public boolean decrementUserCount()
- Specified by:
decrementUserCountin interfaceStorageLockedFile
-
hasNoUsers
public boolean hasNoUsers()
- Specified by:
hasNoUsersin interfaceStorageLockedFile
-
isHeadFile
public boolean isHeadFile()
- Specified by:
isHeadFilein interfaceStorageDataFile<StorageEntity.Default>
-
channelIndex
public int channelIndex()
- Specified by:
channelIndexin interfaceStorageHashChannelPart
-
qualifier
public String qualifier()
Description copied from interface:StorageFileReturns a string that givesStorageFile.name()a unique identity. Example: The parent directory path of aFile.- Specified by:
qualifierin interfaceStorageFile
-
identifier
public String identifier()
Description copied from interface:StorageFileReturns a string uniquely identifying the file represented by this instance.- Specified by:
identifierin interfaceStorageFile- Returns:
- this file's unique identifier.
- See Also:
StorageFile.name()
-
name
public String name()
Description copied from interface:StorageFileReturn 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:
namein interfaceStorageFile- Returns:
- this file's name.
- See Also:
StorageFile.identifier()
-
delete
public boolean delete()
- Specified by:
deletein interfaceStorageFile
-
exists
public boolean exists()
- Specified by:
existsin interfaceStorageFile
-
fileChannel
public FileChannel fileChannel()
- Specified by:
fileChannelin interfaceStorageFile
-
-