emf-incquery 0.7 presentation for itemis

Post on 25-May-2015

1.032 Views

Category:

Technology

4 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

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  

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

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

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

EMF-­‐INCQUERY

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  

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

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

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

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]

DEMO§ School  metamodel  in  EMF

INCQUERY  PaOern  Language

INCQUERY  PaOern  Language

INCQUERY  PaOern  Language

Expressive  declaraAve  query  language  by  graph  paOerns

Capture  local  +  global  queriesComposiAonality  +  Reusabilility  Recursion,  NegaAon

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

INCQUERY  Development  Tools

INCQUERY  Development  Tools

Query  Explorer

PaOern  Editor

INCQUERY  Development  Tools

Query  Explorer

PaOern  Editor

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

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

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

Work  in  progress:  IncQuery  Viewers

Work  in  progress:  IncQuery  Viewers

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

queries

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

PERFORMANCE  BENCHMARK

Instantaneous  result  retrieval?

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)

Batch  operaAons

Batch  operaAons

Neo4j  scales  somewhat  beOer  than  top  EMF  

tools

…  unless  you  augment  EMF  with  INCQUERY

Batch  operaAons

Neo4j  scales  somewhat  beOer  than  top  EMF  

tools

…  unless  you  augment  EMF  with  INCQUERY

Note  the  logarithmic  scales:  7x  faster!

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

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

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

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

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

CharacterisAc  difference

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

APPLICATIONS  AND  ROADMAP

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)

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

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

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!

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ó

top related