Generating a service coordination from a hybrid query.
-
Upload
carmella-bell -
Category
Documents
-
view
219 -
download
0
Transcript of Generating a service coordination from a hybrid query.
![Page 1: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/1.jpg)
Generating a service coordination from a hybrid query
![Page 2: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/2.jpg)
Problem statement
• Given a query in SeQUEL (resp. HSQL)
derive an executable representation
![Page 3: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/3.jpg)
Desirable properties
• Fit to a dynamic service-based environment• Well-defined semantics• Suitable for implementation yet human readable• Preferably yields optimal execution• Not too costly to derive• Expressed in a stand-alone language
![Page 4: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/4.jpg)
SeQUELquery
Algebraicexpression
Queryworkflow
Servicecoordination
transform transform
transform
build
Datamodel
uses
uses
![Page 5: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/5.jpg)
Data model
• Complex values: nested tuples, sets, and basic types
• Restriction*: flat tuples of atomic complex values (≈relations)
* In terms of full support currently
![Page 6: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/6.jpg)
Algebra
• Equi-join• Bind-join• Time-based window• Tuple-based window• Recursive selection• Recursive projection• Recursive renaming• Group• Ungroup• Union• Intersection• Set difference
• Equi-join• Bind-join• Time-based window• Tuple-based window• Selection• Projection
Formalized Supported
![Page 7: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/7.jpg)
SeQUEL(HSQL)
• SELECT-FROM-WHERE clauses• + windows and function calls
Compatible with supported operators
![Page 8: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/8.jpg)
Query workflow model• Formalized by a graph model
• Equivalent to algebraic expressions: expression ↔ workflow ↔ function composition
• Transformation formalized by construction rules
![Page 9: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/9.jpg)
Service coordination
• Workflow activities are bound to– Data services– Simple and composite computation services
• Binding to data services is enabled by a registry• Binding to computation services is static
![Page 10: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/10.jpg)
SeQUEL query
Join algebraic expression
Join workflow
Complete query workflow
Service coordination
– Identify join attributes– Create hypregraph– Produce parse tree– Traverse parse tree
![Page 11: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/11.jpg)
Data services
• Service interface → n data operations
• Binding-pattern representation
• Example
![Page 12: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/12.jpg)
Example query
Find friends which are no more than 3 km away from my current location (48.85889, 2.29583) considering their locations of the last 10 min, which are also over 21 years old and that are interested in art.
SELECT p.nickname, p.age, p.gender, p.emailFROM profile AS p, location [range 10] AS l,
interests AS iWHERE p.age >= 21 AND l.nickname = p.nickname AND i.nickname = p.nickname AND i.tag=’art’ AND distance(lat, lon, 48.85889, 2.29583) <= 3.0;
![Page 13: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/13.jpg)
Identify join attributes
• Generate symbols for join attributesl.nickname = p.nickname AND i.nickname = p.nickname
![Page 14: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/14.jpg)
Create a hypergraph
N
A
{ , , , , , , , }X =
L
G E
T SN
N L
A G E
T SN
E = {{ , , }, { , , , }, { , , }}
N L
A G E
T SN
N L
A G E
T S
N
L’
L’
N
N
N
L’
N
L’
![Page 15: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/15.jpg)
Produce and traverse parse tree
N A S E
N LL’
N
N T S
N
consume
((NLL’ ⋈ NASE)⋈ NTS)
N
AGE
TS
L L’
Parse tree traversal
algorithm ↺algorithm ↺
![Page 16: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/16.jpg)
SeQUEL query
Join algebraic expression
Join workflow
Complete query workflow
Service coordination
– Translate to postorder– Construct workflow by
stack-based evaluation
![Page 17: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/17.jpg)
Construct workflow by stack-based evaluation
NLL’ NAGE ⋈ NTS ⋈((NLL’ ⋈ NASE)⋈ NTS)
![Page 18: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/18.jpg)
Construct workflow by stack-based evaluation
location(N L L’)
profile(N A G E)
interests(N T S)
NLL’ NAGE ⋈ NTS ⋈ NLL’NAGE
NLL’⋈NAGE
NTSNLL’ NAGE ⋈ NTS ⋈⋈⋈
⋈
![Page 19: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/19.jpg)
SeQUEL query
Join algebraic expression
Join workflow
Complete query workflow
Service coordination
– Apply rules and heuristics
![Page 20: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/20.jpg)
Rules for additional operators
• Place windows next in sequence to data stream operations
• Selections are pushed-down– function calls may involve multiple attributes
• A single projection operation is added at the end* Additional heuristics could be considered
![Page 21: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/21.jpg)
Example
profile
location
[time win] σdist
σage
interests
⋈
⋈
σtag
π
profile
location
interests
⋈
⋈
![Page 22: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/22.jpg)
SeQUEL query
Join algebraic expression
Join workflow
Complete query workflow
Service coordination
– Bind workflow activities to services
![Page 23: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/23.jpg)
Example
Dynamic binding to data services and computation services
profile
location
[time win] σdist
σage
interests
⋈
⋈
σtag
π
location
[time win] σdist
⋈ σage
π
σtag
⋈profile
interests
Workflow of data operations and query operators
![Page 24: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/24.jpg)
Simple and composite computation services
![Page 25: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/25.jpg)
Service provisioning
profile
location
[time win] σdist
σage
interests
⋈
⋈
σtag
π
Genericserviceinstance
operation 1
operation 2
operation n. . .
Interface
operationi(in1, in2, ..) → outputOn-demand data servicesSimple computation servicesComposite computation servicesStream data services
![Page 26: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/26.jpg)
Data services
Stream data service
On-demand data service
subscribe(dest, time) location
profile
t1=⟨nick:Alice, coor:⟨lat,lon⟩⟩
t2=⟨nick:Bob, coor:⟨lat,lon⟩⟩
tn=⟨nick:Mike, coor:⟨lat,lon⟩⟩. . .
profile(nick:’Bob’)out = {⟨nick:Bob, age:23, sex:M,…⟩}
![Page 27: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/27.jpg)
Simple computation service
σdistanc
eGeo-distance
⟨nick:Bob, coor⟩
input()
out = distance(lat1, lon1, lat2, lon2)
⟨nick:Bob,coor⟩out <= 3
[time win] σdist
mycoor
tuple
![Page 28: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/28.jpg)
Composite computation service
Symmetric hash join service [⋈]
inputOp1()
Hash-index1
inputOp2()
Hash-index2
⟨inputTuple1⟩
⟨inputTuplen⟩
⟨outTuple(s)1⟩
hash probeprobe hash
⟨outTuple(s)2⟩
profile
σdist
⋈
![Page 29: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/29.jpg)
Composite computation service
endofInput
createHIs
leftInput
uninitialized
active
terminateddestroyHIs
negTuple
insert_tuple
delete_tuple
probeRight
N
Y
Y
N
negTuple
insert_tuple
delete_tuple
probeLeft
Y
N
endofInput rightInput
N
Y
match
match
Workflow model based on Abstract State Machines (ASM)
Parallel and sequential composition, conditionals, and iteration
![Page 30: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/30.jpg)
Coordination model
![Page 31: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/31.jpg)
Service interoperation and communication
Comp.service A
inputOp1()
Comp.service B
inputOp1()
inputOp2()
Comp.service C. . .
Serv. inst(s)
C
A
B
inputOp1()
inputOp2()
⟨inputTupleA⟩
⟨inputTupleB1⟩
⟨inputTupleB2⟩
⟨outTupleA⟩
⟨outTupleB⟩
![Page 32: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/32.jpg)
GYO reduction larger example
![Page 33: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/33.jpg)
Example query
SELECT * FROM ABC, BF, BCD, DEG, CDE, BHWHEREABC.B1 = BCD.B3 and ABC.C1 = BCD.C3 and BCD.B3 = BF.B2 andBCD.C3 = CDE.C5 and BCD.D3 = CDE.D5 and DEG.D4 = CDE.D5 andDEG.E4 = CDE.E5 and BCD.B3 = BH.B6;
![Page 34: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/34.jpg)
Attribute symbol generation
ABC(A1!, B1!, C1!)
BF(B2?, F2!)
BCD(B3?, C3?, D3!)
DEG(D4!, E4!, G4!)
CDE(C5!, D5!, E5!)
BH(B6!, H6!)
ABC.B1 = BCD.B3ABC.C1 = BCD.C3BCD.B3 = BF.B2BCD.C3 = CDE.C5BCD.D3 = CDE.D5DEG.D4 = CDE.D5DEG.E4 = CDE.E5BCD.B3 = BH.B6
ABC(A1!, B!, C!)
BF(B?, F2!)
BCD(B?, C?, D!)
DEG(D!, E!, G4!)
CDE(C!, D!, E!)
BH(B!, H6!)
![Page 35: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/35.jpg)
Join dependences as a hypergrph
ABC(A1!, B!, C!)
BF(B?, F2!)
BCD(B?, C?, D!)
DEG(D!, E!, G4!)
CDE(C!, D!, E!)
BH(B!, H6!)
A1
CB
E
G4
D
H6
F2
✓
✓
✓
✓
✓
✓
![Page 36: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/36.jpg)
Parse tree construction
ABC(A1!, B!, C!)
BF(B?, F2!)
BCD(B?, C?, D!)
DEG(D!, E!, G4!)
CDE(C!, D!, E!)
BH(B!, H6!)
A1
CB
E
G4
D
H6
F2
BH
BCD
ABC BF
CDE
DEG
ISOLATED:{A1}
SHARED:{B,C}
A1!B!C!
B?C?D!A1!B!C!D!ISOLATED:{F2}
SHARED:{B}
B?F2!
A1!B!C!D!F2!ISOLATED:{H6}
SHARED:{B}
B!H6!
A1!B!C!D!F2!H6!ISOLATED:{B}
SHARED:{C,D}
C!D!E!A1!B!C!D!E!F2!H6!
ISOLATED:{C}
SHARED:{D,E}
D!E!G4!A1!B!C!D!E!F2!G4!H6!
![Page 37: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/37.jpg)
Join expression construction
BH
BCD
ABC BF
CDE
DEG
A1!B!C! B?F2! B!H6!
A1!B!C!D!F2!H6!
A1!B!C!D!E!F2!H6!
A1!B!C!D!E!F2!G4!H6! ⋈DEG⋈
CDE⋈BH ⋈
BF ⋈ABC BCD
Each node denotes a join expressionRoot: ( DEG ⋈ ( CDE ⋈ ( ( ( BCD ⋈ ABC ) ⋈ BF ) ⋈ BH ) ) )
![Page 38: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/38.jpg)
Join expression construction
Inorder expression: ( DEG ⋈ ( CDE ⋈ ( ( ( BCD ⋈ ABC ) ⋈ BF ) ⋈ BH ) ) )
Postorder expression: DEG CDE BCD ABC ⋈ BF ⋈ BH ⋈ ⋈ ⋈Process postorder expression using a stack to generate the join workflow
![Page 39: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/39.jpg)
Workflow generation
⋈ABC
BCD
BF
⋈BH
⋈CDE
⋈
DEG
⋈
DEG CDE BCD ABC ⋈ BF ⋈ BH ⋈ ⋈ ⋈
DEG
CDE
BCD
ABC
BCD ⋈ ABC
BF
(BCD ⋈ ABC) ⋈ BF
BH
( ( BCD ⋈ ABC ) ⋈ BF ) ⋈ BHCDE ⋈ ( ( ( BCD ⋈ ABC ) ⋈ BF ) ⋈ BH )( DEG ⋈ ( CDE ⋈ ( ( ( BCD ⋈ ABC ) ⋈ BF ) ⋈ BH ) ) )
![Page 40: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/40.jpg)
Annexes
![Page 41: Generating a service coordination from a hybrid query.](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f2c5503460f94c47549/html5/thumbnails/41.jpg)
Join expression constructioncreateJoinTree( Node node ) {
if ( node.children() = ∅ )return node;
else {Queue q := new Queue();foreach( child ∈ node.children() )
q.add(child);while( ⌐ queue.isEmpty() ) {
Node leftNode := node;Node rightNode := createJoinTree(queue.remove());Node joinedNode := joinNodes(leftNode, rightNode);node := joinedNode;
}return node;
}}
↺ ↺