Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Accelerator.

Similar presentations


Presentation on theme: "Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Accelerator."— Presentation transcript:

1 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Accelerator Integrated Data Access Stanford Linear Accelerator Center George McIntyre, Greg White, Robert Sass, Ron MacKenzie, Judy Rock, Jingchen Zhou July 20th 2002 Software Framework, APIs Status and Further Work

2 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved AIDA Architecture Design requirements AIDA Directory Service Client Devices AIDA Network Server AIDA (Da API) AIDA Data Provider AIDA DA Service

3 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved AIDA Architecture Directory Service is the key Location found by URL in “slaconly” All AIDA participants Bootstrap by finding the Directory Service first Services register with the Directory service when they come on line as authorised handlers of a named set of service requests for a particular group(s) of clients The Directory service can now respond correctly to all clients in the relevant group (including DA) with this service’s interface

4 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved AIDA Architecture Clients can call a service via the DA Can ask the DA to parse and compile queries as well as reconstitution of results Clients can call the Service directly Clients can parse and compile a target reference so that It is validated for correctness and its structure is determined All service references are resolved so that data access can be ultra rapid

5 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Directory Service Schema AIDA Vision Client Devices Server DS AIDA (Da API) AIDA Data Provider DA 3 2 1 DP 3 Client 1 Simple transform of query for immediate target DP 2. Query is translated into a new query for the intermediate service provider 3. The query is sent from this service provider along the chain(s) to the eventual DPs who each have their own specific message

6

7 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Directory Service Schema Name//attribute Can map to one or more service chain Transformation syntax Based on regex and Takes chains of sed like arguments Different transforms for each servers may be specified Data Provider is called in series "chained" -

8 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Directory Service Schema Maps a flat EPICS name space to a structured name space. Eg Attribute VAL.HIST or MODEL.TWISS.X.BETA VAL references the EPICS data provider. VAL.HIST references the Archiver data provider MODEL.* gets from MODEL data provider Visibility of Data Providers and AIDA Servers based on Group Production Development New servers Meta Data Optional type and length If not supplied they need to be discovered by the data provider (e.g. history must discover length), but for instance the slc database data provider must be given the length in order to make an acquisition.

9 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved AIDA Query Syntax – Java Examples package test.java; import java.util.*; // The following libraries must me imported for all AIDA clients // da defines objects used in AIDA clients // util defines common objects available thoughout the AIDA system import edu.stanford.slac.aida.lib.da.*; import edu.stanford.slac.aida.lib.util.common.*; import edu.stanford.slac.aida.lib.util.except.*;

10 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved AIDA Query Syntax – Java Examples class Tests { private DaObject da;// Data Access object public Tests (String [] args) { try { da = new DaObject(args);// Initialise AIDA for this appl. } catch ( Exception e ) { System.err.println( e.getMessage() ); e.printStackTrace(); }

11 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Call by reference – simple type private void simpleTest01() { try { // Create a reference to an Accelerator value DaReference r = new DaReference("QUAD:LI05:901//BCON", da); // Set the type for the simple get operation (if unknown after compile in previous line) r.setType(DaValue.Type.FLOAT); Float v = (Float)da.get(r);// Get data using the reference, may be reused } catch (Exception e) { // Do something; } return }

12 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved History with context using the DaObject private void simpleTest02() { try { da.setParam("STARTTIME", "2001-09-06 12:04"); da.setParam("ENDTIME", "2001-09-06 12:10"); DaValue v = da.getDaValue("HB60:DCCT:SUMY//VAL.HIST"); } catch (Exception e) { // Do something; } return }

13 Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Parametric, constrained, complex query private void simpleTest03() { try { da.setParam("ENDTIME=2001-09-06 12:10;STARTTIME=2001-09-06 12:04"); query = "val={HB60:DCCT:SUMY//VAL}"; query+= ",history={HB60:DCCT:SUMY//VAL.HIST[(#LENGTH-4)-]}"; DaValue v = da.getDaValue(target); } catch (Exception e) { // Do something; } return }


Download ppt "Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Accelerator."

Similar presentations


Ads by Google