public class PageFile extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PageFile.MetaData
The MetaData object hold the persistent data associated with a PageFile object.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PAGE_CACHE_SIZE |
static int |
DEFAULT_PAGE_SIZE |
static int |
DEFAULT_WRITE_BATCH_SIZE |
Constructor and Description |
---|
PageFile(File directory,
String name)
Creates a PageFile in the specified directory who's data files are named by name.
|
Modifier and Type | Method and Description |
---|---|
void |
allowIOResumption() |
void |
archive() |
void |
delete()
Deletes the files used by the PageFile object.
|
void |
flush()
Flush and sync all write buffers to disk.
|
void |
freePage(long pageId) |
File |
getDirectory() |
long |
getDiskSize() |
File |
getFile() |
File |
getFreeFile() |
long |
getFreePageCount() |
float |
getLFUEvictionFactor() |
int |
getPageCacheSize() |
int |
getPageContentSize() |
long |
getPageCount() |
int |
getPageSize() |
File |
getRecoveryFile() |
int |
getRecoveryFileMaxPageCount() |
int |
getRecoveryFileMinPageCount() |
int |
getWriteBatchSize() |
boolean |
isEnableDiskSyncs() |
boolean |
isEnabledWriteThread() |
boolean |
isEnablePageCaching() |
boolean |
isEnableRecoveryFile()
Is the recovery buffer used to double buffer page writes.
|
boolean |
isFreePage(long pageId) |
boolean |
isLoaded() |
boolean |
isUseLFRUEviction() |
void |
load()
Loads the page file so that it can be accessed for read/write purposes.
|
void |
removeTmpFile(File file) |
void |
setEnableDiskSyncs(boolean syncWrites)
Allows you enable syncing writes to disk.
|
void |
setEnablePageCaching(boolean enablePageCaching) |
void |
setEnableRecoveryFile(boolean doubleBuffer)
Sets if the recovery buffer uses to double buffer page writes.
|
void |
setEnableWriteThread(boolean enableAsyncWrites) |
void |
setLFUEvictionFactor(float LFUEvictionFactor) |
void |
setPageCacheSize(int pageCacheSize) |
void |
setPageSize(int pageSize)
Configures the page size used by the page file.
|
void |
setRecoveryFileMaxPageCount(int recoveryFileMaxPageCount) |
void |
setRecoveryFileMinPageCount(int recoveryFileMinPageCount) |
void |
setUseLFRUEviction(boolean useLFRUEviction) |
void |
setWriteBatchSize(int writeBatchSize) |
long |
toOffset(long pageId) |
String |
toString() |
Transaction |
tx() |
void |
unload()
Unloads a previously loaded PageFile.
|
public static final int DEFAULT_PAGE_SIZE
public static final int DEFAULT_WRITE_BATCH_SIZE
public static final int DEFAULT_PAGE_CACHE_SIZE
public Transaction tx()
public void delete() throws IOException
IOException
- if the files cannot be deleted.IllegalStateException
- if this PageFile is loadedpublic void archive() throws IOException
IOException
public void load() throws IOException, IllegalStateException
IOException
- If the page file cannot be loaded. This could be cause the existing page file is corrupt is a bad version or if
there was a disk error.IllegalStateException
- If the page file was already loaded.public void unload() throws IOException
IOException
- if there was a disk error occurred while closing the down the page file.IllegalStateException
- if the PageFile is not loadedpublic boolean isLoaded()
public void allowIOResumption()
public void flush() throws IOException
IOException
- If an disk error occurred.public File getFreeFile()
public File getRecoveryFile()
public long toOffset(long pageId)
public boolean isEnableRecoveryFile()
public void setEnableRecoveryFile(boolean doubleBuffer)
public boolean isEnableDiskSyncs()
public void setEnableDiskSyncs(boolean syncWrites)
public int getPageSize()
public int getPageContentSize()
public void setPageSize(int pageSize) throws IllegalStateException
pageSize
- the pageSize to setIllegalStateException
- once the page file is loaded.public boolean isEnablePageCaching()
public void setEnablePageCaching(boolean enablePageCaching)
enablePageCaching
- allows you to enable read page cachingpublic int getPageCacheSize()
public void setPageCacheSize(int pageCacheSize)
pageCacheSize
- Sets the maximum number of pages that will get stored in the read page cache.public boolean isEnabledWriteThread()
public void setEnableWriteThread(boolean enableAsyncWrites)
public long getDiskSize() throws IOException
IOException
public boolean isFreePage(long pageId)
public long getPageCount()
public int getRecoveryFileMinPageCount()
public long getFreePageCount()
public void setRecoveryFileMinPageCount(int recoveryFileMinPageCount)
public int getRecoveryFileMaxPageCount()
public void setRecoveryFileMaxPageCount(int recoveryFileMaxPageCount)
public int getWriteBatchSize()
public void setWriteBatchSize(int writeBatchSize)
public float getLFUEvictionFactor()
public void setLFUEvictionFactor(float LFUEvictionFactor)
public boolean isUseLFRUEviction()
public void setUseLFRUEviction(boolean useLFRUEviction)
public void freePage(long pageId)
public void removeTmpFile(File file)
public File getDirectory()
Copyright © 2005–2019 FuseSource, Corp.. All rights reserved.