a programming model and system support for disconnected-aware applications on resource-constrained...

54
A Programming Model and System A Programming Model and System Support Support for Disconnected-Aware Applications for Disconnected-Aware Applications on Resource-Constrained Devices on Resource-Constrained Devices (FarGo-DA) (FarGo-DA) MSc seminar MSc seminar by by Weinsberg Yaron Weinsberg Yaron www.dsg.technion.ac.il/fargo-da www.dsg.technion.ac.il/fargo-da January 6, 2002 January 6, 2002

Upload: corey-mccarthy

Post on 18-Jan-2018

221 views

Category:

Documents


0 download

DESCRIPTION

Thesis Domain  Modern wide-area networks are characterized by: Dynamic changes of bandwidth, load, machine capacities and availability. Dynamic changes of bandwidth, load, machine capacities and availability.  Requires high level of adaptability from distributed software systems.  We follow the distributed object programming model and use Object mobility to: increase performance increase performance decrease cost decrease cost attain high availability attain high availability  The need: new models and techniques for designing wide-area sw systems.

TRANSCRIPT

Page 1: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A Programming Model and System Support A Programming Model and System Support for Disconnected-Aware Applications on for Disconnected-Aware Applications on

Resource-Constrained DevicesResource-Constrained Devices(FarGo-DA)(FarGo-DA)

MSc seminarMSc seminarbyby

Weinsberg YaronWeinsberg Yaron

www.dsg.technion.ac.il/fargo-dawww.dsg.technion.ac.il/fargo-da

January 6, 2002January 6, 2002

Page 2: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

OutlineOutline

IntroductionIntroduction

FarGo-DA’s Programming ModelFarGo-DA’s Programming Model

A sample FarGo-DA applicationA sample FarGo-DA application

Runtime infrastructureRuntime infrastructure

Status and Future WorkStatus and Future Work

SummarySummary

Page 3: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Thesis DomainThesis Domain Modern wide-area networks are characterized by:Modern wide-area networks are characterized by:

Dynamic changesDynamic changes of bandwidth, load, machine of bandwidth, load, machine capacities and availability.capacities and availability.

Requires high level of adaptability from distributed Requires high level of adaptability from distributed software systems.software systems.

We follow the distributed object programming We follow the distributed object programming model and use model and use Object mobilityObject mobility to: to:

increase performanceincrease performance decrease costdecrease cost attain high availabilityattain high availability

The need: new models and techniques for The need: new models and techniques for designing wide-area sw systems.designing wide-area sw systems.

Page 4: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A generic framework for constructing disconnected-A generic framework for constructing disconnected-aware applications.aware applications. Enable developers to encode connection semantics.Enable developers to encode connection semantics. Dynamically changing the application layout upon Dynamically changing the application layout upon

(re)disconnection.(re)disconnection.

A new model and techniques for designing A new model and techniques for designing disconnected-aware applications.disconnected-aware applications. Separating the connection layout from the application Separating the connection layout from the application

logic.logic.

A lightweight mechanism for management and of A lightweight mechanism for management and of disconnection and reconnectiondisconnection and reconnection

Research ObjectivesResearch Objectives

Page 5: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Focus on Voluntary disconnection.Focus on Voluntary disconnection. User initiatedUser initiated enables the system to prepare for disconnectionenables the system to prepare for disconnection One-to-manyOne-to-many

Uni-directional client-server applications.Uni-directional client-server applications. NLPCs act as active clients only, and are not NLPCs act as active clients only, and are not

servers of any interaction.servers of any interaction. The disconnection request is always initiated by the The disconnection request is always initiated by the

NLPC (client), not by any server.NLPC (client), not by any server.

AssumptionsAssumptions

Page 6: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Application objects interact across multiple hosts Application objects interact across multiple hosts using remote method invocations (RMI)using remote method invocations (RMI)

FarGo adds a dynamic layoutFarGo adds a dynamic layout Add dynamic relocation while preserving the Add dynamic relocation while preserving the

distributed object abstractiondistributed object abstraction All references into and out of a migrating object must All references into and out of a migrating object must

remain valid.remain valid.

site B

site A

FarGo OverviewFarGo Overview

Page 7: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

site B

site A

FarGo OverviewFarGo Overview Application objects interact across multiple hosts Application objects interact across multiple hosts

using remote method invocations (RMI)using remote method invocations (RMI) FarGo adds a dynamic layoutFarGo adds a dynamic layout

Add dynamic relocation while preserving the Add dynamic relocation while preserving the distributed object abstractiondistributed object abstraction

All references into and out of a migrating object must All references into and out of a migrating object must remain valid.remain valid.

Page 8: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A unique aspect of FarGo is the ability to associate A unique aspect of FarGo is the ability to associate movement semantics with component references.movement semantics with component references.

The semantics can be changed dynamically. The semantics can be changed dynamically.

FarGo OverviewFarGo Overview

A component referenceSource

componentTarget component

The semantic The semantic goes here…goes here…

FarGo support the following semantics:FarGo support the following semantics: Link, Pull, Stamp, Duplicate.Link, Pull, Stamp, Duplicate.

Page 9: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A Pull reference:A Pull reference:

Pull

useuserr

Link

A A relocatorrelocator

A Sample FarGo ReferenceA Sample FarGo Reference

When When moves, moves, moves along. moves along.

Useful for frequent or data-intensive interaction.Useful for frequent or data-intensive interaction.

Core A Core B

Page 10: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Pull

A Pull reference:A Pull reference:

Core A Core B

useuserr

When When moves, moves, moves along. moves along.

Useful for frequent or data-intensive interaction.Useful for frequent or data-intensive interaction.

Link

A Sample FarGo ReferenceA Sample FarGo Reference

Page 11: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A new programming model:A new programming model: A framework that enables developers to specify A framework that enables developers to specify

architecture-oriented (re)disconnection policies.architecture-oriented (re)disconnection policies. A runtime for interpreting and carrying the policies upon A runtime for interpreting and carrying the policies upon

disconnection,reconnection.disconnection,reconnection.

FarGo-DA Extends the FarGo implementation with:FarGo-DA Extends the FarGo implementation with: A whole new class of Disconnected-Aware (or DA) semantics.A whole new class of Disconnected-Aware (or DA) semantics. An extended FarGo invocation mechanism (and FarGo An extended FarGo invocation mechanism (and FarGo

compiler)compiler) An extended FarGo serialization mechanismAn extended FarGo serialization mechanism

FarGo-DA’s Programming ModelFarGo-DA’s Programming Model

Page 12: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Complet:Complet: A mobile java component. A mobile java component. DA-Complet:DA-Complet: A complet that is aware of the core’s A complet that is aware of the core’s

connectivityconnectivity Only Only DADA-Complets are affected by (re)disconnection-Complets are affected by (re)disconnection

Core:Core: A process that can execute, send, and A process that can execute, send, and receive complets.receive complets.

Complet Reference:Complet Reference: A reference that points to a A reference that points to a complet ( “complet ( “MetaRefMetaRef”)”) Reifies (re)disconnection semantics.Reifies (re)disconnection semantics. Accessible via system methods:Accessible via system methods:

FarGo-DA’s Programming ModelFarGo-DA’s Programming Model

MetaRefMetaRef metaRef = metaRef = CoreCore.getMetaRef(target);.getMetaRef(target);metaRef.setDA(new Clone(),new Merge());metaRef.setDA(new Clone(),new Merge());

Page 13: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Identify complets and their interactions.Identify complets and their interactions. Complets are “semantically remote to each other”Complets are “semantically remote to each other”

object parameters are passed by valueobject parameters are passed by value complets are passed by reference.complets are passed by reference.

Physically, complets may be co-located or remote.Physically, complets may be co-located or remote.

Facet 1Facet 1Application Logic DesignApplication Logic Design

Page 14: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Mark the DA components. Mark the DA components. Non-DA components are not affected.Non-DA components are not affected.

Define FarGo-DA’s connection semantics via reference Define FarGo-DA’s connection semantics via reference types:types: Disconnection Semantics:Disconnection Semantics:

Clone, Replace , StoreAndForward, DepartClone, Replace , StoreAndForward, Depart Define migration priorities.Define migration priorities.

Reconnection Semantics:Reconnection Semantics: Merge, Purge, Overwrite, LastMerge, Purge, Overwrite, Last

Facet 2Facet 2DA Connection LayoutDA Connection Layout

Page 15: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A A CloneClone reference. reference.Disconnection SemanticsDisconnection Semantics

Core A Core B

When core A disconnects, When core A disconnects, is cloned to the locality of is cloned to the locality of .. The default connection semantics.The default connection semantics. Within each core, the system notifies all DA-complets Within each core, the system notifies all DA-complets

about the coming disconnection.about the coming disconnection. Enable to dynamically change the connection semanticsEnable to dynamically change the connection semantics

Clone

I want to I want to Disconnect!Disconnect!

Disconnection Event

MetaRefMetaRef metaRef = metaRef = CoreCore.getMetaRef(beta);.getMetaRef(beta);metaRef.setDA(new Clone());metaRef.setDA(new Clone());

Page 16: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A A CloneClone reference. reference.

Core A Core B

Clone

I am the I am the clone complet clone complet

(replica)(replica)

I am the original I am the original completcomplet

The local reference is updated.The local reference is updated. the clone complet has the same ID as the original the clone complet has the same ID as the original

complet.complet.

Disconnection SemanticsDisconnection Semantics

Page 17: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A A ReplaceReplace reference. reference.

Core A Core B

locates a local instance of locates a local instance of ’s type and connects to it.’s type and connects to it. If non-exist, a new one is created.If non-exist, a new one is created.

Useful when:Useful when: reduced functionality (smaller footprint) is sufficient.reduced functionality (smaller footprint) is sufficient. the origin complet cannot be migrated.the origin complet cannot be migrated.

Replace

lik

e 1.1. same interface.same interface.2. same binding-name.3. equivalence method

will figure it out…

Disconnection SemanticsDisconnection Semantics

Page 18: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A A ReplaceReplace reference. reference.

Core A Core B

Replace

lik

e

Disconnection Event

locates a local instance of locates a local instance of ’s type and connects to it.’s type and connects to it. If non-exist, a new one is created.If non-exist, a new one is created.

Useful when:Useful when: reduced functionality (smaller footprint) is sufficient.reduced functionality (smaller footprint) is sufficient. the origin complet cannot be migrated.the origin complet cannot be migrated.

Disconnection SemanticsDisconnection Semantics

Page 19: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A A ReplaceReplace reference. reference.

Core A Core B

Replace

lik

e

locates a local instance of locates a local instance of ’s type and connects to it.’s type and connects to it. If non-exist, a new one is created.If non-exist, a new one is created.

Useful when:Useful when: reduced functionality (smaller footprint) is sufficient.reduced functionality (smaller footprint) is sufficient. the origin complet cannot be migrated.the origin complet cannot be migrated.

Disconnection SemanticsDisconnection Semantics

Page 20: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A A StoreAndForwardStoreAndForward reference. reference.

Core A Core B

StoreAndForward

Disconnection Event

Disconnection SemanticsDisconnection Semantics

A special kind of reference: A special kind of reference: StoreStore + + ForwardForward.. All invocations are one-way, in order to enable the source All invocations are one-way, in order to enable the source

complet to continue its work.complet to continue its work. All invocations are stored at the local NLPC, pending for All invocations are stored at the local NLPC, pending for

reconnection.reconnection. The number of invocation stored is limited and can be set The number of invocation stored is limited and can be set

by the developer (with a runtime limit).by the developer (with a runtime limit).

Page 21: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A A StoreAndForwardStoreAndForward reference. reference.

Core A Core B

StoreAndForward

A special kind of reference: A special kind of reference: StoreStore + + ForwardForward.. All invocations are one-way, in order to enable the source All invocations are one-way, in order to enable the source

complet to continue its work.complet to continue its work. All invocations are stored at the local NLPC, pending for All invocations are stored at the local NLPC, pending for

reconnection.reconnection. The number of invocation stored is limited and can be set The number of invocation stored is limited and can be set

by the developer (with a runtime limit).by the developer (with a runtime limit).

Local buffer

Storing:Storing:- method - method

numbernumber- parameters.- parameters.

Method invoked…Method invoked…

Disconnected Operation

Disconnected Operation

Disconnection SemanticsDisconnection Semantics

Page 22: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A A StoreAndForwardStoreAndForward reference. reference.

Core A Core B

StoreAndForward

Upon Reconnection, the runtime forwards the pending Upon Reconnection, the runtime forwards the pending invocations to the remote complet.invocations to the remote complet.

No return values.No return values. An example use of this reference type is for outgoing An example use of this reference type is for outgoing

email messages, CVS commits, instant messaging etc.email messages, CVS commits, instant messaging etc.

Local buffer

Upon Reconnection…

Upon Reconnection…

method invoked!method invoked!

Disconnection SemanticsDisconnection Semantics

Page 23: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A A DepartDepart reference. reference.

Core A Core B

Depart

Disconnection SemanticsDisconnection Semantics

UserUser Invoker

return value

method invoked!method invoked!

All invocations are handed over to the remote core prior All invocations are handed over to the remote core prior to disconnection, for remote executionto disconnection, for remote execution

Upon reconnection the results, if any, are transferred to Upon reconnection the results, if any, are transferred to the source completthe source complet

Useful to spawn heavy remote computations without the Useful to spawn heavy remote computations without the need to be continuously connectedneed to be continuously connected

Partly implemented (based on Miki Abu’s work,ICDCS01)Partly implemented (based on Miki Abu’s work,ICDCS01)

a remote thread a remote thread createdcreatedmethod invoked.method invoked.

return value is available:return value is available: can pull itcan pull it- can be notifiedcan be notified

return value is saved if return value is saved if is iscurrently disconnected.currently disconnected.

Page 24: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Complet PrioritizationComplet Prioritization NLPCs are resource constrained.NLPCs are resource constrained.

not all clone jobs can be fulfilled. not all clone jobs can be fulfilled. FarGo-DA provides a simple interface to setting FarGo-DA provides a simple interface to setting

priorities, by an additional parameter to the priorities, by an additional parameter to the setDAsetDA method.method.

At runtime, the system carries out the At runtime, the system carries out the disconnection semantics based on the priority disconnection semantics based on the priority order.order.

Invocations on references without target complets Invocations on references without target complets are gracefully handled via FarGo-DA exceptions are gracefully handled via FarGo-DA exceptions

MetaRefMetaRef metaRef = metaRef = CoreCore.getMetaRef(target);.getMetaRef(target);metaRef.setDA(new Clone(),new Merge(),metaRef.setDA(new Clone(),new Merge(),Priority.HighPriority.High););

Disconnection SemanticsDisconnection Semantics

Page 25: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A Merge reference.A Merge reference.

Core A Core B

When core A reconnects, When core A reconnects, ’s clone is merged with the ’s clone is merged with the original complet (explained later).original complet (explained later).

The default reconnection semantics.The default reconnection semantics.

Merge

I want to I want to Reconnect the Reconnect the

network…network…

Reconnection Event

Reconnection…Reconnection…

Merging…Merging…

Reconnection SemanticsReconnection Semantics

Page 26: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A Merge reference.A Merge reference.

Core A Core B

When core A reconnects, When core A reconnects, ’s clone is merged with the ’s clone is merged with the original complet (explained later).original complet (explained later).

The default reconnection semantics.The default reconnection semantics.

Merge

merged!!merged!!!!

Reconnected!!!Reconnected!!!

Reconnection SemanticsReconnection Semantics

Page 27: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A Purge reference.A Purge reference.

Core A Core B

When core A reconnects, When core A reconnects, ’s clone is purged.’s clone is purged. is reconnected to is reconnected to .. Analogous to methods [in] parameters in RPCAnalogous to methods [in] parameters in RPC

Purge

I want to I want to Reconnect the Reconnect the

network…network…

Reconnection Event

Reconnection…Reconnection…

Reconnection SemanticsReconnection Semantics

Page 28: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A Purge reference.A Purge reference.

Core A Core B

Purge

Reconnected!!!Reconnected!!!

When core A reconnects, When core A reconnects, ’s clone is purged.’s clone is purged. is reconnected to is reconnected to .. Analogous to methods [in] parameters in RPCAnalogous to methods [in] parameters in RPC

Reconnection SemanticsReconnection Semantics

Page 29: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

An Overwrite reference.An Overwrite reference.

Core A Core B

The opposite of Purge.The opposite of Purge. The state of the cloned complet overwrites the state The state of the cloned complet overwrites the state

of the original complet.of the original complet. Analogous to methods [in/out] parameters in RPCAnalogous to methods [in/out] parameters in RPC is reconnected to is reconnected to ..

Overwrite

I want to I want to Reconnect the Reconnect the

network…network…

Reconnection Event

Reconnection…Reconnection…

OverwriteOverwrite

Reconnection SemanticsReconnection Semantics

Page 30: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

An Overwrite reference.An Overwrite reference.

Core A Core B

Overwrite

Reconnection SemanticsReconnection Semantics

The opposite of Purge.The opposite of Purge. The state of the cloned complet overwrites the state The state of the cloned complet overwrites the state

of the original complet.of the original complet. Analogous to methods [in/out] parameters in RPCAnalogous to methods [in/out] parameters in RPC is reconnected to is reconnected to ..

Reconnected!!!Reconnected!!!

Page 31: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A Last reference.A Last reference.

Core A Core B

The state of the complet with the latest timestamp wins.The state of the complet with the latest timestamp wins. The clocks of the NLPC and the remote server should be The clocks of the NLPC and the remote server should be

synchronized.synchronized. is reconnected to is reconnected to ..

Last

I want to I want to Reconnect the Reconnect the

network…network…

Reconnection Event

Reconnection…Reconnection…

Comparing timestamps…Comparing timestamps…

Reconnection SemanticsReconnection Semantics

Page 32: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

A Last reference.A Last reference.

Core A Core B

Last

Reconnected!!!Reconnected!!!

I won!!!I won!!!

The state of the complet with the latest timestamp wins.The state of the complet with the latest timestamp wins. The clocks of the NLPC and the remote server should be The clocks of the NLPC and the remote server should be

synchronized.synchronized. is reconnected to is reconnected to ..

Reconnection SemanticsReconnection Semantics

Page 33: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Conflict ResolutionConflict Resolution In order to resolve conflicting updates between replicas In order to resolve conflicting updates between replicas

we must assume application specific knowledge.we must assume application specific knowledge.

FarGo-DA offers two mechanisms in order to resolve FarGo-DA offers two mechanisms in order to resolve merging conflicts: merging conflicts: Callback methods- The Callback methods- The MergeMerge callback method. callback method.void Merge(Complet archive,Complet replica, void Merge(Complet archive,Complet replica, Log localLog,Log remoteLog) Log localLog,Log remoteLog) {{ // Application-specific merging code // Application-specific merging code }}

invoked on the invoked on the original completoriginal complet

Core A Core B

r

originaloriginalreplicareplica a

archivearchiveremote logremote log local loglocal log

Page 34: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Reconciliation operatorsReconciliation operators encapsulation of primitive types + a state variable that encapsulation of primitive types + a state variable that

represents a built-in merging method. represents a built-in merging method.

public class BankAccount_ public class BankAccount_ extends DisconnectedAwareCompletextends DisconnectedAwareComplet{{ private discInt private discInt balance = new discInt(Operation.Add);balance = new discInt(Operation.Add);}}

Conflict ResolutionConflict Resolution

FarGo-DA provides the following types:FarGo-DA provides the following types: discInt, discLong, discStringdiscInt, discLong, discString

And the following operations:And the following operations: Add, Max, Min, Average, Random, Last, First.Add, Max, Min, Average, Random, Last, First.

Page 35: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Each reconciliation operator must implement the Each reconciliation operator must implement the discTypediscType interface. interface.

User defined types are created by implementing the User defined types are created by implementing the mergemerge method declared at method declared at discTypediscType interface. interface.

FarGo-DA’s Runtime supports the merging of FarGo-DA’s Runtime supports the merging of reconciliation operators, contained in Java’s basic reconciliation operators, contained in Java’s basic container classes (i.e., Vector, Array).container classes (i.e., Vector, Array).

Conflict ResolutionConflict Resolution

Page 36: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Conflict ResolutionConflict Resolution

Core A Core B

Merge

How reconciliation operators work ?How reconciliation operators work ? Upon Reconnection…

Upon Reconnection…

++Introspection Introspection

-discInt balance;discInt balance;

-discString account;discString account;

-discInt balance’ ;discInt balance’ ;

-discString account ‘ ;discString account ‘ ;

-discInt balance;discInt balance;

merged!!merged!!!!

-discString account;-discString account;

Page 37: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

FarGo-DA ExampleFarGo-DA ExampleManageAnywhereManageAnywhere

the currentthe currentcustomercustomer

adds a new adds a new product to the product to the orderorder

ManageAnywhere is a simple tool for collaborative management ManageAnywhere is a simple tool for collaborative management to be used by remote sales forces.to be used by remote sales forces.

Each sales agent is equipped with a NLPC.Each sales agent is equipped with a NLPC. The NLPC may or may not be connected to the central facility, The NLPC may or may not be connected to the central facility,

depending on the cellular coverage in the visited area.depending on the cellular coverage in the visited area.

get the availableget the availablebalancebalance

calculates the product calculates the product price according to the price according to the quantityquantity

Page 38: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

NLPC Server

LogicLogicConfiguratorConfigurator

InventoryInventory

ProductProduct

AccountsAccounts

CompanyAccountCompanyAccount

GUIGUI

BasicConfiguratorBasicConfigurator

1

n1

n

Application Logic DesignApplication Logic DesignThe agents user The agents user interface.interface.

Handles all Handles all service requests.service requests.

- financial calc- financial calc - product’s price calc- product’s price calc

- - product’s price calcproduct’s price calc- smaller footprint- smaller footprint

service providerservice provider products inventoryproducts inventory

customers customers pre-paid accounts pre-paid accounts

public class ComapnyAccount_ public class ComapnyAccount_ extends DisconnectedAwareComplet extends DisconnectedAwareComplet {{

private Integer prePaidBalance= 60102; private Integer prePaidBalance= 60102; private discInt totalPurchase = private discInt totalPurchase =

new discInt(Operation.Add);new discInt(Operation.Add);}}

Page 39: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Connection Layout DesignConnection Layout Design

public class Logic_extends DisconnectedAwareCompletpublic class Logic_extends DisconnectedAwareComplet{{ MetaRef mr = Core.getMetaRef(accounts);MetaRef mr = Core.getMetaRef(accounts); mr.setDA(new Clone(),new Merge(),Priority.LOW);mr.setDA(new Clone(),new Merge(),Priority.LOW);

mr = Core.getMetaRef(configurator);mr = Core.getMetaRef(configurator); mr.setDA(new Replace(),new Purge(),Priority.Highmr.setDA(new Replace(),new Purge(),Priority.High

mr = Core.getMetaRef(inventory);mr = Core.getMetaRef(inventory); mr.setDA(new StoreAndForward(),null,Priority.LOWmr.setDA(new StoreAndForward(),null,Priority.LOW}}

A look at theA look at theLogic completLogic complet

Page 40: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Disconnection ExemplifiedDisconnection Exemplified

Page 41: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignCore ArchitectureCore Architecture

DMDM

- Manages the Reconnection - Manages the Reconnection and Disconnection procedures.and Disconnection procedures.- Realized by the - Realized by the DisconnectionManager DisconnectionManager ((DMDM))

The FarGo-DA’sThe FarGo-DA’sImplementation Implementation enables disconnectedenables disconnected operation.operation.

FarGo-DA’s ImplementationFarGo-DA’s Implementationprovide a general parameter provide a general parameter passing schemepassing scheme

Page 42: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignComplet Reference StructureComplet Reference Structure

The connection reference type is encapsulated in a The connection reference type is encapsulated in a meta-reference object.meta-reference object.

same interface as same interface as

holds the connection holds the connection semantics.semantics.

- points to - points to or to or to a remote tracker a remote tracker - RMI object- RMI object

Page 43: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignFarGo-DA’s invocation modelFarGo-DA’s invocation model

In order to support disconnected operation, a In order to support disconnected operation, a newnew invocation scheme was implemented in FarGo-DA. invocation scheme was implemented in FarGo-DA. FarGo assumed that the complet is “always-FarGo assumed that the complet is “always-

connected”:connected”: available on the local core available on the local core

available on the remote core through a remote tracker.available on the remote core through a remote tracker.

Upon invocation, FarGo always try to invoke the Upon invocation, FarGo always try to invoke the complet. In FarGo-DA this is a reference specific complet. In FarGo-DA this is a reference specific property (for example, property (for example, StoreAndForwardStoreAndForward stops the stops the invocation flow)invocation flow)

ss TT cc

ss TT ccTTremoteremote

Page 44: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignFarGo-DA’s invocation modelFarGo-DA’s invocation model

Invocation starts Invocation starts here…here…

connector’s connector’s preInvokepreInvoke method is activated: method is activated:- continue invocation ?continue invocation ?- store data ?store data ?- log ? etc…log ? etc…

Invocation continues Invocation continues to complet!to complet!

decision returned.decision returned.

Page 45: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignThe Disconnection ProcedureThe Disconnection Procedure

Core A

Clone

Replace

Disconnection Event

User Asks to Disconnect…User Asks to Disconnect…

Core B

Page 46: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignThe Disconnection ProcedureThe Disconnection Procedure

Core A

Clone

Replace

DM is loaded………….DM is loaded………….

DM

Core B

Page 47: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignThe Disconnection ProcedureThe Disconnection Procedure

Core A

Clone

Replace

Creating Internal Database…Creating Internal Database…

DM

New Job:New Job: : should be : should be

clonedcloned

Core B

Page 48: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignThe Disconnection ProcedureThe Disconnection Procedure

Core A

Clone

Replace

Cloning…Cloning…

DM

Core B

disconnection buffer Is serialized…Is serialized… typetype Is serialized…Is serialized… typetype

Looking for Looking for ……

Create a new Create a new one!!!one!!!

DM discovers that…DM discovers that…- - : should be replaced : should be replaced

Page 49: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignThe Disconnection ProcedureThe Disconnection Procedure

Core A

Clone

Replace

Update References…Update References…

DM

Core B

Replace

Disconnection Completed!Disconnection Completed!

ready to reconnect!ready to reconnect!

Page 50: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignThe Reconnection ProcedureThe Reconnection Procedure

Core A

Merge

Purge

DM

Core B

Purge

User Reconnects….User Reconnects….

DM use the already DM use the already created database.created database.

++ merged==

Page 51: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignThe Reconnection ProcedureThe Reconnection Procedure

Core A

Merge Purge

DM

Core B

Purge

User Reconnects….User Reconnects….

merged

Page 52: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

System DesignSystem DesignThe Reconnection ProcedureThe Reconnection Procedure

Core A

Merge Purge

DM

Core Bmerged

Update References…Update References…

Reconnection Completed!Reconnection Completed!

Page 53: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

Status and Future WorkStatus and Future Work Publications:Publications:

A programming Model and System Support – to be A programming Model and System Support – to be published in ICSE’02 (May 2002)published in ICSE’02 (May 2002)

Simulation for NLPC using FarGo’s monitoring API Simulation for NLPC using FarGo’s monitoring API (Hovav' s thesis, MA2000)(Hovav' s thesis, MA2000)

System is fully implemented (using JDK1.8) and will System is fully implemented (using JDK1.8) and will soon be available for download.soon be available for download.

Ongoing work:Ongoing work: DA-Application profiling.DA-Application profiling. Weakly-Connected Operation.Weakly-Connected Operation. More applications.More applications.

Page 54: A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron

SummarySummary A new programming model:A new programming model:

Design time (logical) structural rules.Design time (logical) structural rules. Loose coupling between application-logic and Loose coupling between application-logic and

connection layout (re)design.connection layout (re)design. Keeping a uniform (and familiar) language, tools, and Keeping a uniform (and familiar) language, tools, and

object model.object model.

System Design:System Design: Create a new invocation model to support disconnected Create a new invocation model to support disconnected

operation.operation. A system component to handle the (re)disconnections.A system component to handle the (re)disconnections. Implementation of the disconnection semantics is built Implementation of the disconnection semantics is built

into a new serialization mechanism into a new serialization mechanism Simple yet powerful conflict resolution mechanisms.Simple yet powerful conflict resolution mechanisms.

An implemented model and system.An implemented model and system.