OPeNDAP Hyrax Back-End Server (BES) Customization ESIP Federation Workshop 15 July 2008 Patrick West James Gallagher.

Slides:



Advertisements
Similar presentations
The HDF Group ESIP Summer Meeting Easy access HDF files via Hyrax Kent Yang The HDF Group 1 July 8 – 11, 2014.
Advertisements

Hyrax Installation and Customization ESIP ‘08 Summer Meeting Best Practices in Services and Data Interoperability Dan Holloway James Gallagher.
Java Script Session1 INTRODUCTION.
OPeNDAP’s Server4 Building a High Performance Data Server for the DAP Using Existing Software Building a High Performance Data Server for the DAP Using.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Servlets and a little bit of Web Services Russell Beale.
CP476 Internet Computing Browser and Web Server 1 Web Browsers A client software program that allows you to access and view Web pages on the Internet –Examples.
Tomcat Configuration A Very, Very, Very Brief Overview.
Introduction to eValid Presentation Outline What is eValid? About eValid, Inc. eValid Features System Architecture eValid Functional Design Script Log.
Amazon EC2 Quick Start adapted from EC2_GetStarted.html.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Hyrax Installation and Customization Dan Holloway James Gallagher.
Shibboleth 2.0 IdP Training: Basics and Installation January, 2009.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
JavaScript & jQuery the missing manual Chapter 11
Hyrax Architecture Two cooperating processes: –Front-end provides DAP interface –Back-end reads data Both parts can be customized –Front-end: different.
Software Architecture for ColdFusion Developers Unit 4: Application Events and Global Variables.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
SchwartzGBIF Nodes III29 April 2003 DiGIR Portal Installation And Configuration.
OOI CyberInfrastructure: Technology Overview - Hyrax January 2009 Claudiu Farcas OOI CI Architecture & Design Team UCSD/Calit2.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
OPeNDAP Developer’s Workshop Feb OPeNDAP 4 Data Server – Hyrax James Gallagher and Nathan Potter 21 Feb 2007.
1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.
SUSE Linux Enterprise Desktop Administration Chapter 12 Administer Printing.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Architecture: Component and Deployment Diagrams Patrick Bailey Keith Vander Linden Calvin College.
Chapter 3 Servlet Basics. 1.Recall the Servlet Role 2.Basic Servlet Structure 3.A simple servlet that generates plain text 4.A servlet that generates.
Server-Side Functions. Contents Background on DAP2 and Constraints Writing Server Functions: short version Programming with libdap A Real Server Function.
Accessing Remote Datasets using the DAP protocol through the netCDF interface. Dr. Dennis Heimbigner Unidata netCDF Workshop August 3-4, 2009.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Unidata’s TDS Workshop TDS Overview – Part I July 2011.
Remote Data Access with OPeNDAP Dr. Dennis Heimbigner Unidata netCDF Workshop October 25, 2012.
WDO-It! 102 Workshop: Using an abstraction of a process to capture provenance UTEP’s Trust Laboratory NDR HP MP.
DAP Servers and Services Section 2 APAC ‘07 OPeNDAP Workshop 12 Oct 2007 James Gallagher Thanks to Jennifer Adams, John Caron, Roberto De Almeida, Nathan.
 Registry itself is easy and straightforward in implementation  The objects of registry are actually complicated to store and manage  Objects of Registry.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
OPeNDAP Hyrax Harnessing the power of the BES OPeNDAP Hyrax Back-End Server Patrick West
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
OPeNDAP Hyrax Back-End Server (BES) Original version presented at APAC 2007 OPeNDAP Workshop Patrick West.
Chap 2 – Getting Started COMP YL Professor Mattos.
OPeNDAP Developer’s Workshop Feb Server-side Functions for Geo-spatial Selection James Gallagher 22 Feb 2007.
OPeNDAP’s Server4: Building a High Performance Data Server for the DAP Using Existing Software James Gallagher*, Nathan Potter*, Patrick West**, Jose Garcia**
1 Earth System Grid Center for Enabling Technologies OPeNDAP Services for ESG March 9, 2016 Peter Fox, Patrick West, Stephan Zednik RPI Performance Measures.
9/21/04 James Gallagher Server-Side: The Basics This part of the workshop contains an overview of the two servers which OPeNDAP has developed. One uses.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
TSDS (HPDE DAP). Objectives (1) develop a standard API for time series-like data, (2) develop a software package, TSDS (Time Series Data Server), that.
9/21/04 James Gallagher Server Installation and Testing: Hands-on ● Install the CGI server with the HDF and FreeForm handlers ● Link data so the server.
Installing the THREDDS and Aggregation Servers ● Install and verify the Tomcat servlet engine ● Install and verify the THREDDS servlet (which also contains.
OPeNDAP Hyrax Back-End Server (BES)
Using Community-Driven Metadata Conventions with On-Line Data
DAP+NETCDF Using the netCDF-4 Data Model
Checking the Server.
Hyrax Configuration.
Servlet Fudamentals.
Other Services in Hyrax
Data Handlers.
Chapter 2: System Structures
Writing a Custom DispatchHandler
Deploying and Configuring SSIS Packages
Knowledge Byte In this section, you will learn about:
Checking the Server.
Created by Atif Aziz. ELMAH means is "Error Logging Modules and Handlers". It is an application-wide error logging facility that is completely pluggable.
OPeNDAP’s Server4: Building a High Performance Data Server for the DAP
OPeNDAP/Hyrax Interfaces
Presentation transcript:

OPeNDAP Hyrax Back-End Server (BES) Customization ESIP Federation Workshop 15 July 2008 Patrick West James Gallagher

OPeNDAP’s Hyrax Architecture OLFS Java Servlet Engine BES Unix Daemon BES Commands XML- encapsulated object File system with data files, SQL Database, … DAP2 THREDDS HTML Optional THREDDS catalogs Module

In what ways can you extend the BES? Extensions are dynamically loaded from a shared object module Containers and Definitions, and ways of storing them Dataset Catalogs Interface Initialization/Termination New commands (like our hello world example) New response objects New response handlers New request handlers (data handlers like hdf4, hdf5, …) Aggregation engines Methods of returning your data (return as netcdf) Reporters Exception Handlers Debugging

Modules are dynamically loaded into the BES Within the BES configuration you specify the modules that you want to load into the BES. The module is derived from the C++ abstract class BESAbstractModule. The class impelements a C-style function called maker that instantiates the module class The class implements an initialization and termination method to set up and clean up the module. The module can add named handlers to the different pieces of the BES. The module can extend already existing modules, for example extending the DAP2 module. The module can modify already existing modules, such as changing the way certain responses are built.

BES Configuration File /usr/local/etc/bes/bes.conf

Running what we have Let’s see what we have already installed besctl start (if it’s not already running) bescmdln -h localhost -p show help; show version; show keys; set container in catalog values c,data/nc/fnoc1.nc; define d as c; get dds for d; define d as c with c.constraint=“u”; get dds for d; get ascii for d;

Or use the OLFS ${CATALINA_HOME}/bin/startup.sh Start your browser Localhost:8080/opendap/ Select data, then nc, then fnoc1.nc Click the check box next to the variable u Click the button ‘Get ASCII’

The CSV Data Handler Module /root/src/bes-3.6.2/csv-handler …more ‘data/temperature.csv’ "Station ","latitude ","longitude ","temperature_K ","Notes ” "CMWM",-34.7,23.7,264.3, "BWWJ",-34.2,21.5,262.1,"Foo” "CWQK",-32.7,22.3,268.4, "CRLM",-33.8,22.1,270.2,"Blah” "FOOB",-32.9,23.4,269.69,"FOOBAR"

Setting up the example cd /root/src/bes-3.6.2/csv-handler autoreconf./configure make install –This will build and install the module library and the sample data make bes-config –This will make the changes to the bes.conf file

BES Configuration File /usr/local/etc/bes/bes.conf

Restart it all ${CATALINA_HOME}/bin/shutdown.sh besctl stop besctl start ${CATALINA_HOME}/bin/startup.sh Back in the browser –localhost:8080/opendap/ –Select data, then csv, then temperature.csv –Click the button ‘Get ASCII’

CSVModule class Example Module class: –see /root/src/bes-3.6.2/csv-handler/CSVModule.cc Implements initialize and terminate methods (and dump) Adds: (typical for data handlers) –new request handler –new container –new catalog

Containers A container represents data –Typically a data file –Can represent a request to a remote system, such as WCS Has three main parts: 1. Symbolic name (‘cool_data’) 2. Real name (e.g., a filename) 3. Type (nc, ff, csv,...) matches the name of the data/request handler Derive from the abstraction BESContainer The BESFileContainer is built into the BES You might add... WCSContainer

Accessing the container Implement the access method: virtual string access() ; Returns the data container to be accessed, typically full path to a file. –BESFileContainer returns the stored file name –A WCSContainer might make a WCS request to the remote server, store the resulting data file, and returns the path to that resulting, cached, data file.

Definitions Analogous to a view of data in a RDB Can encompass many containers (available soon) Can specify constraints for each container Can specify data attributes from each container Specify aggregation engine and command define d as [,…, ] [with.constraint=“…”,.attributes=“…”,.constraint=“…”,.attributes=“…” aggregate using by ];

Dataset Catalogs OLFS uses BES and THREDDS catalogs for dataset catalog traversal Can have multiple catalogs in a single BES representing any type of catalog (coming soon) –Filesystem –Database catalog Each Catalog is configurable Catalogs inherit from the abstraction BESCatalog Add to the list of catalogs in the module class: BESCatalogList::TheCatalogList()->add_catalog( catalog ) ;

Typical Catalog Configuration Data handlers, e.g. csv-handler, add a BESCatalogDirectory representing a file system. In the BES configuration file: –BES.Catalog.catalog.RootDirectory - data root directory of the catalog named “catalog” –BES.Catalog.catalog.TypeMatch - data types matched by file extensions –BES.Catalog.catalog.Include - what nodes to include in the catalog list (usually everything) –BES.Catalog.catalog.Exclude - what nodes to exclude (e.g. dot files) Let’s look at /usr/local/etc/bes/bes.conf

Catalogs and Containers Can create containers within the context of catalogs using BESContainerStorageCatalog Uses BES.Catalog.catalog.TypeMatch to determine data type. set container in catalog values c, ;

Request Handlers Derived from BESRequestHandler Fills in response objects Register functions that say “I know how to fill in some response”

Registering a Request Handler Inside the Module class the request handler is registered with the BES BESRequestHandlerList::TheList()->add_handler( name, handler ) CSVModule::initialize() BESRequestHandlerList::TheList()-> add_handler( modname, new CSVRequestHandler( modname ) ) ;

I know how Inside the constructor for the request handler you register functions that know how to fill in responses add_handler( “name”, function ) CSVRequestHandler::CSVRequestHandler add_handler( DAS_RESPONSE, CSVRequestHandler::csv_build_das ) ; add_handler( DDS_RESPONSE, CSVRequestHandler::csv_build_dds ) ; add_handler( DATA_RESPONSE, CSVRequestHandler::csv_build_data ) ; add_handler( VERS_RESPONSE, CSVRequestHandler::csv_build_vers ) ; add_handler( HELP_RESPONSE, CSVRequestHandler::csv_build_help ) ;

How does it work Definitions def as c1, c2 get das for def Containers c1,file1,csv c2,file2,csv ce,file3,nc c4,file4,ff def command Response Handlers das, BESDASResponseHandler help, BESHelpResponseHandler Request Handlers csv, CSVRequestHandler das, fill_das_func help, fill_help_func das csv das c1 das c1 c2 das show help help csv

Putting it together so far

Summary: CSV Data Handler Module Look at CSVModule –Adds CSVRequestHandler –Adds BESCatalogDirectory –Adds BESContainerStorageCatalog Look at CSVRequestHandler –Adds functions to fill in DAS, DDS, DataDDS, Version and Help responses These functions fill in the respective response objects

25 More information… The Following slides provide more information on BES –Interfaces –Callbacks –Request plans –Commands –Response objects –Response handlers

The Interface There is a single interface into the BES. Inherits from the abstraction BESInterface –Installed version uses BESCmdInterface –CEDAR uses BESApacheInterface –Creating BESXMLInterface Interface runs a set of steps: –initialize the BES environment –build the execution plan –execute the request plan building the response object –transmit the response object –log the status of the request –report on the request –end the request

BESDataHandlerInterface BESDataHandlerInterface structure is carried throughout the execution of the commands –Holds on to the response handler –Stores the list of containers –Holds the action being taken –Holds map of name/value pairs to be used during execution –Holds an error object if an error/exception occurs

Init/End callbacks Can register callbacks during the initialization and end steps static void BESInterface::add_init_callback( p_bes_init init ) ; static void BESInterface::add_end_callback( p_bes_end end ) typedef bool (*p_bes_init)( BESDataHandlerInterface &dhi ) ; typedef void (*p_bes_end)( BESDataHandlerInterface &dhi ) ; Examples: –Authentication/authorization –Initialize database connections –Clean up database connections and files

Building the request plan Derived classes of BESInterface implement: virtual void build_data_request_plan() ; –BESCmdInterface parses the incoming command string –BESApacheInterface translates information from apache and parses the incoming command string –BESXMLInterface parses the XML document Creates a response handler to execute the command

Commands String commands sent from client to server Built in commands: –show help; (version, process, status, keys) –set container … –show containers; –delete container ; –delete containers; –define … –show definitions; –delete definition ; –delete definitions; –set context to ; –show context;

DAP Commands DAPCommandModule adds: –get das for [return as type]; –get dds … –get ddx … –get dods … –show catalog [for “node”]; (info) dap-server modules (www,usage,ascii) add: –get info_page … –get ascii … –get html_form … Data handlers (nc, ff, csv) don’t add any new commands.

Response Objects Derived from BESResponseObject. –BESDASResponseObject –BESInfo No methods required to be implemented Created by a BESResponseHandler Filled in by BESResponseHandler or delegated to BESRequestHandler

Informational Response Objects Built in informational response objects derived from BESInfo: 1. BESTextInfo 2. BESHTMLInfo 3. BESXMLInfo 4. BESSilentInfo Each one formats an informational response according to its type Can add new informational response objects. BESInfoList::TheList()->add_info_builder( name, function ) ; Function instantiates the derived BESInfo object. Created in BESResponseHandler instances by calling: BESInfo *info = BESInfoList::TheList()->build_info() ; Set in BES configuration file: BES.Info.Type= e.g. txt, html, xml

Response Handlers: represent a specific response, such as a DAS response, a DDS response, a help response... know how to create the response object (DAS, DDS, BESInfo) do not necessarily fill in the response object, but know how the response should be filled in BESDASResponseHandler knows to create a DAS object and that it needs to go to each request handler for each container. A version response handler knows to create an informational response object and that it needs to go to all registered request handlers. A status response handler knows to create a text response object and fill it in with the status of the server. know how to transmit the response object

Implementing a Response Handler Inherits from the C++ abstract class BESResponseHandler (e.g. BESDASResponseHandler, BESHelpResponseHandler) Implement the methods: virtual void execute( BESDataHandlerInterface &dhi ) ; –Creates the response object –Does the work to fill in the response object, or delegate to a request handler to fill in the response object virtual void transmit( BESTransmitter *transmitter, BESDataHandlerInterface &dhi ) ; –Transmits the resulting response object using the appropriate method on the transmitter (more later)