|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.persistent.PageFile<P>
P
- Page typepublic abstract class PageFile<P extends Page<P>>
Abstract class implementing general methods of a PageFile. A PageFile stores
objects that implement the Page
interface.
Field Summary | |
---|---|
protected Cache<P> |
cache
The cache of this file. |
protected Stack<Integer> |
emptyPages
A stack holding the empty page ids. |
protected int |
nextPageID
The last page ID. |
protected int |
pageSize
The size of a page in Bytes. |
protected long |
readAccess
The read I/O-Access of this file. |
protected long |
writeAccess
The write I/O-Access of this file. |
Constructor Summary | |
---|---|
protected |
PageFile()
Creates a new PageFile. |
Method Summary | |
---|---|
void |
clear()
Clears this PageFile. |
void |
close()
Closes this file. |
void |
deletePage(int pageID)
Deletes the node with the specified id from this file. |
long |
getLogicalPageAccess()
Returns the logical read I/O-Accesses of this file. |
private Integer |
getNextEmptyPageID()
Returns the next empty page id. |
int |
getNextPageID()
Returns the next page id. |
long |
getPhysicalReadAccess()
Returns the physical read I/O-Accesses of this file. |
long |
getPhysicalWriteAccess()
Returns the physical write I/O-Accesses of this file. |
protected void |
initCache(int pageSize,
int cacheSize,
Cache<P> cache)
Initializes the cache. |
P |
readPage(int pageID)
Reads the page with the given id from this file. |
void |
resetPageAccess()
Resets the counters for page accesses of this file and flushes the cache. |
void |
setCacheSize(int cacheSize)
Sets the maximum size of the cache of this file. |
void |
setNextPageID(int nextPageID)
Sets the next page id. |
void |
setPageID(P page)
Sets the id of the given page. |
int |
writePage(P page)
Writes a page into this file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.persistent.CachedFile |
---|
objectRemoved |
Field Detail |
---|
protected Cache<P extends Page<P>> cache
protected Stack<Integer> emptyPages
protected int nextPageID
protected long readAccess
protected long writeAccess
protected int pageSize
Constructor Detail |
---|
protected PageFile()
Method Detail |
---|
public final long getPhysicalReadAccess()
public final long getPhysicalWriteAccess()
public final long getLogicalPageAccess()
public final void resetPageAccess()
public void setPageID(P page)
page
- the page to set the idpublic final int writePage(P page)
page
- the page to be written
public P readPage(int pageID)
pageID
- the id of the page to be returned
public void deletePage(int pageID)
pageID
- the id of the node to be deletedpublic void close()
public void clear()
public void setCacheSize(int cacheSize)
cacheSize
- protected void initCache(int pageSize, int cacheSize, Cache<P> cache)
pageSize
- the size of a page in BytescacheSize
- the size of the cache in Bytecache
- the class of the cache to be usedprivate Integer getNextEmptyPageID()
public int getNextPageID()
public void setNextPageID(int nextPageID)
nextPageID
- the next page id to be set
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |