| 限定符和类型 | 字段和说明 |
|---|---|
static String |
FILE_DELIMITER |
| 构造器和说明 |
|---|
FileIOEngine(long capacity,
boolean maintainPersistence,
String... filePaths) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
isPersistent()
File IO engine is always able to support persistent storage for the cache
|
Cacheable |
read(long offset,
int length,
CacheableDeserializer<Cacheable> deserializer)
Transfers data from file to the given byte buffer
|
void |
shutdown()
Close the file
|
void |
sync()
Sync the data to file after writing
|
String |
toString() |
void |
write(ByteBuffer srcBuffer,
long offset)
Transfers data from the given byte buffer to file
|
void |
write(ByteBuff srcBuffer,
long offset)
Transfers the data from the given MultiByteBuffer to IOEngine
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitusesSharedMemorypublic FileIOEngine(long capacity,
boolean maintainPersistence,
String... filePaths)
throws IOException
IOExceptionpublic boolean isPersistent()
isPersistent 在接口中 IOEnginepublic Cacheable read(long offset, int length, CacheableDeserializer<Cacheable> deserializer) throws IOException
read 在接口中 IOEngineoffset - The offset in the file where the first byte to be readlength - The length of buffer that should be allocated for reading
from the file channeldeserializer - The deserializer to be used to make a Cacheable from the data.IOExceptionpublic void write(ByteBuffer srcBuffer, long offset) throws IOException
write 在接口中 IOEnginesrcBuffer - the given byte buffer from which bytes are to be readoffset - The offset in the file where the first byte to be writtenIOExceptionpublic void sync()
throws IOException
sync 在接口中 IOEngineIOExceptionpublic void write(ByteBuff srcBuffer, long offset) throws IOException
IOEnginewrite 在接口中 IOEnginesrcBuffer - the given MultiBytebufffers from which bytes are to be readoffset - the offset in the IO engine where the first byte to be writtenIOExceptionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.