org.abora.gold.counter
Class BatchCounter

java.lang.Object
  |
  +--org.abora.gold.java.AboraHeaper
        |
        +--org.abora.gold.xpp.basic.Heaper
              |
              +--org.abora.gold.snarf.Abraham
                    |
                    +--org.abora.gold.counter.Counter
                          |
                          +--org.abora.gold.counter.BatchCounter

public class BatchCounter
extends Counter

Instances preallocate a bunch of numbers and record the preallocations to disk. It then
increments purely in memory until the preallocated counts are used up. It then
preallocates another bunch of numbers. If the system crashes, all numbers between the
in-memory count and the on-disk count simply never get used. This reduces the access to
disk for shepherd hashes and GrandMap IDs.


Field Summary
protected  IntegerVar myBatchCount
           
protected  IntegerVar myCount
           
protected  Sema4 myMutex
           
protected  IntegerVar myPersistentCount
           
 
Fields inherited from class org.abora.gold.snarf.Abraham
DismantleStatistics, myHash, myInfo, myToken, TheTokenSource
 
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
BatchCounter(IntegerVar count, IntegerVar batchCount)
           
BatchCounter(IntegerVar count, IntegerVar batchCount, int hash)
           
BatchCounter(Rcvr receiver)
           
 
Method Summary
 int contentsHash()
          A hash of the contents of this flock
 IntegerVar count()
           
 IntegerVar decrement()
           
 IntegerVar decrementBy(IntegerVar count)
           
 IntegerVar increment()
           
 IntegerVar incrementBy(IntegerVar count)
           
static Heaper make(IntegerVar count, IntegerVar batchCount)
           
static Counter makeFakeCounter(IntegerVar count, IntegerVar batchCount, int hash)
           
 void restartBatchCounter(Rcvr trans)
          re-initialize the non-persistent part
 void sendSelfTo(Xmtr xmtr)
          do nothing
 void setCount(IntegerVar count)
           
 
Methods inherited from class org.abora.gold.counter.Counter
fakeCounter, make, make, printOn
 
Methods inherited from class org.abora.gold.snarf.Abraham
actualHashForEqual, becomeStub, cleanupGarbage, destroy, destruct, diskUpdate, dismantle, dismantleStatistics, fetchInfo, fetchShepherd, flockInfo, forget, getInfo, getShepherdStubCategory, initTimeNonInherited, isConstructed, isDestructed, isEqual, isKindOf, isPurgeable, isShepherd, isStub, isUnlocked, linkTimeNonInherited, newShepherd, remember, restartAbraham, restartAbraham, returnToken, staticTimeNonInherited, token
 
Methods inherited from class org.abora.gold.xpp.basic.Heaper
abstractDeclarationFor, abstractTypeFor, addMethodAttributeToInOf, addPackage, addPackageCategory, allClientProtocolOn, argumentTypesFor, arrow, blast, blast, BLAST, cachePromiseNameTable, cachePromiseNameTableIn, canYouBecome, cast, cleanPromiseClasses, clientClassesDo, clientFunctionsOn, clientMethodsOn, clientProtocol, clientProtocolDo, clientProtocolOn, clientProtocolOn, collectibleClasses, compare, compileClientSubclasses, compileConstantPromiseMethods, compileCreateFromRcvr, compileEQ, compileGeneratedClassMethod, compileGeneratedMethod, compileHook, compilePromise, compilePromiseDefaultMethods, compilePromiseFluidDeclarations, compilePromiseHandlers, compilePromiseMethods, compileRequestCreateMsgInArguments, compileRequestEvaluateMsgInReturningArguments, compileRPCSpecialistEvaluateMsgForReturningArguments, compileSendSelfTo, compileSendSelfToSendHook, compileStubbleMethods, compileSubclassStubbleMethods, computeMangle, computePreorder, constantTypeValue, convert, convertCopyDeclarations, convertDeferredDeclarations, convertProxyDeclarations, convertSubclassCopyDeclarations, convertSubclassDeferredDeclarations, convertSubclassProxyDeclarations, copyReferencesToType, create, create, create, create, create, create, create, create, create, create, createRequestClassArguments, definesProxyMethods, delete, deref, destructor, enum, enumFlags, equals, exportName, fetchAttribute, fetchPackage, fetchSuperCategory, fileOutClientProtocol, findCategory, findSenderAndReceiverMethods, findTailInto, flushPromiseNameTable, foo, freezeClientClasses, freezeClientProtocol, freezeStProtocol, frozenClasses, garbageCollect, garbageCollectFrom, gcOpportunity, gcOpportunity, generatedCategory, generatePromiseNames, getCategory, getOrMakePackage, getSuperCategory, handlerSignaturesFrom, hash, hashForEqual, hasProxyMethods, info_clientClasses, info_clientSideClasses, info_promiseClasses, info_stProtocol, inGC, initializedClasses, initializingClasses, initPackages, initStringHashSBoxes, inspectPieces, instanceSize, IntegerVar, isByProxy, isConstructed, isDestructed, isEqualOrSubclassOf, isGenerated, isIntType, isKindOf, isRawType, make, makeClassTable, makeFillTable, makeRequestTable, mangle, markChildren, markCount, markInstances, mayBecome, mayBecomeAnySubclassOf, new1, newX, nonCopyVariables, notWorking, pack, packageClasses, packagingCategory, parseExportName, passe, pointerToStaticMember, pointerToStaticMember, pointerToVirtualMember, preorderMax, preorderNumber, PROBLEM, problems, promiseClass, promiseDefaultValue, promiseName, promiseNameTable, promiseToAbstract, registerPackageCategory, removeGeneratedCode, removeStubbleMethods, removeSubclassGeneratedCode, removeSubclassStubbleMethods, requestProcedure, requestProceduresFrom, returnTypeFor, rootName, scheduleTermination, sendProxyTo, serverNameFor, setGC, signal, signals, smalltalkSelector, stClientProtocol, stubbleSelectorTokenReturnsArguments, subclassNonCopyVariables, takeOop, togglePromiseName, togglePromiseOfParse, unimplemented, unmangle, verifyFreeze, wipeStubble
 
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

myCount

protected IntegerVar myCount

myPersistentCount

protected IntegerVar myPersistentCount

myMutex

protected Sema4 myMutex

myBatchCount

protected IntegerVar myBatchCount
Constructor Detail

BatchCounter

public BatchCounter(IntegerVar count,
                    IntegerVar batchCount)

BatchCounter

public BatchCounter(IntegerVar count,
                    IntegerVar batchCount,
                    int hash)

BatchCounter

public BatchCounter(Rcvr receiver)
Method Detail

count

public IntegerVar count()
Overrides:
count in class Counter

decrement

public IntegerVar decrement()
Overrides:
decrement in class Counter

decrementBy

public IntegerVar decrementBy(IntegerVar count)
Overrides:
decrementBy in class Counter

increment

public IntegerVar increment()
Overrides:
increment in class Counter

incrementBy

public IntegerVar incrementBy(IntegerVar count)
Overrides:
incrementBy in class Counter

setCount

public void setCount(IntegerVar count)
Overrides:
setCount in class Counter

restartBatchCounter

public void restartBatchCounter(Rcvr trans)
re-initialize the non-persistent part


contentsHash

public int contentsHash()
Description copied from class: Abraham
A hash of the contents of this flock

Overrides:
contentsHash in class Abraham

sendSelfTo

public void sendSelfTo(Xmtr xmtr)
Description copied from class: Heaper
do nothing

Overrides:
sendSelfTo in class Counter

make

public static Heaper make(IntegerVar count,
                          IntegerVar batchCount)

makeFakeCounter

public static Counter makeFakeCounter(IntegerVar count,
                                      IntegerVar batchCount,
                                      int hash)


Translation - Copyright © 2003 David G Jones. All Rights Reserved.
Original Udanax-Gold - Copyright © 1979-1999 Udanax.com. All rights reserved.