07.01.2013 Views

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

16 TTCN-3 493<br />

possible locations where the components may be distributed; the homes reflect<br />

the user constra<strong>in</strong>ts for distribution.<br />

The next piece of XML code is an example of a component assembly file.<br />

The special tag <strong>in</strong>dicates the host where the MTC component is deployed. The<br />

selector def<strong>in</strong>es a filter to select all components of type ptcType. The selected<br />

components can be deployed either on conta<strong>in</strong>er1 or on conta<strong>in</strong>er2. One can<br />

def<strong>in</strong>e deployment constra<strong>in</strong>ts for each conta<strong>in</strong>er (ex. do not allow deployment<br />

of more than 100 components on conta<strong>in</strong>er2). The user can constra<strong>in</strong> the memory<br />

usage, the CPU load, the number of components etc.<br />

<br />

<br />

Example to use TCDL language<br />

<br />

<br />

<br />

<br />

<br />

ptcType<br />

<br />

<br />

<br />

10<br />

<br />

<br />

100<br />

<br />

<br />

<br />

<br />

Usually, the def<strong>in</strong>ition of constra<strong>in</strong>ts is a difficult task; for complex setups it<br />

may be very difficult to describe an efficient distribution. Therefore, the task of<br />

hardware options and constra<strong>in</strong>ts should be realized by the execution environment.<br />

It should provide services, which implement distribution algorithms that<br />

are designed to be efficient for a certa<strong>in</strong> type of problems. The task of the user<br />

rema<strong>in</strong>s to select the algorithm which solves the problem best. The code below<br />

shows a set which deploys the components of types ptcType2, ptcType3 and<br />

the <strong>in</strong>stances 1, 2 and 5 of type ptcType4 on the conta<strong>in</strong>er2 and conta<strong>in</strong>er3, accord<strong>in</strong>g<br />

with the mem50 algorithm. The mem50 is an example of an algorithm<br />

which allows to deploy components on a conta<strong>in</strong>er until the limit of 50 percent<br />

of memory is reached.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!