<> <> <> <> <> <> <> DIRECTORY AlpineEnvironment, AlpineImport USING [Handle], AlpineInternal USING [LogRecordID, nullLogRecordID], BasicTime USING [GMT], CoordinatorExtras USING [Info], RPC USING [maxShortStringLength]; Coordinator: DEFINITIONS LOCKS c USING c: Handle = BEGIN Object: TYPE = MONITORED RECORD [ transID: AlpineEnvironment.TransID _ TRASH, --immutable-- beginRecord: AlpineInternal.LogRecordID _ AlpineInternal.nullLogRecordID, --immutable-- state: State _ active, <> outcome: Outcome _ unknown, < completing.>> finishInProgress: BOOL _ FALSE, <> aWorkerBecameReady: BOOL _ FALSE, <> workers: WorkerHandle _ NIL, <> resultsReturned: CONDITION, <> <> forceRecord: AlpineInternal.LogRecordID _ AlpineInternal.nullLogRecordID, <> extras: REF CoordinatorExtras.Info _ NIL, <> next: Handle _ nullHandle <> ]; Handle: TYPE = REF Object; nullHandle: Handle = NIL; State: TYPE = {active, collecting, completing, complete}; Outcome: TYPE = AlpineEnvironment.Outcome --{abort, commit, unknown}--; WorkerObject: TYPE = RECORD [ worker: AlpineImport.Handle, --immutable-- state: WorkerState _ active, --increases monotonically from active to complete-- communicationTrouble: BOOL _ FALSE, callInProgress: Call _ none, --communication in progress with worker-- resultsOfMostRecentCall: Results _ [none, none[]], timeForNextCall: BasicTime.GMT _ TRASH, <> lastPrepareResult: Results _ [none, none[]], lastFinishResult: Results _ [none, none[]] ]; WorkerHandle: TYPE = LIST OF WorkerObject; WorkerState: TYPE = { active, ready, complete }; Call: TYPE = { none, prepare, finish }; Results: TYPE = RECORD [ communicationError: CommunicationError, body: SELECT call: Call FROM none => [], prepare => [prepareResult: AlpineEnvironment.WorkerState], finish => [] ENDCASE ]; CommunicationError: TYPE = { none, bindingFailed, callFailed, busy }; <> <> <> <> <> <> RegisterWorkerLogRep: TYPE = MACHINE DEPENDENT RECORD [ worker: StrBody]; CompletingLogRep: TYPE = MACHINE DEPENDENT RECORD [ outcome: AlpineEnvironment.CommitOrAbort]; StrBody: TYPE = MACHINE DEPENDENT RECORD [ length: CARDINAL _ 0, maxLength: CARDINAL _ RPC.maxShortStringLength, text: PACKED ARRAY[0..RPC.maxShortStringLength) OF CHAR]; END. CHANGE LOG. <> <> <> <> <<>>