public class IndexedStorageFile_v0 implements Closeable
Class IndexedStorageFile_v0. Provides indexedstoragefile v0 functionality for the Hytale server.
java.lang.Object > IndexedStorageFile_v0
Field Summary
compressionLevel
Field compressionLevel.
contiguousBlobs
Field contiguousBlobs.
blobCount
Field blobCount.
segmentSize
Field segmentSize.
indexLocks
Field indexLocks.
mappedBlobIndexes
Field mappedBlobIndexes.
segmentLocks
Field segmentLocks.
nextSegmentIndexes
Field nextSegmentIndexes.
buffer
Field buffer.
storageFile
Field storageFile.
header
Field header.
dst
Field dst.
version
Field version.
indexesSize
Field indexesSize.
tempIndexBuffer
Field tempIndexBuffer.
stamp
Field stamp.
indexesLength
Field indexesLength.
tempIndexPos
Field tempIndexPos.
firstSegmentIndex
Field firstSegmentIndex.
segmentIndex2
Field segmentIndex2.
segmentLock
Field segmentLock.
segmentStamp
Field segmentStamp.
indexesStamp2
Field indexesStamp2.
value
Field value.
list
Field list.
indexPos
Field indexPos.
lock
Field lock.
segmentIndex
Field segmentIndex.
blobHeaderBuffer
Field blobHeaderBuffer.
compressedLength
Field compressedLength.
tempDest
Field tempDest.
segmentPosition
Field segmentPosition.
dataToRead
Field dataToRead.
srcLength
Field srcLength.
maxCompressedLength
Field maxCompressedLength.
dest
Field dest.
tempSrc
Field tempSrc.
oldFirstSegmentIndex
Field oldFirstSegmentIndex.
segmentsCount
Field segmentsCount.
endSegmentIndex
Field endSegmentIndex.
indexesResizeStamp
Field indexesResizeStamp.
next
Field next.
nextSegmentIndex
Field nextSegmentIndex.
indexesStamp
Field indexesStamp.
dataToWrite
Field dataToWrite.
next2
Field next2.
newLength
Field newLength.
newArray
Field newArray.
stamps
Field stamps.
segmentOffset
Field segmentOffset.
size
Field size.
index
Field index.
cur
Field cur.
Method Detail
getTempBuffer
ByteBuffer
getTempBuffer
(final int length)
Method getTempBuffer.
- Parameters:
final intlength
allocateDirect
ByteBuffer
allocateDirect
(final int length)
Method allocateDirect.
- Parameters:
final intlength
open
Method open.
- Parameters:
@Nonnull final Pathpathfinal OpenOption...options
getPath
Path
getPath
()
Method getPath.
getBlobCount
int
getBlobCount
()
Method getBlobCount.
getSegmentSize
int
getSegmentSize
()
Method getSegmentSize.
getCompressionLevel
int
getCompressionLevel
()
Method getCompressionLevel.
setCompressionLevel
void
setCompressionLevel
(final int compressionLevel)
Method setCompressionLevel.
- Parameters:
final intcompressionLevel
isContiguousBlobs
boolean
isContiguousBlobs
()
Method isContiguousBlobs.
setContiguousBlobs
void
setContiguousBlobs
(final boolean contiguousBlobs)
Method setContiguousBlobs.
- Parameters:
final booleancontiguousBlobs
create
Method create.
- Parameters:
final intblobCountfinal intsegmentSize
writeHeader
void
writeHeader
(final int blobCount, final int segmentSize)
Method writeHeader.
- Parameters:
final intblobCountfinal intsegmentSize
readHeader
void
readHeader
()
Method readHeader.
memoryMapBlobIndexes
void
memoryMapBlobIndexes
()
Method memoryMapBlobIndexes.
readNextIndexes
void
readNextIndexes
()
Method readNextIndexes.
processTempIndexes
void
processTempIndexes
()
Method processTempIndexes.
clearSegments
int
clearSegments
(final int firstSegmentIndex, @Nonnull final ByteBuffer tempIndexBuffer)
Method clearSegments.
- Parameters:
final intfirstSegmentIndex@Nonnull final ByteBuffertempIndexBuffer
size
long
size
()
Method size.
segmentSize
int
segmentSize
()
Method segmentSize.
segmentCount
int
segmentCount
()
Method segmentCount.
keys
IntList
keys
()
Method keys.
readBlobLength
int
readBlobLength
(final int blobIndex)
Method readBlobLength.
- Parameters:
final intblobIndex
readBlobCompressedLength
int
readBlobCompressedLength
(final int blobIndex)
Method readBlobCompressedLength.
- Parameters:
final intblobIndex
readBlob
ByteBuffer
readBlob
(final int blobIndex)
Method readBlob.
- Parameters:
final intblobIndex
readBlobHeader
ByteBuffer
readBlobHeader
(final int firstSegmentIndex)
Method readBlobHeader.
- Parameters:
final intfirstSegmentIndex
readSegments
ByteBuffer
readSegments
(final int firstSegmentIndex, final int compressedLength, @Nonnull final ByteBuffer tempHeaderBuffer)
Method readSegments.
- Parameters:
final intfirstSegmentIndexfinal intcompressedLength@Nonnull final ByteBuffertempHeaderBuffer
writeBlob
void
writeBlob
(final int blobIndex, @Nonnull final ByteBuffer src)
Method writeBlob.
- Parameters:
final intblobIndex@Nonnull final ByteBuffersrc
removeBlob
void
removeBlob
(final int blobIndex)
Method removeBlob.
- Parameters:
final intblobIndex
writeSegments
int
writeSegments
(final int blobIndex, @Nonnull final ByteBuffer data)
Method writeSegments.
- Parameters:
final intblobIndex@Nonnull final ByteBufferdata
findFreeSegment
SegmentRangeLock
findFreeSegment
(final int count)
Method findFreeSegment.
- Parameters:
final intcount
getNextIndex
int
getNextIndex
(final int segmentIndex)
Method getNextIndex.
- Parameters:
final intsegmentIndex
getSegmentLock
StampedLock
getSegmentLock
(final int segmentIndex)
Method getSegmentLock.
- Parameters:
final intsegmentIndex
tryWriteLockSegmentRange
SegmentRangeLock
tryWriteLockSegmentRange
(final int start, final int count)
Method tryWriteLockSegmentRange.
- Parameters:
final intstartfinal intcount
indexesLength
int
indexesLength
()
Method indexesLength.
segmentsBase
long
segmentsBase
()
Method segmentsBase.
segmentOffset
long
segmentOffset
(final int segmentIndex)
Method segmentOffset.
- Parameters:
final intsegmentIndex
segmentPosition
long
segmentPosition
(final int segmentIndex)
Method segmentPosition.
- Parameters:
final intsegmentIndex
positionToSegment
int
positionToSegment
(final long position)
Method positionToSegment.
- Parameters:
final longposition
blobHeaderPosition
long
blobHeaderPosition
(final int segmentIndex)
Method blobHeaderPosition.
- Parameters:
final intsegmentIndex
requiredSegments
int
requiredSegments
(final long dataLength)
Method requiredSegments.
- Parameters:
final longdataLength
lock
FileLock
lock
()
Method lock.
force
void
force
(final boolean metaData)
Method force.
- Parameters:
final booleanmetaData
close
void
close
()
Method close.
toString
String
toString
()
Method toString.
next
int
next
(final int len)
Method next.
- Parameters:
final intlen
length
int
length
()
Method length.
unlockRead
void
unlockRead
()
Method unlockRead.
unlockWrite
void
unlockWrite
()
Method unlockWrite.