|
||||||||
| 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.TestPacker
Does not actually go to disk, but just tests that the protocol is being followed
correctly. Some of these tests may make it into the real SnarfPacker, but some of them
will remain debugging tools. Most operations only do enough real stuff to be able to check
that they work.
The TestPacker holds onto an IntegerTable of UInt8Arrays that contain the disk
representations of all the flocks. It also holds
myDisk contains a UInt8Array for every flock that made it to disk. They are assigned
sequential numbers.
myNewFlocks contains the flockInfos for new flocks, and thus contains the new flocks
wimpily.
myAlmostNewFlocks contains flocks that are under construction but have not yet finished.
myDestroyedFlocks contains flocks that will be destroyed upon exiting the current
consistent block.
myChangedFlocks points strongly at flocks that must be rewritten to disk.
| Field Summary | |
protected boolean |
amCommitting
|
protected boolean |
blastOnError
|
protected MuSet |
myAlmostNewFlocks
|
protected Cookbook |
myBook
|
protected IntegerTable |
myChangedFlocks
|
protected IntegerVar |
myCountDown
|
protected IntegerTable |
myDestroyedFlocks
|
protected IntegerTable |
myDisk
|
protected IntegerTable |
myFlocks
|
protected Abraham |
myInitialFlock
|
protected IntegerTable |
myNewFlocks
|
protected int |
myNextHash
|
protected IntegerVar |
myPersistInterval
|
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 | |
TestPacker(boolean blast,
IntegerVar persistInterval)
|
|
| Method Summary | |
void |
assignSnarf(Abraham shep)
|
void |
beginConsistent(IntegerVar dirty)
This is called before entering consistent block. |
static void |
bomb(TestPacker CHARGE)
|
void |
checkNewFlockIndices()
|
void |
committing(boolean flag)
|
int |
computeHash(Abraham flock)
Compute a hash on the contents |
int |
computeSize(Abraham flock)
Send the snarf over a transmitter into a stream that just counts the bytes put into it. |
IntegerVar |
countDown()
Decrement the countdown and return its new value |
void |
destroyFlock(FlockInfo info)
Queue destroy of the given flock. |
void |
diskUpdate(FlockInfo info)
The flock described by info is Dirty!! On the next commit, rewrite it to the disk. |
void |
dismantleFlock(FlockInfo info)
The flock designated by info has completed all dismantling actions; throw it off the disk. |
void |
dropFlock(int token)
The flock identified by token 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. |
void |
flushChanges()
Rewrite all flocks that have changed in this snarf. |
void |
forgetFlock(FlockInfo info)
Remember that there are no more persistent pointers to the shepherd described by info. |
Turtle |
getInitialFlock()
Return the starting object for the entire backend. |
boolean |
insideCommit()
|
boolean |
isFake()
|
static Heaper |
make(boolean blast,
IntegerVar persistInterval)
|
void |
makeConsistent()
The virtual image in memory is now in a consistent state. |
void |
makePersistent()
|
SpecialistRcvr |
makeRcvr(XnReadStream readStream)
|
void |
makeReal(FlockInfo info)
Retrieve from the disk the flock at index within the specified snarf. |
SpecialistXmtr |
makeXmtr(XnWriteStream writeStream)
|
void |
mustBeInsideTransaction()
|
void |
mustKnowShepherd(FlockInfo info)
Check that I know about this shepherd |
void |
mustNotBeCommitting()
|
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. |
XnReadStream |
readStream(FlockInfo info)
Get a read stream on the disk contents of the info |
void |
recordUpdate(FlockInfo info)
The flock represented by info has changed. |
void |
refitFlocks()
do nothing for now |
void |
registerStub(Abraham shep,
SnarfID snarfID,
int index)
Called to register a newly created stub (by the diskSpecialist) in the internal tables. |
void |
rememberFlock(FlockInfo info)
There are now persistent pointers to the shepherd described by info. |
void |
resetCountDown()
|
void |
storeAlmostNewShepherd(Abraham shep)
Shep has been created, but is not consistent yet. |
void |
storeInitialFlock(Abraham turtle,
XcvrMaker protocol,
Cookbook cookbook)
A turtle just got created!! Remember it as the initial flock. |
void |
storeNewFlock(Abraham shep)
Shep just got created!! On some later commit, assign it to a snarf and write it to the disk. |
XnWriteStream |
writeStream(FlockInfo info)
Get a write stream on the disk contents of the info |
| Methods inherited from class org.abora.gold.snarf.DiskManager |
actualHashForEqual, bomb, cleanupGarbage, consistent, consistent, consistent, consistentBlockAt, destruct, emulsion, exitTimeNonInherited, flockInfoTable, flockInfoTable, flockTable, flockTable, fluidSpace, fluidSpace, initializeDisk, insistent, insistent, insistent, linkTimeNonInherited, make, makeConsistentBegin, makeConsistentEnd, setHashCounter, 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 int myNextHash
protected Abraham myInitialFlock
protected IntegerTable myFlocks
protected IntegerTable myChangedFlocks
protected IntegerTable myDestroyedFlocks
protected MuSet myAlmostNewFlocks
protected IntegerTable myNewFlocks
protected XcvrMaker myXcvrMaker
protected IntegerVar myCountDown
protected IntegerVar myPersistInterval
protected IntegerTable myDisk
protected Cookbook myBook
protected boolean amCommitting
protected boolean blastOnError
| Constructor Detail |
public TestPacker(boolean blast,
IntegerVar persistInterval)
| 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)
DiskManager
dropFlock in class DiskManagerpublic void forgetFlock(FlockInfo info)
DiskManager
forgetFlock in class DiskManagerpublic Turtle getInitialFlock()
DiskManager
getInitialFlock in class DiskManagerpublic int nextHashForEqual()
DiskManager
nextHashForEqual in class DiskManagerpublic void rememberFlock(FlockInfo info)
DiskManager
rememberFlock in class DiskManagerpublic void storeAlmostNewShepherd(Abraham shep)
DiskManager
storeAlmostNewShepherd in class DiskManager
public void storeInitialFlock(Abraham turtle,
XcvrMaker protocol,
Cookbook cookbook)
DiskManager
storeInitialFlock in class DiskManagerpublic void storeNewFlock(Abraham shep)
storeNewFlock in class DiskManagerpublic void checkNewFlockIndices()
public void committing(boolean flag)
public IntegerVar countDown()
public void mustBeInsideTransaction()
public void mustKnowShepherd(FlockInfo info)
public void mustNotBeCommitting()
public void resetCountDown()
public Abraham fetchCanonical(int hash,
SnarfID snarfID,
int index)
DiskManager
fetchCanonical in class DiskManagerpublic void makeReal(FlockInfo info)
DiskManager
makeReal in class DiskManager
public void registerStub(Abraham shep,
SnarfID snarfID,
int index)
DiskManager
registerStub in class DiskManagerpublic int computeSize(Abraham flock)
public SpecialistRcvr makeRcvr(XnReadStream readStream)
public SpecialistXmtr makeXmtr(XnWriteStream writeStream)
public XnReadStream readStream(FlockInfo info)
public XnWriteStream writeStream(FlockInfo info)
public void assignSnarf(Abraham shep)
public void flushChanges()
public void recordUpdate(FlockInfo info)
public void refitFlocks()
public int computeHash(Abraham flock)
public void purgeClean()
public void beginConsistent(IntegerVar dirty)
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()
DiskManager
purge in class DiskManagerpublic void purgeClean(boolean noneLocked)
DiskManager
purgeClean in class DiskManagerpublic void makeConsistent()
DiskManager
makeConsistent in class DiskManagerpublic boolean isFake()
isFake in class DiskManagerpublic static void bomb(TestPacker CHARGE)
public static Heaper make(boolean blast,
IntegerVar persistInterval)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||