|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the original functional interface to the OceanStore buffer cache. The old (partial) implementation is now in DataCacheImpl. The separation is so that new cache implementations can do things in their own way, without being tied to any of the old implementation's assumptions.
Method Summary | |
---|---|
void |
assign(CacheablePinned handle,
Cacheable block)
Assign a block to reserved space |
void |
assign(CacheablePinned handle,
CacheableIdentity id)
Give a reserved block an identity; if an id already exists, the new identifiers will be appended to the existing id. |
CacheablePinned |
getPinWithException(CacheableIdentity id)
Request a page and pin it (regardless if it's already pinned). |
CacheableHandle |
getWithException(CacheableIdentity id)
Request a handle to a block in the cache. |
CacheablePinned |
reserveWithException(int n)
Reserve n bytes in the cache if there is room;
otherwise throw a CacheFullException . |
LinkedList |
reserveWithException(int b,
int sz)
Reserve b blocks of sz bytes each in the
cache if there is room; otherwise throw a
CacheFullException . |
int |
totalPins()
return the total number of pins being held |
CacheableHandle |
unpin(CacheablePinned pinned)
Unpin the pinned block; it is an error to call this function if the CacheablePinned has already been used for another unpin call. |
Method Detail |
public CacheableHandle getWithException(CacheableIdentity id) throws CacheMissException
CacheMissException
- if block is not in the cachepublic CacheablePinned getPinWithException(CacheableIdentity id) throws CacheMissException
CacheMissException
- if block is not in the cachepublic void assign(CacheablePinned handle, CacheableIdentity id)
public void assign(CacheablePinned handle, Cacheable block)
public CacheablePinned reserveWithException(int n) throws CacheFullException
n
bytes in the cache if there is room;
otherwise throw a CacheFullException
.
n
- the number of bytes to reserve
CacheFullException
- if not enough space is availablepublic LinkedList reserveWithException(int b, int sz) throws CacheFullException
b
blocks of sz
bytes each in the
cache if there is room; otherwise throw a
CacheFullException
.
b
- the number of block to reservesz
- the size of each block
CacheFullException
- if not enough space is availablepublic CacheableHandle unpin(CacheablePinned pinned)
public int totalPins()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |