|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.abora.gold.java.AboraHeaper
|
+--org.abora.gold.xpp.basic.Heaper
|
+--org.abora.gold.snarf.DiskManager
|
+--org.abora.gold.snarf.SnarfPacker
Should myFlocks contain full flockInfos for forwarded flocks? Both the flags and the size
mean nothing.
A SnarfPacker maintains the relationship between Shepherds and the set of snarfs
representing the disk. A SnarfPacker assigns flocks to snarfs based loosely on the
flocks''s Shepherd''s preferences. When a flock changes, it informs the SnarfPacker.
When the SnarfPacker decides to write to the disk, it ensures that the changed objects
still fit in their snarf (migrating them if necessary), writes them to the snarf, then
writes out the snarf.
mySnarfInfo {MuTable of: XuInteger}
- How much space remains in each snarf.
mySnarfMap {MuTable of: SnarfRecord}
- Map from snarfIDs to a SnarfRecord that handles that snarf.
myChangedSnarfs {MuSet of: XuInteger}
- The IDs for all snarfs in which an imaged flock has changed.
myFlocks {SetTable of: XuInteger and: FlockInfo}
- Indexed by Abraham hash, contains all FlockInfos that refer to flocks in memory.
Multiple infos may refer to the same flock if it is referenced through forwarding.
The only info considered to have the correct state wrt its flocks suitability for
purging is the info pointed to by its Abraham.
myInsideCommit {BooleanVar}
- True while writing new and changed flocks to disk to prevent purging,
and during purgeClean to prevent recursive call through Purgeror recycling.
| Field Summary | |
protected static Collection |
DebugSizes
|
protected static int |
LRUCount
|
protected SnarfID |
myAllocationSnarf
|
protected Cookbook |
myBook
|
protected IntegerVar |
myConsistentCount
|
protected IntegerVar |
myDestroyCount
|
protected MuArray |
myDestroyedFlocks
|
protected SetTable |
myFlocks
|
protected boolean |
myInsideCommit
|
protected IntegerVar |
myLastNewCount
|
protected IntegerVar |
myNewEstimate
|
protected IntegerTable |
myNewFlocks
|
protected Counter |
myNextHash
|
protected SanitationEngineer |
myPurgeror
|
protected LiberalPurgeror |
myRepairer
|
protected SnarfInfoHandler |
mySnarfInfo
|
protected MuTable |
mySnarfMap
|
protected Turtle |
myTurtle
|
protected Urdi |
myUrdi
|
protected UrdiView |
myUrdiView
|
protected XcvrMaker |
myXcvrMaker
|
| Fields inherited from class org.abora.gold.snarf.DiskManager |
myFlockInfoTable, myFlockTable, myFluidSpace, SecretEmulsion |
| Fields inherited from class org.abora.gold.xpp.basic.Heaper |
AllBlasts, BecomeMap, GarbageCount, InGC, InitializedClasses, InitializingClasses, LastMemory, NextClientRequestNumber, NotOneElementSignal, PackageTable, PromiseNameTable, StringHashSBoxes |
| Fields inherited from class org.abora.gold.java.AboraHeaper |
ActiveClubs, CurrentAuthor, CurrentBertCanopyCache, CurrentBertCrum, CurrentChunk, CurrentGrandMap, CurrentKeyMaster, CurrentPacker, CurrentSensorCanopyCache, CurrentServer, CurrentSession, CurrentSessions, CurrentTrace, InitialEditClub, InitialOwner, InitialReadClub, InitialSponsor, InsideTransactionFlag |
| Constructor Summary | |
SnarfPacker(Urdi urdi)
|
|
| Method Summary | |
void |
addInfo(FlockInfo info,
Abraham shep)
Add another flockInfo object to myFlocks with info about another location for shep. |
void |
assignSnarf(Abraham shep)
Find a snarf in which to fit shep. |
void |
beginConsistent(IntegerVar dirtyFlocks)
This is called before entering consistent block. |
static void |
bomb(SnarfPacker CHARGE)
|
void |
checkInfos()
Perform the sanity check of the moment. |
void |
commitState(boolean flag)
Used by ResetCommit bomb |
void |
commitView()
Commit by destroying the current view and creating a new one. |
int |
computeSize(Abraham flock)
Send the snarf over a transmitter into a stream that just counts the bytes put into it. |
void |
consistentCount()
|
void |
consistentX(IntegerVar dirty,
BlockClosure aBlock)
|
UrdiView |
currentView()
Return the current urdiView. |
void |
destroyAbandoned()
Destroy all forgotten flocks that are no longer in memory. |
void |
destroyFlock(FlockInfo info)
Queue destroy of the given flock. |
void |
destruct()
Destroy all objects imaged from this snarf. |
void |
diskUpdate(FlockInfo info)
The flock described by info is Dirty!! On the next commit, rewrite it to the disk. |
void |
dismantleFlock(FlockInfo info)
Turn the flock designated by info into a Pumpkin. |
void |
dropFlock(int token)
The flock is being removed from memory. |
void |
endConsistent(IntegerVar dirty)
This is called after exiting a consistent block. |
Abraham |
fetchCanonical(int hash,
SnarfID snarfID,
int index)
If something is already imaged at that location, then return it. |
Abraham |
fetchInMemory(SnarfID snarfID,
int index)
Return true if the object is on disk but not in memory. |
void |
flushFlocks()
Actually write all the changed and newly assigned flocks to the disk. |
void |
forgetFlock(FlockInfo info)
Remember that there are no more persistent pointers to the shepherd represented by info. |
MuSet |
forgottenFlocks(SnarfID snarfID)
Return the set of indices to flocks in snarf snarfID that are forgotten. |
void |
forwardFlock(Abraham shep)
Shep has grown too large for its current place. |
Abraham |
getFlock(SnarfID snarfID,
int index)
Return a flock at a particular location. |
Turtle |
getInitialFlock()
Return the starting object for the entire backend. |
SnarfHandler |
getReadHandler(SnarfID snarfID)
Get the read handler on the snarf. |
SnarfRecord |
getSnarfRecord(SnarfID snarfID)
Return the snarfRecord for snarfID. |
static DiskManager |
initializeUrdiOnDisk(java.lang.String fname)
|
boolean |
insideCommit()
|
boolean |
isFake()
|
static void |
linkTimeNonInherited()
|
static Heaper |
make(java.lang.String fname)
|
void |
makePersistent()
The virtual image in memory is now in a consistent state. |
SpecialistRcvr |
makeRcvr(XnReadStream readStream)
|
void |
makeReal(FlockInfo info)
Retrieve from the disk the flock at index within the specified snarf. |
SpecialistXmtr |
makeXmtr(XnWriteStream writeStream)
|
int |
nextHashForEqual()
Shepherds use a sequence number for their hash. |
void |
purge()
Flush everything out to disk and remove all purgeable imaged objects from memory. |
void |
purgeClean()
|
void |
purgeClean(boolean noneLocked)
purge all shepherds that are currently clean, not locked, not dirty, and purgeable. |
void |
recordUpdate(FlockInfo info)
The flock represented by info has changed. |
void |
refitFlocks()
Make sure all flocks that have changed still fit in their snarfs. Add any that don't to myNewFlocks and return the table from their current locations to the newShepherds. |
void |
registerStub(Abraham shep,
SnarfID snarfID,
int index)
Called to register a newly created stub (by the diskSpecialist) in the internal tables. |
void |
releaseReadHandler(SnarfHandler handler)
Release the supplied snarfHandler and destroy it. |
void |
rememberFlock(FlockInfo info)
There are now persistent pointers to the shepherd help by info. |
FlockInfo |
resolveLocation(FlockInfo info)
Make sure that the shepherd or stub at that location actually points at the real location for a shepherd. |
void |
setHashCounter(Counter aCounter)
|
void |
storeAlmostNewShepherd(Abraham shep)
Do nothing |
void |
storeInitialFlock(Abraham turtle,
XcvrMaker protocol,
Cookbook cookbook)
A turtle just got created!! Write out a pseudo-forwarder that has all the protocol information encoded in the snarfID and index. |
void |
storeNewFlock(Abraham shep)
Shep just got created!! On some later commit, assign it to a snarf and write it to the disk. |
void |
testNewFlocks()
|
| Methods inherited from class org.abora.gold.snarf.DiskManager |
actualHashForEqual, bomb, cleanupGarbage, consistent, consistent, consistent, consistentBlockAt, emulsion, exitTimeNonInherited, flockInfoTable, flockInfoTable, flockTable, flockTable, fluidSpace, fluidSpace, initializeDisk, insistent, insistent, insistent, makeConsistent, makeConsistentBegin, makeConsistentEnd, staticTimeNonInherited |
| Methods inherited from class org.abora.gold.java.AboraHeaper |
asOop, basicInspect, displayString, error, hack, halt, inspect, knownBug, mightNotImplement, REQUIRES, shouldImplement, shouldNotImplement, stubbleForSubclassResponsibility, thingToDo, willNotImplement |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected SnarfInfoHandler mySnarfInfo
protected Turtle myTurtle
protected SnarfID myAllocationSnarf
protected MuTable mySnarfMap
protected SetTable myFlocks
protected IntegerTable myNewFlocks
protected IntegerVar myLastNewCount
protected IntegerVar myNewEstimate
protected MuArray myDestroyedFlocks
protected UrdiView myUrdiView
protected Urdi myUrdi
protected XcvrMaker myXcvrMaker
protected Cookbook myBook
protected Counter myNextHash
protected IntegerVar myConsistentCount
protected boolean myInsideCommit
protected IntegerVar myDestroyCount
protected SanitationEngineer myPurgeror
protected LiberalPurgeror myRepairer
protected static Collection DebugSizes
protected static int LRUCount
| Constructor Detail |
public SnarfPacker(Urdi urdi)
| Method Detail |
public void destroyFlock(FlockInfo info)
destroyFlock in class DiskManagerpublic void diskUpdate(FlockInfo info)
DiskManager
diskUpdate in class DiskManagerpublic void dismantleFlock(FlockInfo info)
dismantleFlock in class DiskManagerpublic void dropFlock(int token)
dropFlock in class DiskManagerpublic void forgetFlock(FlockInfo info)
forgetFlock in class DiskManagerpublic Turtle getInitialFlock()
getInitialFlock in class DiskManagerpublic int nextHashForEqual()
nextHashForEqual in class DiskManagerpublic void rememberFlock(FlockInfo info)
rememberFlock in class DiskManagerpublic void storeAlmostNewShepherd(Abraham shep)
storeAlmostNewShepherd in class DiskManager
public void storeInitialFlock(Abraham turtle,
XcvrMaker protocol,
Cookbook cookbook)
storeInitialFlock in class DiskManagerpublic void storeNewFlock(Abraham shep)
storeNewFlock in class DiskManager
public Abraham fetchCanonical(int hash,
SnarfID snarfID,
int index)
fetchCanonical in class DiskManagerpublic void makeReal(FlockInfo info)
makeReal in class DiskManager
public void registerStub(Abraham shep,
SnarfID snarfID,
int index)
DiskManager
registerStub in class DiskManager
public void addInfo(FlockInfo info,
Abraham shep)
public int computeSize(Abraham flock)
public UrdiView currentView()
public void destroyAbandoned()
public void forwardFlock(Abraham shep)
public SpecialistRcvr makeRcvr(XnReadStream readStream)
public SpecialistXmtr makeXmtr(XnWriteStream writeStream)
public void setHashCounter(Counter aCounter)
setHashCounter in class DiskManagerpublic void testNewFlocks()
public void beginConsistent(IntegerVar dirtyFlocks)
DiskManager
beginConsistent in class DiskManagerpublic void endConsistent(IntegerVar dirty)
DiskManager
endConsistent in class DiskManagerpublic boolean insideCommit()
insideCommit in class DiskManagerpublic void makePersistent()
public void purge()
purge in class DiskManagerpublic void purgeClean(boolean noneLocked)
purgeClean in class DiskManagerpublic void destruct()
destruct in class DiskManagerpublic void assignSnarf(Abraham shep)
public void checkInfos()
public void commitState(boolean flag)
public void commitView()
public Abraham fetchInMemory(SnarfID snarfID,
int index)
public void flushFlocks()
public MuSet forgottenFlocks(SnarfID snarfID)
public Abraham getFlock(SnarfID snarfID,
int index)
public SnarfHandler getReadHandler(SnarfID snarfID)
public SnarfRecord getSnarfRecord(SnarfID snarfID)
public void recordUpdate(FlockInfo info)
public void refitFlocks()
public void releaseReadHandler(SnarfHandler handler)
public FlockInfo resolveLocation(FlockInfo info)
public void consistentCount()
public void purgeClean()
public void consistentX(IntegerVar dirty,
BlockClosure aBlock)
public boolean isFake()
isFake in class DiskManagerpublic static void linkTimeNonInherited()
public static DiskManager initializeUrdiOnDisk(java.lang.String fname)
public static Heaper make(java.lang.String fname)
public static void bomb(SnarfPacker CHARGE)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||