139
which“promotesloosecouplingbykeepingobjectsfromreferringtoeachotherexplicitly.”
(Gamma,Helmetal.1995),p.273.
7.1.1 Thelocalstore
Thelocalstore,likeGaul,canbedividedintothreeparts,thepublicinterface(anin-
stanceoftheFaçadepattern(Gamma,Helmetal.1995)),thePalimpsestdatastoreitself,
andthepolicymanager.ThedatastorewasdiscussedinChapter6,anddespitesignificant
internalcomplexityitpresentsaverysimpleinterface.Figure7.2showthemostciritical
operationsthatalocalstoreneedstosupport.Alloftheseoperationsaresuitablefordirect
usebyanapplicationthatiswillingtomanageitsownchangeconflictsdirectly,ortotake
advantageofbuilt-inresolutionstrategies.Thefunctionslistedareselfexplanatory,forthe
mostpart.Wewillseelaterthatmostapplicationswillprobablyuseawrappedinterfacethat
issimplerandmayprovidebetterperformanceinhighlyinteractiveapplications.
Item[]getSegmentAt(Addressa,ChangeSetIDset)
Item[]contentsOf(Addressa,ChangeSetIDset)
Item[]contentsOf(Addressstart,Addressend,ChangeSetIDset)
SegmentIteratorenumerateContents(Addressa,ChangeSetIDset)
ConflictSetaddChange(ChangeIDid,ChangeSetIDset)
voidremoveChangeFromSet(ChangeIDid,ChangeSetIDset)
ChangeIDinsert(Item[],Addressdest)
ChangeIDdelete(Addressstart,Addressend)
ChangeIDcopy(Addressstart,Addressend,Addressdest)
ChangeIDmove(Addressstart,Addressend,Addressdest)
voidsetResolveConflicts(Booleanflag)
ChangeSetIteratorgetChangeSets()
ChangeIteratorgetChanges(ChangeSetIDset)
CorrelationMapcompare(ChangeSetIDversion1,ChangeSetIDversion2)
F F F F iii ig g g gu u u ur r r re e e e 7777....2222:::: CCCCoooommmmmmmmoooonnnn ooooppppeeeerrrraaaattttiiiioooonnnnssss ffffoooorrrr tttthhhheeee ddddaaaattttaaaa ssssttttoooorrrreeee
7.1.2 Thepolicymanager
Thepolicymanagermanagesapplicationconflicts,aswellasreplicationandeventpropa-
gation.Thepolicymanagerreceiveseverychangefromthelocalapplicationaswellasfrom
140
anyactivenetworkconnections.Eachchangecanbeexaminedwithrespecttoitssource,
operandsandrelationshiptootherchanges,andthendealtwithappropriately.Application
conflictsarethoseconflictsthatdependonspecializedconsistencyconstraintsoverand
abovethebasicsequenceconstraintsimposedbythedatamodel.Thiskindofcustomization
isbeyondourcurrentscope,butitisworthnotingthatpropersupportforthisfunction
wouldincludesupportforapplicationstodetectsemanticconflicts.Thiswouldincludefull
queryfunctionsonchangesofthesortdiscussedinChapter6.Astandardsetofextensible
dispositionactionsfordetectedconflictswouldalsobeneededasastartingpointforappli-
cationimplementers.Thesewouldinclude,atleast:
Movementofconflictingchangestospecialchangesets;
Acceptanceofconflictingchanges,andsendingofaspecialconflicteventtotheapplica-
tion;
Acceptanceoftheconflictwithoutspecialreportingofanykind.
Theotherfunctionsofthepolicymanager(inconjunctionwiththeindividualnetwork
connections)arereplicationmanagementandeventpropagation.Thesearegroupedtogether
becausethePalimpsestmodelunifiestheseundertherubricofchangedistribution,atthe
sametimethatitseparatesthemfromsynchronizationconcerns.Thepolicymanagerneeds
tobeabletodecidewhatchangesshouldbedistributedwhere.Abrieflistofusefulpolicies
includesthefollowing:
Epidemic.Foreachnewchangereceived,sendittoasubsetofa(presumablylarge)
groupofactiveconnections.Ifachangehasalreadybeenreceived,donotpropagateit,
orpropagateitwithaverylowprobability.
Versionupdate.Foraselectedversion,packageupallthechangesinitschangeset,
andsendthemoutononeormorenetworkchannels.
Pushy.Sendeverychangeaddedtoaparticularversiontoaspecifiedsetofnetwork
connections.Accepteverychangeonthoseconnections,andaddittothatversion.
Previous Page Next Page