emf-incquery 0.7 presentation for itemis

38
Budapest University of Technology and Economics Fault Tolerant Systems Research Group IncQuery Labs Ltd. EMFINCQUERY: Efficient Model Queries for EMF Tools Tamás Szabó, István Ráth

Upload: istvan-rath

Post on 25-May-2015

1.032 views

Category:

Technology


4 download

DESCRIPTION

Presentation on the brand new EMF-IncQuery 0.7, for Itemis.

TRANSCRIPT

Page 1: EMF-IncQuery 0.7 Presentation for Itemis

Budapest  University  of  Technology  and  EconomicsFault  Tolerant  Systems  Research  Group

IncQuery  Labs  Ltd.

EMF-­‐INCQUERY:Efficient  Model  Queries  for  

EMF  Tools  

Tamás  Szabó,  István  Ráth  

Page 2: EMF-IncQuery 0.7 Presentation for Itemis

Overview§ IntroducAon§ EMF-­‐INCQUERY  overview§ Performance  benchmarking§ Roadmap  and  ideas  for  the  future

Page 3: EMF-IncQuery 0.7 Presentation for Itemis

A  key  problem  of  MDE§ Scalability  vs.  modeling  tools

o Issues  encountered  by  several  industrial  partners  using  tools  based  on  the  Eclipse  Modeling  Framework  (EMF)

o Modeling  scenarios  can  get  really  complex  really  quickly• Instance  models  of  size  1-­‐2M  and  beyond• Performance  issues  with  model  transformaLons  and  code  generators  have  an  adverse  effect  on  everyday  development  tasks

§ Scalability?o Complex(meta)models

o Large  instance  modelso Complex  query  and  manipulaLon  scenarios

Recognized  e.g.  by  AUTOSAR  tool  vendorshOp://wiki.eclipse.org/Auto_IWG_WP2

Page 4: EMF-IncQuery 0.7 Presentation for Itemis

Focus:  model  queries§ Model  queries:  

“a  piece  of  code  that  retrieves  a  given  set  of  the  model”§ Queries  are  at  the  heart  of  MDE

o Every  model  access/read  is  a  (simple)  queryo More  complex:  Views,  content  providerso Most  complex:  Model  transformaAons,  code  generators,  …

§ Query  performance  (=  the  speed  of  content  retrieval)  is  crucialo First  vs.  consecuAve  vs.  throughputo Query  result  vs.  query  contents

§ Core  problems1. Slow  query  engines  2. Considerable  programming  effort  necessary  to  get  complex  

queries  right

Page 5: EMF-IncQuery 0.7 Presentation for Itemis

EMF-­‐INCQUERY

Page 6: EMF-IncQuery 0.7 Presentation for Itemis

EMF-­‐INCQUERY  Overview§ A  model  query  engine  for  batch  and  live  queries

Language• Expressive  graph  paOern-­‐based  query  language• Focus  on  reusability:  query  libraries,  recursive  paOern  calls

ExecuAon• IncrementalevaluaAon  based  on  the  Rete  algorithm• Instantaneous  response  for  complex  queries  over  large  models

Tools• On-­‐the-­‐fly  well-­‐formedness  validaAon• Incremental  model  processing  (synchronizaAon,  ...)• View  maintenance• ...

§ Originso 10+  years  of  R&D  experience  in  model  queries  &  transformaAons  

Page 7: EMF-IncQuery 0.7 Presentation for Itemis

Benefits  of  EMF-­‐INCQUERY

§ Makes  on-­‐the-­‐fly  well-­‐formedness  validaAon,  view  maintenance,  …  feasible  over  really  large  instance  models

§ Simplifies  wriAng  really  complex  querieso Graph  paOern  languageo Highly  reusable  à query  libraries

§ Easy-­‐to-­‐integrate  into  exisAng  appsoWorks  with  any  EMF  domain  metamodelo Integrates  through  Eclipse  standards  à works  with  many  EMF-­‐based  apps  out-­‐of-­‐the-­‐box

Page 8: EMF-IncQuery 0.7 Presentation for Itemis

Query  engine

Rete  network

Input  

Intermedia

Output Change  

EMF  instance  

PaOern  matcher  

Input  =  Model  contents  +  EMF  noAficaAons

Output  =  Query  results  +  Query  result  deltas(con<nuously  updated  as  the  model  changes)

EMF-­‐INCQUERY  Base  

Architecture

Page 9: EMF-IncQuery 0.7 Presentation for Itemis

Query  engine

Rete  network

Input  

Intermedia

Output Change  

EMF  instance  

PaOern  matcher  

Input  =  Model  contents  +  EMF  noAficaAons

Output  =  Query  results  +  Query  result  deltas(con<nuously  updated  as  the  model  changes)

EMF-­‐INCQUERY  Base  

Architecture

Model  ModificaAon

Page 10: EMF-IncQuery 0.7 Presentation for Itemis

IncQuery  Base  Indexers§ Stand-­‐alone  core  library  with  minimal  dependencies§ Provides  high  performance  indexers

o Typeàall  instanceso EdgeàSource,Targeto NodeàIncoming/Outgoing  edgeso AUribute  valueàhost

§ Supports  Incremental  TransiLve  Closureo Efficiently  compute  &  maintain  reachability  regions  along  EReference  

navigaLon  paths§ Indexer  iniLalizaLon

o According  to  visitor  strategyo Can  be

• Generic  (all  known  Ecore  types  are  indexed)  [“wildcard  mode”]  • Or  filtered  according  to  a  set  of  types  [memory  opLmizaLon  for  generated  query  code]

Page 11: EMF-IncQuery 0.7 Presentation for Itemis

DEMO§ School  metamodel  in  EMF

INCQUERY  PaOern  Language

Page 12: EMF-IncQuery 0.7 Presentation for Itemis

INCQUERY  PaOern  Language

Page 13: EMF-IncQuery 0.7 Presentation for Itemis

INCQUERY  PaOern  Language

Expressive  declaraAve  query  language  by  graph  paOerns

Capture  local  +  global  queriesComposiAonality  +  Reusabilility  Recursion,  NegaAon

Page 14: EMF-IncQuery 0.7 Presentation for Itemis

Feature  highlights§ State-­‐of-­‐the-­‐art  development  tools  based  on  Xtext2

o Content  assist  (code  compleAon),  validaAon,  outline,  …o Advanced  (syntacAc  and  semanAc)  validaAon

§ Unique  query  language  featureso Recursive  queries  and  transiAve  closureo Inference-­‐supported  type  system  and  expressions  based  on  Xbase  and  Ecoreo PaOern  composiAon  and  reuse

§ RunLmeo Build  and  execute  queries  on-­‐the-­‐flyo Strong  generaAve  bindings  to  Java

§ Extension  APIso Query-­‐based  derived  features  with  noAficaAonso ValidaAon  Engine  for  efficient  on-­‐the-­‐fly  validaAono Event-­‐driven  Virtual  Machine  for  transformaAons

Page 15: EMF-IncQuery 0.7 Presentation for Itemis

INCQUERY  Development  Tools

Page 16: EMF-IncQuery 0.7 Presentation for Itemis

INCQUERY  Development  Tools

Query  Explorer

PaOern  Editor

Page 17: EMF-IncQuery 0.7 Presentation for Itemis

INCQUERY  Development  Tools

Query  Explorer

PaOern  Editor

Page 18: EMF-IncQuery 0.7 Presentation for Itemis

INCQUERY  Development  Tools

Query  Explorer

PaOern  Editor

Queries  are  applied  &  updates  on-­‐the-­‐fly

• Works  with  most  EMF-­‐based  editors  out-­‐of-­‐the-­‐box

• Reveals  matches  as  selecAon

Page 19: EMF-IncQuery 0.7 Presentation for Itemis

IntegraAon  opAons§ IncQuery  Java  API

o Generic  (on-­‐the-­‐fly  queries)o Generated  code  (opLmized  for  performance)

§ Query-­‐based  derived  featureso Edges  and  aUribute  values  computed  and  maintained  by  IncQuery

o Transparent  integraLon  through  genmodeled  EMFo Unique  feature:  Efficient  and  automated  noLficaLon  support

§ Add-­‐on  APIso IncQuery  ValidaLon  (Demo)o IncQuery  Databinding

Page 20: EMF-IncQuery 0.7 Presentation for Itemis

IncQuery  Databinding

JFace  Databinding

Model

QueryMatch  Set

Match

Query

2.  ChangeNoAficaAon

3.a  ResultUpdate

3.b  Match(Property)Update

4.a  Add/Remove  items(list,  table,  tree…)

4.b  Update  Items(list,  table,  tree  item,  label,  …)

1.  Model  ModificaAon

UI  Component

Page 21: EMF-IncQuery 0.7 Presentation for Itemis

Work  in  progress:  IncQuery  Viewers

Page 22: EMF-IncQuery 0.7 Presentation for Itemis

Work  in  progress:  IncQuery  Viewers

1.  Define  “edges”  and  “nodes”  of  an  overlay  graph  as  

queries

Page 23: EMF-IncQuery 0.7 Presentation for Itemis

Work  in  progress:  IncQuery  Viewers

1.  Define  “edges”  and  “nodes”  of  an  overlay  graph  as  

queries

2.  Create  automaAcally  updaAng  JFace  

viewers  (List,  Tree,  Table,  Zest  Graph)  without  manual  

coding

Page 24: EMF-IncQuery 0.7 Presentation for Itemis

PERFORMANCE  BENCHMARK

Instantaneous  result  retrieval?

Page 25: EMF-IncQuery 0.7 Presentation for Itemis

Benchmarking  scenario§ In-­‐memory  models

o Embedded  railways  control  sodware  system  design  domain  (complex  queries)

o Instance  models  up  to  2.7M  EObjects  and  11.1M  EReferences

§ Scenario:  model  transformaLon  combined  with  well-­‐formedness  validaLono Batch:  loading  models  +  execuLng  querieso On-­‐the-­‐fly:  transforming  models  +  re-­‐execuLng  queries  instantaneously

§ Toolso Eclipse  tools  (OCL,  OCL  Impact  Analyzer,  INCQUERY,  EMF-­‐Java  manually  opLmized)

o Neo4j  in-­‐memory  graph  database  (for  comparison)

Page 26: EMF-IncQuery 0.7 Presentation for Itemis

Batch  operaAons

Page 27: EMF-IncQuery 0.7 Presentation for Itemis

Batch  operaAons

Neo4j  scales  somewhat  beOer  than  top  EMF  

tools

…  unless  you  augment  EMF  with  INCQUERY

Page 28: EMF-IncQuery 0.7 Presentation for Itemis

Batch  operaAons

Neo4j  scales  somewhat  beOer  than  top  EMF  

tools

…  unless  you  augment  EMF  with  INCQUERY

Note  the  logarithmic  scales:  7x  faster!

Page 29: EMF-IncQuery 0.7 Presentation for Itemis

Real  strength:  on-­‐the-­‐fly  model  processing

Page 30: EMF-IncQuery 0.7 Presentation for Itemis

Real  strength:  on-­‐the-­‐fly  model  processing

• IncQuery  provides  near  zero  response  Ames  for  up  to  14M  elements

Page 31: EMF-IncQuery 0.7 Presentation for Itemis

Real  strength:  on-­‐the-­‐fly  model  processing

• IncQuery  provides  near  zero  response  Ames  for  up  to  14M  elements

CharacterisAc  difference

Page 32: EMF-IncQuery 0.7 Presentation for Itemis

Memory  usage§ Depends  on  “query  complexity”  and  model  size/contents

§ For  typical  query/model  combinaAons,  memory  overhead  is  linearo (1.1-­‐2)  x  (heap  required  for  the  model  itself)o IncQuery’s  built-­‐in  semanAc  validators  and  the  Rete  Visualizer  aid  you  in  resolving  problemaAc  query/model  combinaAons

Page 33: EMF-IncQuery 0.7 Presentation for Itemis

APPLICATIONS  AND  ROADMAP

Page 34: EMF-IncQuery 0.7 Presentation for Itemis

Known  applicaAons§ Well-­‐formedness  validaAon  of  very  large,  industrial  AUTOSAR  models  (AutomoAve  OEM)

§ Incremental  dependency  analysis  over  sotware  infrastructure  graphs  (tool  used  in  CERN)

§ Queries,  views  and  transformaAons  for  model-­‐driven  tool  development  in  the  avionics  domain  (aircrat  manufacturer)

§ Model-­‐driven  refactoring  of  large  source  code  models  (CollaboraAve  naAonal  project  in  Hungary)

Page 35: EMF-IncQuery 0.7 Presentation for Itemis

Development  agenda§ Our  current  plan

o IncQuery  Viewerso Dynamic  EMF  supporto Xcore  integraAon  (query-­‐based  derived  features)o Query  performance  opAmizaAono Improve  support  for  stereotyped  UML  models

§ ARTop/Sphinx  integraAono Incremental  validaAon  using  “hybrid  queries”• Support  parAally  materialized  models

Page 36: EMF-IncQuery 0.7 Presentation for Itemis

Other  ideas  on  the  table§ ParLal  support  for  OCL§ Dedicated  support  for  Complex  Event  Processing  over  live  EMF  modelso hUp://incquery.net/incquery/demos/jnecto Think  incremental  queries  over  the  E4  Modeled  UI…

§ Develop  a  high  performance  and  pragmaLc  model  transformaLon  engineo Build  the  language  on  Xbase  and  IQPLo …and  the  runLme  on  IncQuery

§ Design  space  exploraLono OpLmize  instance  models  towards  a  complex  design  goal

Page 37: EMF-IncQuery 0.7 Presentation for Itemis

Final  points§ EMF-­‐INCQUERY  has  been  successfully  migrated  to  Eclipse.org  hUp://eclipse.org/incquery

§ EMF-­‐INCQUERY  0.7  milestone  builds  are  available  immediately  from  the  Marketplaceo Blog  and  other  resources:  hOp://incquery.net  o Lots  of  documentaAon:  examples,  demos,  tutorials

§ Release  0.7  is  tentaAvely  scheduled  shortly  ater  the  Eclipse  Kepler  Launch  (beginning  of  July)

§ Your  contribu<ons  (feedback,  forum  posts,  ideas,  bugzillas,  patches)  are  very  welcome!

Page 38: EMF-IncQuery 0.7 Presentation for Itemis

Acknowledgements§ IncQuery  Development  Team

o Gábor  Bergmann,  Ábel  Hegedüs,  Ákos  Horváth,  András  Ökrös,  Zoltán  Ujhelyi,  István  Ráth

§ AddiLonal  contributorso Márk  CzoUer,  Tamás  Szabó

§ Performance  benchmarkingo Benedek  Izsó,  Zoltán  Szatmári

§ TesLng,  exampleso Asla  Csicsely,  Tamás  Csurgó,  Dániel  Kávássy,  Gábor  Szárnyas,  Tamás  Tóth,  Ádám  Dudás,  Oszkár  Semeráth,  Zoltán  Balogh

§ IncQuery  Project  Lead:  István  Ráth§ Senior  advisor:  Dániel  Varró