public interface OWriteCache
Modifier and Type | Method and Description |
---|---|
void |
addBackgroundExceptionListener(OBackgroundExceptionListener listener)
Adds listener which is triggered if exception is cast inside background flush data thread.
|
long |
addFile(String fileName) |
long |
addFile(String fileName,
long fileId) |
void |
addLowDiskSpaceListener(OLowDiskSpaceListener listener) |
void |
addPageIsBrokenListener(OPageIsBrokenListener listener)
Adds listener which is called by cache if corruption of file page is detected.
|
int |
allocateNewPage(long fileId) |
long |
bookFileId(String fileName) |
void |
checkCacheOverflow() |
boolean |
checkLowDiskSpace() |
OPageDataVerificationError[] |
checkStoredPages(OCommandOutputListener commandOutputListener) |
long[] |
close() |
void |
close(long fileId,
boolean flush) |
void |
create() |
long[] |
delete() |
void |
deleteFile(long fileId) |
boolean |
exists(long fileId) |
boolean |
exists(String fileName) |
long |
externalFileId(int fileId)
Converts unique internal file id to external one.
|
long |
fileIdByName(String fileName)
Returns id associated with given file or value < 0 if such file does not exist.
|
boolean |
fileIdsAreEqual(long firsId,
long secondId)
DO NOT DELETE THIS METHOD IT IS USED IN ENTERPRISE STORAGE
|
String |
fileNameById(long fileId) |
Map<String,Long> |
files() |
void |
flush() |
void |
flush(long fileId) |
void |
flushTillSegment(long segmentId) |
long |
getExclusiveWriteCachePagesSize() |
long |
getFilledUpTo(long fileId) |
int |
getId() |
Long |
getMinimalNotFlushedSegment() |
Path |
getRootDirectory()
Directory which contains all files managed by write cache.
|
int |
internalFileId(long fileId)
Returns internal file id which is unique and always the same for given file in contrary to
external id which changes over close/open cycle of cache.
|
OCachePointer |
load(long fileId,
long startPageIndex,
OModifiableBoolean cacheHit,
boolean verifyChecksums) |
long |
loadFile(String fileName)
Registers new file in write cache and returns file id assigned to this file.
|
void |
makeFuzzyCheckpoint(long segmentId,
byte[] lastMetadata) |
String |
nativeFileNameById(long fileId)
Obtains native file name by the given file id.
|
void |
open() |
int |
pageSize()
DO NOT DELETE THIS METHOD IT IS USED IN ENTERPRISE STORAGE
|
void |
removeBackgroundExceptionListener(OBackgroundExceptionListener listener)
Removes listener which is triggered if exception is cast inside background flush data thread.
|
void |
removeLowDiskSpaceListener(OLowDiskSpaceListener listener) |
void |
removePageIsBrokenListener(OPageIsBrokenListener listener)
Removes listener which is called by cache if corruption of file page is detected.
|
void |
renameFile(long fileId,
String newFileName) |
String |
restoreFileById(long fileId)
Finds if there was file in write cache with given id which is deleted right now.
|
void |
restoreModeOff() |
void |
restoreModeOn() |
void |
store(long fileId,
long pageIndex,
OCachePointer dataPointer) |
void |
truncateFile(long fileId) |
void |
updateDirtyPagesTable(OCachePointer pointer,
OLogSequenceNumber startLSN) |
void addPageIsBrokenListener(OPageIsBrokenListener listener)
void removePageIsBrokenListener(OPageIsBrokenListener listener)
void addLowDiskSpaceListener(OLowDiskSpaceListener listener)
void removeLowDiskSpaceListener(OLowDiskSpaceListener listener)
long bookFileId(String fileName)
long loadFile(String fileName) throws IOException
File id consist of two parts:
internalFileId(long)
If file with the same name is deleted and then new file is created this file with have the same internal id.
fileName
- Name of file to register inside storage.IOException
long addFile(String fileName) throws IOException
IOException
long addFile(String fileName, long fileId) throws IOException
IOException
long fileIdByName(String fileName)
fileName
- File name id of which has to be returned.boolean checkLowDiskSpace() throws IOException
IOException
void makeFuzzyCheckpoint(long segmentId, byte[] lastMetadata) throws IOException
IOException
void flushTillSegment(long segmentId)
boolean exists(String fileName)
boolean exists(long fileId)
void restoreModeOn() throws IOException
IOException
void restoreModeOff()
void store(long fileId, long pageIndex, OCachePointer dataPointer)
void checkCacheOverflow() throws InterruptedException
InterruptedException
int allocateNewPage(long fileId) throws IOException
IOException
OCachePointer load(long fileId, long startPageIndex, OModifiableBoolean cacheHit, boolean verifyChecksums) throws IOException
IOException
void flush(long fileId)
void flush()
long getFilledUpTo(long fileId)
long getExclusiveWriteCachePagesSize()
void deleteFile(long fileId) throws IOException
IOException
void truncateFile(long fileId) throws IOException
IOException
void renameFile(long fileId, String newFileName) throws IOException
IOException
long[] close() throws IOException
IOException
void close(long fileId, boolean flush)
OPageDataVerificationError[] checkStoredPages(OCommandOutputListener commandOutputListener)
long[] delete() throws IOException
IOException
String fileNameById(long fileId)
String nativeFileNameById(long fileId)
Native file name is a file name of a "physical" on-disk file, it may differ from the "virtual" logical file name.
fileId
- the file id to obtain the native file name of.null
if the passed file id doesn't correspond
to any file.int getId()
int pageSize()
boolean fileIdsAreEqual(long firsId, long secondId)
Takes two ids and checks whether they are equal from point of view of write cache. In other words methods checks whether two ids in reality contain the same internal ids.
String restoreFileById(long fileId) throws IOException
fileId
- If of file which should be restorednull
if such name does not existIOException
void addBackgroundExceptionListener(OBackgroundExceptionListener listener)
listener
- Listener to triggervoid removeBackgroundExceptionListener(OBackgroundExceptionListener listener)
listener
- Listener to removePath getRootDirectory()
null
in case
of in memory database.int internalFileId(long fileId)
fileId
- External file id.long externalFileId(int fileId)
fileId
- Internal file id.internalFileId(long)
,
getId()
Long getMinimalNotFlushedSegment()
void updateDirtyPagesTable(OCachePointer pointer, OLogSequenceNumber startLSN)
void create() throws IOException
IOException
void open() throws IOException
IOException
Copyright © 2009–2020 OrientDB. All rights reserved.