25.01.2015 Views

Cost-Based Optimization of Integration Flows - Datenbanken ...

Cost-Based Optimization of Integration Flows - Datenbanken ...

Cost-Based Optimization of Integration Flows - Datenbanken ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

4 Vectorizing <strong>Integration</strong> <strong>Flows</strong><br />

two additional hash maps as secondary index structures for source operators and target<br />

operators over the set <strong>of</strong> data dependencies D. Then, for any operator o i we only need to<br />

iterate over the lists <strong>of</strong> its own source and target dependencies. This leads to a quadratic<br />

worst-case time complexity for the algorithm part <strong>of</strong> graph creation. However, for the<br />

general case, where we need to iterate over all dependencies, we have cubic complexity.<br />

Furthermore, for low numbers <strong>of</strong> data dependencies, the overhead <strong>of</strong> the A-PV is moderate<br />

and therefore, we use the more general form.<br />

Rewriting Context-specific Operators<br />

In addition to the core rewriting algorithm, we now discuss rewriting rules for the contextspecific<br />

operators Switch, Iteration, and Savepoint as well as specific situations, where<br />

multiple writes to external systems must be synchronized (Invoke) in order to guarantee<br />

semantic correctness when applying plan vectorization.<br />

Rewriting Switch operators. When rewriting Switch operators, we must be aware <strong>of</strong><br />

their ordered if-elseif-else semantics. Here, message sequences are routed along different<br />

switch-paths, which will eventually be merged. Assume a message sequence <strong>of</strong> m 1 and<br />

m 2 , where m 1 is routed to path A, while m 2 is routed to path B. If W (A) ≥ W (B) +<br />

W (Switch B ), m 2 arrives earlier at the merging point than m 1 does. Hence, a message<br />

outrun has taken place. In order to overcome this problem, we could use timestamp<br />

comparison at the merging point. Therefore, we introduced the XOR operator that is<br />

inserted just before the single switch paths are merged. It reads from all queues, compares<br />

the timestamps <strong>of</strong> read messages and forwards the oldest. Due to the possibility <strong>of</strong> message<br />

starvation (we are not allowed to forward a message until we read a younger message from<br />

all other switch paths) in combination with possibly nested Switch operators, we use a<br />

so-called synchronization queue that represents the temporal order <strong>of</strong> messages and thus,<br />

by comparing the message source IDs with the read synchronization IDs, we overcome<br />

the problem <strong>of</strong> starvation because we can output messages according to this sequence <strong>of</strong><br />

IDs. The dedicated synchronization queue is required due to arbitrarily nested Switch<br />

operators, where the assumption <strong>of</strong> a cohesive sequence <strong>of</strong> source IDs does not hold.<br />

Example 4.3 (Rewriting Switch Operators). Assume the dependency graph DG(P 1 ) <strong>of</strong><br />

Switch (o2)<br />

[in: msg1]<br />

Receive (o1)<br />

[service: s3, out: msg1]<br />

δ msg1<br />

D<br />

Translation (o3)<br />

[in: msg1, out: msg2]<br />

Translation (o5)<br />

[in: msg1, out: msg2]<br />

δ msg1<br />

D<br />

@type='MATMAS04'<br />

Switch (o2)<br />

[in: msg1]<br />

@type='MATMAS05'<br />

δ msg1<br />

D<br />

Assign (o4)<br />

[in: msg2, out: msg3]<br />

Assign (o6)<br />

[in: msg2, out: msg3]<br />

δ msg2<br />

D<br />

Translation (o3)<br />

[in: msg1, out: msg2]<br />

Assign (o4)<br />

[in: msg2, out: msg3]<br />

Translation (o5)<br />

[in: msg1, out: msg2]<br />

Assign (o6)<br />

[in: msg2, out: msg3]<br />

δ msg2<br />

D<br />

XOR (ox)<br />

[in: msg3, out: msg3]<br />

δ msg3<br />

D<br />

Invoke (o7)<br />

[service s1, in: msg3]<br />

δ msg3<br />

D<br />

Invoke (o7)<br />

[service s1, in: msg3]<br />

(a) Dependency Graph DG(P 1) <strong>of</strong> Subplan P 1<br />

(b) Vectorized Subplan P ′ 1<br />

Figure 4.6: Rewriting Switch Operators<br />

96

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

Saved successfully!

Ooh no, something went wrong!