119
agingasharedartifactbyacceptingandintegratinguserrequestsandupdatesfromother
instances.Ineithercase,thesepersistentchangesetschangeincrementallyratherthanbe-
ingconstructedarbitrarily.Whilearbitraryversionconstructioniscommoninsmesoftware
engineeringapplications(Lie,Conradietal.1989;Munch1993),itisunlikelyinmost
authoringapplications.Whenfullydynamicversionconstructionisbeingused,theoptimiza-
tionofrepresentingexplicitversionsetsisinapplicable.Theoperationsetabovereflectsthe
useofexplicitlyrepresentedversions.ThePalimpsestaddressingmechanismisasignificant
inbothsortsofimplementation,sinceitprovidesawell-orderedsetofkeyswithwhichaux-
iliarystructurescanbebuilttospeedaccessandupdatefunctions.
Thecapabilitiesinitems1and2arerelativelysimple,andprovidetheabilitytolookup
informationaboutachangegivenitschangeID.Lookupofbasicinformationaboutachange
givenitsIDcanbehandledbystandardindexstructuresinlogarithmictimewithoutdiffi-
culty,orevenfasterifhashingmethodsareused.Therestofthelistedcapabilitiesdealwith
findingthecontentsofanarbitrarychangeset,andrepresentthedifficultpartofanimple-
mentation.
Onehighlysignificantissueistrackingtheareasofeffectforoperations.Therearefive
sortsofregionwithsignificancetothePalimpsestchangemodel,mostofwhichrequiresome
specialindexingsupport:
1. Insertionpointsrepresentthedestinationsofinsertoperations:placeswherecon-
stantdataisinserted.
2. Variableinsertionpointsaresimilartoregularinsertionpointssincetheycausethe
additionofnewdata,howeverthatdataisnotnecessarilyconstant.Foracopyop-
eration,theinserteddataalsoappearselsewhere.Foramoveoperation,thesource
dataisdeletedanditsselectionismorecomplex,duetointeractionsbetweenover-
lappingmovesources.However,thedifferenceinbehaviorattheinsertionpointis
determinedentirelybythebehaviorattheoperation’ssource.Forinstance,both
120
moveandcopyinsertionpointsmustbeinactivewhenmovedintotheirownsource
region.Thisisessentialtoresolveglobalconflicts,asdiscussedinSection3.3.4.
3. Adeletionregionistheareacoveredbyadeletionoperation.Thesearerepresented
asrangesinthesetofPalimpsestaddresses.
4. Copysourceregionsneednospecialhandling,sincetheydonotexertanydirectef-
fectonthepartsofthesequencetheyoverlap.
5. Movesourceregionsaremorecomplexbecausetheydeletethecontentsoftheir
scope,butmustdeleteexactlythatportionnotdeletedbyahigher-prioritymove
operation.Amovesourceregionisanattemptto“sieze”thedatainitsscope;where
movesourcesoverlap,onlyonemovecanclaimthesharedregion.
ThegoalisquickaccesstoaparticularpointinaP-sequence,andthesubsequentenu-
merationofitscontentsfromthatpointon.Thisreflectstheneedsoftexteditorssince
mosttext-basedsequenceprocessingissequential,eventhoughrandomaccessisstillimpor-
tant(especiallyintheimplementationofmove,asweshallsee).
ThefollowingsectionsdescribetheimplementationofaPalimpseststorethatmaintains
severalauxiliarydatastructurestorepresent:
1. Thedatacontentofthesequence;
2. Thedestinationsofmoveandcopyoperations;
3. Theaddressesofthedestinationsofallchanges,insequentialorder;
4. Thesetofrangesthataredeletedbyachangeset;
5. Thesetofrangesthataremovedbysomeoperationinachangeset.
6.4 Sequencecontentstorage
AnimportantpartofrepresentingUistomaintainasinglestructurerepresentingthe
contentofthesequence.Thisisasequentiallistcontainingdatadirectlyinsertedbyinser-
Previous Page Next Page