SlideShare une entreprise Scribd logo
1  sur  28
Wiring Hacker Synapses
               Mustafa K. Isik      Scott Lewis
            codesurgeonblog.com   composent.com



Eclipse Communication Framework
EclipseDay at the Googleplex
June 24th, 2008
Mountain View, CA
Who has seen the
         screencast?




http://www.vimeo.com/1195398
Live Demo
Collaborative Coding and
 Team Tooling in Eclipse
Collaborative Coding
‣ Real-Time Shared Editing with Cola
 ‣ Motivation
 ‣ Conceptual Overview
 ‣ Challenges
 ‣ Solutions
 ‣ The Future
Motivation
‣ Enable Pair Programming
‣ Live Code Review
‣ Help, Tutor, Mentor
 ‣ Tap into Domain/API Knowledge
‣ Independent of Geographic Restrictions
‣ Resilient to Location Limitations
Make Coding More Social,
    Effective & Fun
Conceptual Overview
‣ 2 Participants working on the same
  document

 ‣ text file, java source code, etc.
‣ On different machines
 ‣ changes sent over the network
‣ Consistent document state
‣ No unintended changes
time
                          Conflict Free Ideal
                      Anna                                    Zoë
            initial consistent doc                    initial consistent doc

                      ins(a)

                      ins(a)
                                                              ins(a)
                index a
                                                       index a
                                                             ins(0)


                                             ins(0)               ins(a)

       ins(0)                  ins(a)   index 0

 index 0
time
                                Review
              Anna                                      Zoë
       initial consistent doc                   initial consistent doc




                                 Some Editing




          Consistent Documents
       Intention Preserving Changes
Review (cont.)
‣ No conflicts because
 ‣ Anna generates change on common document
     state, sends to Zoë

  ‣ Zoë updates unmodified local doc with
    incoming change

  ‣ Zoë generates change on updated document,
    sends to Anna

  ‣ Anna updates common doc state with incoming
    change

‣ Strictly Sequential Execution ➭ ideal, but unrealistic
Challenge
                ‣ Out of Order sending/receptionZoë
                    Anna
time             initial consistent doc                    initial consistent doc

                        ins(a)

                        ins(a)

                 index a
                       ins(0)

       ins(0)                    ins(a)           ins(0)

 index 0                                       index 0      index a
                                                  ins(0)       ins(a)

                                               index 0      index a
Solution
‣ In-order Message sending/reception
 ‣ network protocols to the rescue
 ‣ build on TCP
 ‣ build on application level protocol relying
    on TCP, e.g. XMPP

  ‣ ECF provides for abstraction from
    underlying protocol, XMPPS, Skype, etc.
Challenge
‣ Text Editor Responsiveness
 ‣ Local changes need to be applied
    immediately

‣ Network Latency
 ‣ Messages crossing “on the wire”
‣ Immediate application of local changes and
  Network Latency ➭ High Probability for
  Conflicts
time
          Cross-on-Wire Conflict
                   Anna                                         Zoë
            initial consistent doc                   initial consistent doc

                   ins(a)                                     ins(0)

                   ins(a)                  ins(0)

            index a                     index 0


       ins(0)                  ins(a)      ins(0)      ins(a)

  index 0                               index 0     index a
Solution
‣ Resolution mechanism for conflicting,
  mutually directed changes ➭ operational
  transformations

 ‣ precondition: locally applied operation
    and incoming remote operation originate
    from same document state

 ‣ postcondition: transformed remote
    operation ready for intention-preserving
    application to local document
Operational
      Transformations
‣ How to determine origination state/
  compatibility?

 ‣ stamp each locally generated operation
    with counters

 ‣ local operation count
 ‣ remote operation count
Operational
Transformations (cont.)
‣ compare counters on incoming remote
  operation & conflicting, already applied
  local operation

‣ cola operational transformation
 ‣ input: conflicting incoming remote op &
    already applied local op

 ‣ output: updated remote op, ready for
    local application, e.g. index update
Operational Transformation for Cross-
time                  on-Wire Conflict Resolution
                          Anna                                                           Zoë
                initial consistent doc                                           initial consistent doc

                          ins(a)                                                        ins(0)

                       ins(a)                                         ins(0)

                index a                                            index 0

 coopt(          ins(0)         ins(a)     )➭     ins(0)        coopt(       ins(a)     ins(0)     )➭     ins(a+L)



                                         no update necessary!                                    updated index!

       ins(0)                        ins(a)                        ins(0)                   ins(a+L)


  index 0                                                       index 0               index a + L
Pseudocode:
 Resolving Cross-On-Wire
//assert operation compatibility, i.e. same
origination state
Assert.isTrue(
    localOp.sentCount == remoteOp.receivedCount );
if ( localOp.isIns && remoteOp.isIns ) {
    if( localOp.index < remoteOp.index){
       //move remoteOp.index right by length of
       localOp
    } else if (localOp.index == remoteOp.index) {
       //notion of docOwner, consistently clarify
       preference
    } else if (localOp.index > remoteOp.index) {
       //do nothing to remote op, apply without
       modification
    }
}
Combinatorial
        Explosion
‣ Determine atomic operations, e.g. del, ins
 ‣ to be transformed against each other
‣ The fewer the better
 ‣ model compound operations from simple
    ones (e.g. replacement as deletion and
    insertion)
Combinatorial
     Explosion (cont.)
‣ |cases| ≡ |atomic operations| ^ 2 ∈ O(n^2)
 ‣ |cases| * |index_checks = 3|
    ‣ still ∈ O(n^2) though
 ‣ Not runtime problem, but
    implementation complexity

  ‣ The fewer atomic operations the better!
Divergence by More
  than one Operation
‣ Generation of multiple local changes while
  remote operation is traveling

  ‣ that is: upon arrival of remote operation,
    local doc changed by more than locally
    applied operation

  ‣ precondition for operational
    transformation not met
Divergence by More than One
time
             Anna
                    Op. (cont.)   Zoë
           initial consistent doc                         initial consistent doc

                       ins(a)                                         ins(z)


                   ins(a)                                                                  ins(z)

                       ins(v)


                   ins(a)           ins(v)       coopt(      ins(a)        ins(z)    )➭       ins(a)

                                                                                 no update necessary!

                                                               ins(a)                               ins(z)



  coopt(      ins(z)            ?   )➭       ?    coopt(     ins(v)    ins(z)    )➭      ins(v)

                                                                                 no update necessary!

                                                      ins(a)                    ins(v)            ins(z)
time
                Anna
                                       Resolution                        Zoë
         initial consistent doc                              initial consistent doc

                ins(a)                                                   ins(z)


                ins(a)                                                                        ins(z)

                 ins(v)


                ins(a)            ins(v)            coopt(      ins(a)        ins(z)    )➭       ins(a)

                                                                                    no update necessary!
 coopt( ins(z) ins(a) ) ➭ ins(x)
                                                                  ins(a)                               ins(z)
 where x = z + Length of ins(a)
                                                     coopt(     ins(v)    ins(z)    )➭      ins(v)


 coopt( ins(x) ins(v) ) ➭ ins(y)                                                    no update necessary!

 where y = x + Length of ins(v)                          ins(a)                    ins(v)            ins(z)


                ins(a)            ins(v)   ins(y)
Additional Details
‣ Manage local queue of unacknowledged
  operations

 ‣ add local operations as executed
 ‣ remove local operations as implicitly
    acknowledged by remote operations
    appropriate counter

 ‣ “virtual” update of queued up, applied
    local ops’ properties ➮ not in this talk

‣ Helps to introduce notion of state-space
  which is being traversed ➮ not in this talk
The Future
‣ More than 2 session participants
‣ Project Sharing
‣ API for Cola and its Model for Optimistic
  Concurrency Control

  ‣ Diagrams, anyone?
‣ Deeper Integration
 ‣ Multiple Cursors
 ‣ Highlighted Areas
‣ More on this from Scott ... time left?
Resources
Mustafa’s blog http://codesurgeonblog.com
Scott’s ECF blog http://eclipseecf.blogspot.com/
ECF Eclipse Wiki http://wiki.eclipse.org/
Eclipse_Communication_Framework_Project
ECF Project Home http://www.eclipse.org/ecf/
Cola Screencast
http://www.vimeo.com/1195398
6000+ views in 6 days

Contenu connexe

En vedette

陰陽編 ウルトラマン
陰陽編 ウルトラマン陰陽編 ウルトラマン
陰陽編 ウルトラマン
reigan_s
 
追試H28.3.3 神と人
追試H28.3.3 神と人追試H28.3.3 神と人
追試H28.3.3 神と人
reigan_s
 
Programa de limpieza y desinfección
Programa de limpieza y desinfección Programa de limpieza y desinfección
Programa de limpieza y desinfección
nathaly
 

En vedette (10)

Jean Christophe Meyer: Histoire Parallèle/Die Woche vor 50 Jahren – Lieu de m...
Jean Christophe Meyer: Histoire Parallèle/Die Woche vor 50 Jahren – Lieu de m...Jean Christophe Meyer: Histoire Parallèle/Die Woche vor 50 Jahren – Lieu de m...
Jean Christophe Meyer: Histoire Parallèle/Die Woche vor 50 Jahren – Lieu de m...
 
Traditional instruments Spain
Traditional instruments SpainTraditional instruments Spain
Traditional instruments Spain
 
BBC Developing Communities of Innovation - Thinking Digital Manchester 2015
BBC Developing Communities of Innovation - Thinking Digital Manchester 2015BBC Developing Communities of Innovation - Thinking Digital Manchester 2015
BBC Developing Communities of Innovation - Thinking Digital Manchester 2015
 
Home work
Home workHome work
Home work
 
陰陽編 ウルトラマン
陰陽編 ウルトラマン陰陽編 ウルトラマン
陰陽編 ウルトラマン
 
追試H28.3.3 神と人
追試H28.3.3 神と人追試H28.3.3 神と人
追試H28.3.3 神と人
 
EY India Attractiveness Survey 2015 – Reasons to Invest in India & Key Factor...
EY India Attractiveness Survey 2015 – Reasons to Invest in India & Key Factor...EY India Attractiveness Survey 2015 – Reasons to Invest in India & Key Factor...
EY India Attractiveness Survey 2015 – Reasons to Invest in India & Key Factor...
 
1-Oportunidades de Creación de Nuevos Negocios
1-Oportunidades de Creación de Nuevos Negocios1-Oportunidades de Creación de Nuevos Negocios
1-Oportunidades de Creación de Nuevos Negocios
 
Programa de limpieza y desinfección
Programa de limpieza y desinfección Programa de limpieza y desinfección
Programa de limpieza y desinfección
 
Obsolescencia del conocimiento
Obsolescencia del conocimientoObsolescencia del conocimiento
Obsolescencia del conocimiento
 

Plus de Mustafa Isik

SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-Simulationsdaten
SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-SimulationsdatenSumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-Simulationsdaten
SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-Simulationsdaten
Mustafa Isik
 
Game Development: The Golden Age of Indie
Game Development: The Golden Age of IndieGame Development: The Golden Age of Indie
Game Development: The Golden Age of Indie
Mustafa Isik
 
Tanning for Open Source Projects - The Google Summer of Code & You
Tanning for Open Source Projects - The Google Summer of Code & YouTanning for Open Source Projects - The Google Summer of Code & You
Tanning for Open Source Projects - The Google Summer of Code & You
Mustafa Isik
 
ISTNW Alpha at GTUG Munich
ISTNW Alpha at GTUG MunichISTNW Alpha at GTUG Munich
ISTNW Alpha at GTUG Munich
Mustafa Isik
 
Anybody can be a great mentor ... maybe
Anybody can be a great mentor ... maybeAnybody can be a great mentor ... maybe
Anybody can be a great mentor ... maybe
Mustafa Isik
 
Cloud Computing Is Not Cotton Candy ... Or Is It?
Cloud Computing Is Not Cotton Candy ... Or Is It?Cloud Computing Is Not Cotton Candy ... Or Is It?
Cloud Computing Is Not Cotton Candy ... Or Is It?
Mustafa Isik
 
Striding towards the Future Multiple Edits at a Time
Striding towards the Future Multiple Edits at a TimeStriding towards the Future Multiple Edits at a Time
Striding towards the Future Multiple Edits at a Time
Mustafa Isik
 

Plus de Mustafa Isik (11)

SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-Simulationsdaten
SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-SimulationsdatenSumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-Simulationsdaten
SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-Simulationsdaten
 
Game Development: The Golden Age of Indie
Game Development: The Golden Age of IndieGame Development: The Golden Age of Indie
Game Development: The Golden Age of Indie
 
Indie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurbo
Indie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurboIndie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurbo
Indie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurbo
 
Ein Rechner, ein Chip: MOS Technology 6502
Ein Rechner, ein Chip: MOS Technology 6502Ein Rechner, ein Chip: MOS Technology 6502
Ein Rechner, ein Chip: MOS Technology 6502
 
Tanning for Open Source Projects - The Google Summer of Code & You
Tanning for Open Source Projects - The Google Summer of Code & YouTanning for Open Source Projects - The Google Summer of Code & You
Tanning for Open Source Projects - The Google Summer of Code & You
 
ISTNW Alpha at GTUG Munich
ISTNW Alpha at GTUG MunichISTNW Alpha at GTUG Munich
ISTNW Alpha at GTUG Munich
 
Anybody can be a great mentor ... maybe
Anybody can be a great mentor ... maybeAnybody can be a great mentor ... maybe
Anybody can be a great mentor ... maybe
 
Cloud Computing Is Not Cotton Candy ... Or Is It?
Cloud Computing Is Not Cotton Candy ... Or Is It?Cloud Computing Is Not Cotton Candy ... Or Is It?
Cloud Computing Is Not Cotton Candy ... Or Is It?
 
2² C# 4.0 and .NET 4 Selected Features
2² C# 4.0 and .NET 4 Selected Features2² C# 4.0 and .NET 4 Selected Features
2² C# 4.0 and .NET 4 Selected Features
 
Modeling Scenarios with Sequence Diagrams
Modeling Scenarios with Sequence DiagramsModeling Scenarios with Sequence Diagrams
Modeling Scenarios with Sequence Diagrams
 
Striding towards the Future Multiple Edits at a Time
Striding towards the Future Multiple Edits at a TimeStriding towards the Future Multiple Edits at a Time
Striding towards the Future Multiple Edits at a Time
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Dernier (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Wiring Hacker Synapses - Cola: Real-Time Shared Editing

  • 1. Wiring Hacker Synapses Mustafa K. Isik Scott Lewis codesurgeonblog.com composent.com Eclipse Communication Framework EclipseDay at the Googleplex June 24th, 2008 Mountain View, CA
  • 2. Who has seen the screencast? http://www.vimeo.com/1195398
  • 4. Collaborative Coding and Team Tooling in Eclipse
  • 5. Collaborative Coding ‣ Real-Time Shared Editing with Cola ‣ Motivation ‣ Conceptual Overview ‣ Challenges ‣ Solutions ‣ The Future
  • 6. Motivation ‣ Enable Pair Programming ‣ Live Code Review ‣ Help, Tutor, Mentor ‣ Tap into Domain/API Knowledge ‣ Independent of Geographic Restrictions ‣ Resilient to Location Limitations
  • 7. Make Coding More Social, Effective & Fun
  • 8. Conceptual Overview ‣ 2 Participants working on the same document ‣ text file, java source code, etc. ‣ On different machines ‣ changes sent over the network ‣ Consistent document state ‣ No unintended changes
  • 9. time Conflict Free Ideal Anna Zoë initial consistent doc initial consistent doc ins(a) ins(a) ins(a) index a index a ins(0) ins(0) ins(a) ins(0) ins(a) index 0 index 0
  • 10. time Review Anna Zoë initial consistent doc initial consistent doc Some Editing Consistent Documents Intention Preserving Changes
  • 11. Review (cont.) ‣ No conflicts because ‣ Anna generates change on common document state, sends to Zoë ‣ Zoë updates unmodified local doc with incoming change ‣ Zoë generates change on updated document, sends to Anna ‣ Anna updates common doc state with incoming change ‣ Strictly Sequential Execution ➭ ideal, but unrealistic
  • 12. Challenge ‣ Out of Order sending/receptionZoë Anna time initial consistent doc initial consistent doc ins(a) ins(a) index a ins(0) ins(0) ins(a) ins(0) index 0 index 0 index a ins(0) ins(a) index 0 index a
  • 13. Solution ‣ In-order Message sending/reception ‣ network protocols to the rescue ‣ build on TCP ‣ build on application level protocol relying on TCP, e.g. XMPP ‣ ECF provides for abstraction from underlying protocol, XMPPS, Skype, etc.
  • 14. Challenge ‣ Text Editor Responsiveness ‣ Local changes need to be applied immediately ‣ Network Latency ‣ Messages crossing “on the wire” ‣ Immediate application of local changes and Network Latency ➭ High Probability for Conflicts
  • 15. time Cross-on-Wire Conflict Anna Zoë initial consistent doc initial consistent doc ins(a) ins(0) ins(a) ins(0) index a index 0 ins(0) ins(a) ins(0) ins(a) index 0 index 0 index a
  • 16. Solution ‣ Resolution mechanism for conflicting, mutually directed changes ➭ operational transformations ‣ precondition: locally applied operation and incoming remote operation originate from same document state ‣ postcondition: transformed remote operation ready for intention-preserving application to local document
  • 17. Operational Transformations ‣ How to determine origination state/ compatibility? ‣ stamp each locally generated operation with counters ‣ local operation count ‣ remote operation count
  • 18. Operational Transformations (cont.) ‣ compare counters on incoming remote operation & conflicting, already applied local operation ‣ cola operational transformation ‣ input: conflicting incoming remote op & already applied local op ‣ output: updated remote op, ready for local application, e.g. index update
  • 19. Operational Transformation for Cross- time on-Wire Conflict Resolution Anna Zoë initial consistent doc initial consistent doc ins(a) ins(0) ins(a) ins(0) index a index 0 coopt( ins(0) ins(a) )➭ ins(0) coopt( ins(a) ins(0) )➭ ins(a+L) no update necessary! updated index! ins(0) ins(a) ins(0) ins(a+L) index 0 index 0 index a + L
  • 20. Pseudocode: Resolving Cross-On-Wire //assert operation compatibility, i.e. same origination state Assert.isTrue( localOp.sentCount == remoteOp.receivedCount ); if ( localOp.isIns && remoteOp.isIns ) { if( localOp.index < remoteOp.index){ //move remoteOp.index right by length of localOp } else if (localOp.index == remoteOp.index) { //notion of docOwner, consistently clarify preference } else if (localOp.index > remoteOp.index) { //do nothing to remote op, apply without modification } }
  • 21. Combinatorial Explosion ‣ Determine atomic operations, e.g. del, ins ‣ to be transformed against each other ‣ The fewer the better ‣ model compound operations from simple ones (e.g. replacement as deletion and insertion)
  • 22. Combinatorial Explosion (cont.) ‣ |cases| ≡ |atomic operations| ^ 2 ∈ O(n^2) ‣ |cases| * |index_checks = 3| ‣ still ∈ O(n^2) though ‣ Not runtime problem, but implementation complexity ‣ The fewer atomic operations the better!
  • 23. Divergence by More than one Operation ‣ Generation of multiple local changes while remote operation is traveling ‣ that is: upon arrival of remote operation, local doc changed by more than locally applied operation ‣ precondition for operational transformation not met
  • 24. Divergence by More than One time Anna Op. (cont.) Zoë initial consistent doc initial consistent doc ins(a) ins(z) ins(a) ins(z) ins(v) ins(a) ins(v) coopt( ins(a) ins(z) )➭ ins(a) no update necessary! ins(a) ins(z) coopt( ins(z) ? )➭ ? coopt( ins(v) ins(z) )➭ ins(v) no update necessary! ins(a) ins(v) ins(z)
  • 25. time Anna Resolution Zoë initial consistent doc initial consistent doc ins(a) ins(z) ins(a) ins(z) ins(v) ins(a) ins(v) coopt( ins(a) ins(z) )➭ ins(a) no update necessary! coopt( ins(z) ins(a) ) ➭ ins(x) ins(a) ins(z) where x = z + Length of ins(a) coopt( ins(v) ins(z) )➭ ins(v) coopt( ins(x) ins(v) ) ➭ ins(y) no update necessary! where y = x + Length of ins(v) ins(a) ins(v) ins(z) ins(a) ins(v) ins(y)
  • 26. Additional Details ‣ Manage local queue of unacknowledged operations ‣ add local operations as executed ‣ remove local operations as implicitly acknowledged by remote operations appropriate counter ‣ “virtual” update of queued up, applied local ops’ properties ➮ not in this talk ‣ Helps to introduce notion of state-space which is being traversed ➮ not in this talk
  • 27. The Future ‣ More than 2 session participants ‣ Project Sharing ‣ API for Cola and its Model for Optimistic Concurrency Control ‣ Diagrams, anyone? ‣ Deeper Integration ‣ Multiple Cursors ‣ Highlighted Areas ‣ More on this from Scott ... time left?
  • 28. Resources Mustafa’s blog http://codesurgeonblog.com Scott’s ECF blog http://eclipseecf.blogspot.com/ ECF Eclipse Wiki http://wiki.eclipse.org/ Eclipse_Communication_Framework_Project ECF Project Home http://www.eclipse.org/ecf/ Cola Screencast http://www.vimeo.com/1195398 6000+ views in 6 days