
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) |
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,
int pageCount,
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) |
String |
nativeFileNameById(long fileId)
Obtains native file name by the given file id.
|
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) |
void |
replaceFileContentWith(long fileId,
Path newContentFile)
Replaces the file content with the content of the provided file.
|
String |
restoreFileById(long fileId)
Finds if there was file in write cache with given id which is deleted right now.
|
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.IOExceptionlong addFile(String fileName) throws IOException
IOExceptionlong addFile(String fileName, long fileId) throws IOException
IOExceptionlong fileIdByName(String fileName)
fileName - File name id of which has to be returned.boolean checkLowDiskSpace()
throws IOException
IOExceptionvoid makeFuzzyCheckpoint(long segmentId)
throws IOException
IOExceptionvoid flushTillSegment(long segmentId)
boolean exists(String fileName)
boolean exists(long fileId)
void store(long fileId,
long pageIndex,
OCachePointer dataPointer)
void checkCacheOverflow()
throws InterruptedException
InterruptedExceptionint allocateNewPage(long fileId)
throws IOException
IOExceptionOCachePointer[] load(long fileId, long startPageIndex, int pageCount, OModifiableBoolean cacheHit, boolean verifyChecksums) throws IOException
IOExceptionvoid flush(long fileId)
void flush()
long getFilledUpTo(long fileId)
long getExclusiveWriteCachePagesSize()
void deleteFile(long fileId)
throws IOException
IOExceptionvoid truncateFile(long fileId)
throws IOException
IOExceptionvoid renameFile(long fileId,
String newFileName)
throws IOException
IOExceptionvoid replaceFileContentWith(long fileId,
Path newContentFile)
throws IOException
fileId - the file id of the file to replace the content of.newContentFile - the new content file to replace the current content with.IOExceptionlong[] close()
throws IOException
IOExceptionvoid close(long fileId,
boolean flush)
OPageDataVerificationError[] checkStoredPages(OCommandOutputListener commandOutputListener)
long[] delete()
throws IOException
IOExceptionString 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 existIOExceptionvoid 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)
Copyright © 2009–2025 OrientDB. All rights reserved.