• Keine Ergebnisse gefunden

Backtracking (BT)

4.2. Centralized Application Configuration

4.2.3. Intelligent Backtracking

4.2. Centralized Application Configuration 97

Figure 4.17.: Proceeding ofSBT requires backtracking

C5 C7

C8

C9 C6

C1

C2 C3

[0][3]

[0][0][1]

[0]

[0][1][0]

C4

[0][2]

[0][1]

[0][3][0]

[0][0][0]

[0][0]

[0][2][0]

= instantiated component

Figure 4.18.: Initial situation for backtracking

be instantiated due to a shortage of a specific resource R. Thus, Cmpi form a set S1 of m components, i.e.,

S1 ={Cmp1, Cmp2, ..., Cmpm} (4.8) If Ctr0 is not multi-optional, then m = 1, i.e., S1 includes only one component.

Now, DBTdetermines the set S2 of n devices

S2 ={D1, D2, ..., Dn} (4.9) which host at least one component Cmpk that is included in S1. More formal, this condition can be described by the following equation:

∃k ∈ {1, ..., m}, l ∈ {1, ..., n}: (Cmpk ∈S1∧Cmpkh Dl)⇒Dl∈S2, (4.10) whereasCmpkh Dl denotes that device Dl hosts component Cmpk.

Subsequently, DBTdetermines a third set S3 of pmulti-optional contracts S3 ={Ctr1, Ctr2, ..., Ctrp} (4.11) This set contains only those multi-optional contracts Ctrk (k ∈ {1, ..., p}) for which the following three conditions hold:

1. Ctrk is of higher priority than Ctr0. This means that Ctrk has already been configured by DBTdue to its depth-first approach.

2. The currently selected component Cmpk of Ctrk is resident on a device Dk which is included inS2, i.e., Cmpk ∈S1.

3. There exists an alternative component on another device Dy that can be in-stantiatednow due to sufficient free amount ofR onDy.

The contracts inS3 are ordered descendingly according to the amount of resourceR that is consumed by the instantiated component. This means that the instantiated component which consumes the largest amount ofR is at the beginning of the list, because its termination would cause a considerable deallocation of resources. This

4.2. Centralized Application Configuration 99

C5 C7

C8

C9 C6

C1

C2 C3

[0][3]

[0][0][1]

[0]

[0][1][0]

C4

[0][2]

[0][1]

[0][3][0]

[0][0][0]

[0][0]

[0][2][0]

= instantiated component

1

Prefer

PreferCC22duedueto to smallersmallersubtree!subtree!

Figure 4.19.: Intelligent backtracking of DBT

helps to decrease the number of needless adaptations which would have to be revised later. If only one suitable component exists, the backtracking target is obviously found and the adaptation process can be initiated.

In case of more than one suitable backtracking targets that consume an identical amount of R, an additional selection criterion is necessary for weighting them ac-cording to their suitability for adaptation. Since adaptation is simpler for contracts with small adherent subtrees (as the subtree also has to be adapted), DBT selects the component C that has least descendants (number of all successors down to the leaves) and, hence, is closest to the bottom of the tree. Thus, contracts with little adaptation overhead are preferred. In case of multiple contracts with a subtree of the same size, the algorithm randomly selects one of these contracts and adapts this contract.

If the resource conflict cannot be solved by adapting the first contract inS2,DBT tries to solve it by adapting the second contract in S2, and so on. If the conflict cannot be solved by adapting any contract included in S2, this indicates that there are not sufficient resources in the environment. Thus, the algorithm terminates unsuccessfully within the stoppedfunction and notifies the user of this failure.

To clarify how DBTproceeds in intelligent backtracking, consider the exemplary application shown in Figure 4.18. Here, all contracts have successfully been con-figured by selecting the highlighted components. However, the PC monitor used as component instance [0][3][0] for contract C9 suddenly fails, leaving this contract unconfigured. Besides the PC monitor, the introduced set S1 includes a video pro-jector as alternative component. However, as the two video propro-jectors are currently used within other contracts (C1 and C2), the configuration has to be adapted, i.e., backtracking has to be performed.

In this situation, Direct Backtracking first determines the setS3 of multi-optional contracts with higher priority which have currently instantiated a component that is able to resolve the dependencies required byC9. As the instances [0][0] forC1 and [0][0][0] forC2 are currently represented by the two video projectors (which form set S2), these two contracts are possible backtracking target for Direct Backtracking, as it can be seen in Figure 4.19. Since instance [0][0][0] does not have any child

C5 C7

C8

C9 C6

C1

C2 C3

[0][3]

[0][0][1]

[0]

[0][1][0]

C4

[0][2]

[0][1]

[0][3][0]

[0][0][0]

[0][0]

[0][2][0]

= instantiated component

1 2

3 4

5

Figure 4.20.: Standard backtracking of SBT

components at all, DBT selects C2 as backtracking target, stops the use of the instantiated video projector, and subsequently starts to bind the laptop display component to dependency C2. Then, DBT returns to instance [0][3][0], where the video projector is available now. In the following, the adaptation is completed, and the application is available to the user again.

Now, regard how Synchronous Backtracking (SBT) acts in the same situation, as depicted in Figure4.20. SBTdoes not incorporate the cause of backtracking into its considerations, so it simply adapts the nearest multi-optional contract according to the depth-first approach (i.e., the multi-optional contract with highest ID) to resolve the resource conflict. Therefore in this situation, SBT initially adapts the multi-optional contractC7 by stopping the currently instantiated loudspeaker component and instantiating the alternative desktop speakers. Obviously, this does not help to resolve the resource conflict with the visual output components, so SBT has to perform another backtracking. This time, contract C6 is adapted, which is however also not resolving this conflict. In the following,SBT unsuccessfully tries to resolve the resource conflict by adapting contract C4, until the subsequent adaptation of C2 finally represents the solution to the resource conflict problem. Summarizing, SBTneeds four adaptations, which yields significantly increased adaptation latencies compared to the single adaptation thatDBThas to take. Section4.5.2presents more extensive evaluations which compareDBT toSBT.

4.3. A Framework for Adapting the Degree of Decentralization

In heterogeneous environments, approaches alternative to the decentralized one may exploit the computation resources more efficiently. Therefore, concepts to support algorithms with various degrees of decentralization in their calculations, as well as a mechanism to automatically switch between the provided approaches is needed.

In approaches different to the decentralized one, specific devices need to obtain information about the available resources and services of remote devices. If this

4.3. A Framework for Adapting the Degree of Decentralization 101 information is not obtained before runtime, it increases the configuration latencies, since the configuration device(s) cannot start the configuration process before. To increase efficiency of non-decentralized configuration, we suggest the introduction of a pre-configuration process that is performed in time periods prior to configuration calculations and reduces the configuration latencies effectively [SHR08a].

Thus in this section, we first discuss the requirements for a framework to enable the automatic adaptation of configuration algorithms in Section 4.3.1. Then, we introduce a clustering framework (Section 4.3.2) to identify different device types and establish unique clusters. Following in Section 4.3.3, we introduce a strategy which selects the node weights in a resource-aware manner. Then, we discuss the initial cluster formation as well as the cluster maintenance by using an adapted version of the DMAC algorithm in Section 4.3.4. Next in Section 4.3.5, we present the VC concept which enables the local emulation of remote devices and is used by the centralized and hybrid configuration schemes. This enables the exclusion of the weak devices from configurations. Finally, we present a simple algorithm to automatically switch between different configuration approaches in Section 4.3.6.