persistent and transient objects persistent objects continue to exist even if they aren’t in the...

45
Persistent and Transient Objects Persistent objects continue to exist even if they aren’t in the address space of a server process Transient objects existence depends on having a server

Post on 20-Dec-2015

235 views

Category:

Documents


1 download

TRANSCRIPT

Persistent and Transient Objects

• Persistent objects continue to exist even if they aren’t in the address space of a server process

• Transient objects existence depends on having a server

Binding a Client to an Object

• Unlike RPC, distributed objects have systemwide object references

• The system may support either implicit binding or explicit binding

• The object reference may contain - IP address, port, object name

• Or use a location server so we need only address for this server plus the object name

Binding a Client to an Object

a) (a) Example with implicit binding using only global referencesb) (b) Example with explicit binding using global and local references

Distr_object* obj_ref; //Declare a systemwide object referenceobj_ref = …; // Initialize the reference to a distributed objectobj_ref-> do_something(); // Implicitly bind and invoke a method

(a)

Distr_object objPref; //Declare a systemwide object referenceLocal_object* obj_ptr; //Declare a pointer to local objectsobj_ref = …; //Initialize the reference to a distributed objectobj_ptr = bind(obj_ref); //Explicitly bind and obtain a pointer to the local proxyobj_ptr -> do_something(); //Invoke a method on the local proxy

(b)

Parameter Passing

• Since we have systemwide object refs, we don’t have the same types of problems we had with RPCs and pointers

• However, for performance motives we may want to treat object ref parameters differently depending on where the object resides

Parameter Passing

• The situation when passing an object by reference or by value. 2-18

Java RMI

• Java offers remote objects as the only type of distributed object

• One difference between local and remote objects is that synchronized methods work differently on the two types Blocking applies only to the proxies of the

remote objects

• A parameter passed to an RMI must be serializable

Message-Oriented Communication

• Neither RPC nor RMI works when we can’t assure that the receiving side isn’t executing We can use messaging in this case

Message-Oriented Communication

• General organization of a communication system in which hosts are connected through a network

2-20

Messaging Modes

• Messaging systems can be either persistent or transient Are messages retained when the senders and/or

receivers stop executing?

• Can also be either synchronous or asynchronous Blocking vs. non-blocking

Persistent Communication

• Persistent communication of letters back in the days of the Pony Express.

Persistence and Synchronicity in Communication

a) Persistent asynchronous communicationb) Persistent synchronous communication

2-22.1

Persistence and Synchronicity in Communication

c) Transient asynchronous communicationd) Receipt-based transient synchronous communication

2-22.2

Persistence and Synchronicity in Communication

e) Delivery-based transient synchronous communication at message deliveryf) Response-based transient synchronous communication

Message-Oriented Transient Communication

• Sockets are an example of message-oriented transient communication

• The Message-Passing Interface (MPI) is a newer set of message-oriented primitives for multicomputers MPI communication takes place within a

known group of processes• A (groupID, processID) pair uniquely identifies a

source or destination of a message

The Message-Passing Interface (MPI)

• Some of the most intuitive message-passing primitives of MPI.

Primitive Meaning

MPI_bsend Append outgoing message to a local send buffer

MPI_sendSend a message and wait until copied to local or remote buffer

MPI_ssend Send a message and wait until receipt starts

MPI_sendrecv Send a message and wait for reply

MPI_isend Pass reference to outgoing message, and continue

MPI_issendPass reference to outgoing message, and wait until receipt starts

MPI_recv Receive a message; block if there are none

MPI_irecv Check if there is an incoming message, but do not block

Message-Oriented Persistent Communication

• Known as message-queuing systems or Message-Oriented Middleware (MOM) Support persistent asynchronous

communication Generally have slow communications Similar to e-mail systems Basic model - applications communicate by

inserting messages in specific queues

Message-Queuing Model• Four combinations for loosely-coupled communications

using queues.

2-26

Message-Queuing Model

• Basic interface to a queue in a message-queuing system.

Primitive Meaning

Put Append a message to a specified queue

GetBlock until the specified queue is nonempty, and remove the first message

PollCheck a specified queue for messages, and remove the first. Never block.

NotifyInstall a handler to be called when a message is put into the specified queue.

General Architecture of a Message-Queuing System

• Messages are inserted into a local source queue The message contains the name of a destination

queue

• The message-queuing system transfers messages to the destination queue Use a db which maps queue names to network

locations

General Architecture of a Message-Queuing System

• Queues are managed by queue managers Special queue managers act as relays which

forward messages to other managers

General Architecture of a Message-Queuing System

• The relationship between queue-level addressing and network-level addressing.

General Architecture of a Message-Queuing System

• The general organization of a message-queuing system with routers.

2-29

Message Brokers

• Message-queuing systems can be used to integrate existing and new applications These diverse applications have different

message formats Since we have old apps, can’t use a standard

message format So use message brokers which convert

messages from one format to another

Message Brokers

• The general organization of a message broker in a message-queuing

• system.

2-30

Example: IBM MQSeries

• IBM MQSeries is used to integrate old apps (generally running on IBM mainframes) Queues are managed by queue managers Queue managers are connected through

message channels Each of the two ends of the message channel is

managed by a message channel agents (MCA) Queue managers can be linked into the same

process as the application using the queue Queue managers implemented using RPC

Example: IBM MQSeries

• General organization of IBM's MQSeries message-queuing system.

2-31

Channels

• Some attributes associated with message channel agents.

Attribute Description

Transport type Determines the transport protocol to be used

FIFO deliveryIndicates that messages are to be delivered in the order they are sent

Message length

Maximum length of a single message

Setup retry count

Specifies maximum number of retries to start up the remote MCA

Delivery retries

Maximum times MCA will try to put received message into queue

Aliases

• In order to be able to change the name of a queue manager or to replace it with another without having to recompile all of the applications which send messages to it, local aliases are used for queue manager names.

Message Transfer

• The general organization of an MQSeries queuing network using routing tables and aliases.

Message Transfer

• Primitives available in an IBM MQSeries MQI

Primitive Description

MQopen Open a (possibly remote) queue

MQclose Close a queue

MQput Put a message into an opened queue

MQget Get a message from a (local) queue

Stream-Oriented Communication

• Multimedia systems use stream-oriented communications The timing of the data delivery is critical in

such systems Such communication is used for continuous

media such as audio where the temporal relationships between different data items are meaningful as opposed to discrete media such as text

Stream-Oriented Communication

• Data streams have several modes Asynchronous transmission mode places no

timing constraints on the data items in a stream Synchronous transmission mode gives a

maximum end-to-end delay for each item in a data stream

Isochronous transmission mode gives both maximum and minimum delays

• Bounded jitter

Stream-Oriented Communication

• Streams can be either simple or complex (with several related simple substreams) Related substreams will need to be

synchronized

• Streams can be be seen as a channel between a source and a sink Source could be a file or multimedia capture

device Sink could be a file or multimedia rendering

device

Data Stream

• Setting up a stream between two processes across a network.

Data Stream

• Setting up a stream directly between two devices.

2-35.2

Data Stream

• An example of multicasting a stream to several receivers.

Streams and QoS

• Time-dependent requirements are generally expressed as Quality of Service (QoS) requirements The underlying distributed system and network

must ensure that these are met We can express such requirements using a flow

specification Partridge’s model uses a token bucket

algorithm

Specifying QoS

• A flow specification.

Characteristics of the Input Service Required

•maximum data unit size (bytes)•Token bucket rate (bytes/sec)•Token bucket size (bytes)•Maximum transmission rate (bytes/sec)

•Loss sensitivity (bytes)•Loss interval (sec)•Burst loss sensitivity (data units)•Minimum delay noticed (sec)•Maximum delay variation (sec)•Quality of guarantee

Specifying QoS

• The principle of a token bucket algorithm.

Setting up a Stream

• Before a stream is opened between source and sink resources through the network must be reserved in order to meet the QoS requirements Bandwidth Buffers Processing capability Figuring out how much of each is required is difficult

since they aren’t specified directly in the QoS RSVP is a protocol for enabling resource reservations

in network routers

Setting Up a Stream

• The basic organization of RSVP for resource reservation in a distributed

• system.

Stream Synchronization

• An important issue is that different streams (possibly substreams of a complex stream) must be synchronized Continuous with discrete Continuous with continuous (more difficult) Different levels of granularity for syncing

required depending on situation

Synchronization Mechanisms

• Synchronization can be carried out by the application

• Can also be supplied by a middleware layer

• Complex streams are multiplexed according to a given synchronization specification (e.g. MPEG)

• Syncing can occur either at the sending or receiving end.

Synchronization Mechanisms

• The principle of explicit synchronization on the level of data units.

Synchronization Mechanisms

• The principle of synchronization as supported by high-level interfaces.

2-41