public class SectorAllocator extends Object implements Comparable<SectorAllocator>
Modifier and Type | Field and Description |
---|---|
static int[] |
ALLOC_SIZES |
static int |
BLOB_SIZE |
Constructor and Description |
---|
SectorAllocator(ISectorManager store,
IWriteCacheManager writes) |
Modifier and Type | Method and Description |
---|---|
void |
addAddresses(ArrayList<Long> addrs) |
int |
addressSize(int offset) |
int |
alloc(int size)
Must find tag type that size fits in (or BLOB) and then find
block of type into which an allocation can be made.
|
int |
bit2tag(int bit)
Since we know that all allocations are 32 bits each, there is no need to
scan through the array.
|
void |
commit()
Called from MemoryManager to commit bits
|
int |
compareTo(SectorAllocator other) |
boolean |
free(int bit) |
static int |
getBlobBlockCount(int size) |
static int |
getBlockForSize(int size) |
int |
getIndex() |
long |
getPhysicalAddress(int offset) |
int |
getPhysicalSize(int offset) |
static int |
getSectorIndex(int rwaddr) |
static int |
getSectorOffset(int rwaddr) |
long |
getStartAddr() |
String |
getStats() |
boolean |
hasFree()
Checks
|
boolean |
hasFree(int threshold) |
boolean |
isCommitted(int offset) |
boolean |
isGettable(int offset) |
static int |
makeAddr(int index,
int bit) |
void |
preserveSessionData() |
void |
releaseSession(IWriteCacheManager cache) |
void |
setIndex(int index) |
void |
setSectorAddress(long sectorAddress,
int maxsize)
As well as setting the address, this is the point when the
allocator can pre-allocate the first set of tags.
|
String |
toString() |
public static final int BLOB_SIZE
public static final int[] ALLOC_SIZES
public SectorAllocator(ISectorManager store, IWriteCacheManager writes)
public int alloc(int size)
public static int makeAddr(int index, int bit)
public boolean free(int bit)
bit
- public int bit2tag(int bit)
bit
- public long getPhysicalAddress(int offset)
public int getPhysicalSize(int offset)
public long getStartAddr()
public String getStats()
public boolean hasFree(int threshold)
threshold
- the minimum number of bits free per 32 bit blockpublic boolean hasFree()
public void preserveSessionData()
public int addressSize(int offset)
public void setIndex(int index)
public void setSectorAddress(long sectorAddress, int maxsize)
sectorAddress
- managed by this Allocatorpublic static int getSectorIndex(int rwaddr)
public static int getSectorOffset(int rwaddr)
public static int getBlobBlockCount(int size)
public static int getBlockForSize(int size)
public int compareTo(SectorAllocator other)
compareTo
in interface Comparable<SectorAllocator>
public int getIndex()
public void releaseSession(IWriteCacheManager cache)
public void commit()
public boolean isCommitted(int offset)
public boolean isGettable(int offset)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.