Top Banner
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
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.

Dec 20, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 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.

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

Page 2: 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.

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

Page 3: 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.

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)

Page 4: 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.

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

Page 5: 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.

Parameter Passing

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

Page 6: 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.

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

Page 7: 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.

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

Page 8: 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.

Message-Oriented Communication

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

2-20

Page 9: 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.

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

Page 10: 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.

Persistent Communication

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

Page 11: 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.

Persistence and Synchronicity in Communication

a) Persistent asynchronous communicationb) Persistent synchronous communication

2-22.1

Page 12: 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.

Persistence and Synchronicity in Communication

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

2-22.2

Page 13: 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.

Persistence and Synchronicity in Communication

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

Page 14: 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.

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

Page 15: 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.

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

Page 16: 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.

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

Page 17: 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.

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

using queues.

2-26

Page 18: 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.

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.

Page 19: 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.

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

Page 20: 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.

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

Page 21: 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.

General Architecture of a Message-Queuing System

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

Page 22: 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.

General Architecture of a Message-Queuing System

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

2-29

Page 23: 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.

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

Page 24: 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.

Message Brokers

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

• system.

2-30

Page 25: 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.

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

Page 26: 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.

Example: IBM MQSeries

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

2-31

Page 27: 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.

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

Page 28: 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.

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.

Page 29: 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.

Message Transfer

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

Page 30: 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.

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

Page 31: 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.

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

Page 32: 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.

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

Page 33: 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.

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

Page 34: 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.

Data Stream

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

Page 35: 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.

Data Stream

• Setting up a stream directly between two devices.

2-35.2

Page 36: 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.

Data Stream

• An example of multicasting a stream to several receivers.

Page 37: 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.

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

Page 38: 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.

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

Page 39: 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.

Specifying QoS

• The principle of a token bucket algorithm.

Page 40: 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.

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

Page 41: 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.

Setting Up a Stream

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

• system.

Page 42: 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.

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

Page 43: 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.

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.

Page 44: 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.

Synchronization Mechanisms

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

Page 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.

Synchronization Mechanisms

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

2-41