Difference between revisions of "Cube Manager"
Line 25: | Line 25: | ||
=Modules= | =Modules= | ||
Cube Manager is a multi-module project made of several subprojects: | Cube Manager is a multi-module project made of several subprojects: | ||
− | * Data Wrangler | + | * Data Wrangler: module that handles table management on data backend (PostgreSQL) and mapping between the tabular model types and the DB. |
− | * Metadata Wrangler | + | * Metadata Wrangler: module tha handles table metadata persistence on a PostgreSQL backend with JPA. |
− | * Cube Manager API | + | * Cube Manager API: API of cube manager which exposes the functionalities offered by a cube manager. Could be used by clients at compile time. |
− | * Cube Manager | + | * Cube Manager: Default implementation of the cube manager. |
− | * Cube Manager Parent | + | * Cube Manager Parent: maven parent project that wraps all of the aforementioned modules. |
==Database Wrangler== | ==Database Wrangler== | ||
+ | Database Wrangler is a single module (an API module tailored on a generic relational DB is missing) specifically designed to work with PostgreSQL DB. It provides methods for: | ||
+ | * Creating or removing tables on the data bacckend | ||
+ | * Adding or removing a column from a table on the data backend | ||
+ | * Creating indexes or constraints on columns | ||
+ | * Setting up a triggered procedure on a table | ||
+ | |||
+ | Database connection is provided by a DatabaseProvider implementation based on [http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html tomcat jdbc] library connection pooling facilities. | ||
+ | Coordinates of the data backend are automatically retrieved from the Information System by leveraging the [Database Resource] library. | ||
==Metadata Wrangler== | ==Metadata Wrangler== | ||
+ | Metadata Wrangler provides a simple API based on tabular model beans that allows for easy storage of metadata. It provides method for: | ||
+ | * Saving a table | ||
+ | * Recover tables by table type or get all registered tables | ||
+ | * Recover a single table by its id | ||
+ | * Remove a table, provided an id | ||
+ | |||
+ | The default implementation that uses JPA and a PostgreSQL DB, which coordinates are retrieved with [Database Resource] in a similar fashion as the Data Wrangler, performs an on-the-fly translation of tabular model beans into JPA annotated beans. | ||
==Cube Manager API== | ==Cube Manager API== | ||
+ | |||
+ | Cube Manager API exposes the interface that clients use. As with version 3.0 | ||
+ | |||
+ | <source lang="java6"> | ||
+ | public interface CubeManager { | ||
+ | |||
+ | public TableCreator createTable(TableType type); | ||
+ | |||
+ | public TableMetaCreator modifyTableMeta(TableId tableId) throws NoSuchTableException; | ||
+ | |||
+ | public Collection<Table> getTables(); | ||
+ | |||
+ | public Collection<Table> getTables(TableType tableType); | ||
+ | |||
+ | public Table getTable(TableId id) throws NoSuchTableException; | ||
+ | |||
+ | public void removeTable(TableId id) throws NoSuchTableException; | ||
+ | |||
+ | public Table createTimeCodelist(PeriodType periodType); | ||
+ | |||
+ | } | ||
+ | </source> | ||
+ | |||
+ | TableCreator and TableMetaCreator are builders that allows respectively create/clone/modify a table structure and to create a new table metadata (without creating a new data table on the relational database) with modified metadata values (not the structure). | ||
==Cube Manager== | ==Cube Manager== | ||
+ | Cube manager provides a default implementation for Cube Manager API. |
Revision as of 15:41, 28 November 2013
Contents
Overview
This page documents concepts that enables the cube manager component and report information that could help developers in understanding the project organization.
Motivation and concepts
Tabular Data is a pluggable service that allows to manage the lifecycle of statistical data. Operation modules that perform operations on data (like import,export,transformation,validation) can be added in a modular fashion. Each operation module produce one or more tables as a result of its computation. A table in the Tabular Data system is made of some data (managed with a data backend) and some metadata, telling where data can be found and enriching its description with additional metadata. The system offers a common model for the representation of tables metadata (Tabular Model) which helps in describing tables structure, location, additional metadata. Cube manager is the low level components that enables the Tabular Data service. Its main features are:
- Allow the creation of new tables described using the Tabular Model
- Allow to clone or modify an existing table in terms of its structure or metadata.
- Keeps track of created tables and their associated metadata (table structure, additional metadata)
- Allow retrieval of metadata information to clients
- Relational database (data backend) connection pooling
Prerequisites
In order to work with cube manager code there are some technologies that must be known first.
- Maven: Cube Manager is a fairly complex project that uses Maven for project organization. The project itself is a multi-module maven project. Basic knowledge of maven and multi-module feature is required.
- Dependency injection and CDI/Weld: In order to achieve modularity and Inversion of Control, Cube Manager (and the whole Tabular Data stack) relies on CDI (Context and Dependency Injection) and its Reference Implementation Weld both for standalone execution and testing.
- PostgreSQL and Postgis: The data backend is a relational database (PostgreSQL) with PostGIS extension. Basic knowledge on the administration and management of a PostgreSQL database instance is required. Working versions of these technologies with cube manager are PostgreSQL 9.2 and PostGIS 2.0.
- JPA: Cube manager keeps track of metadata associated to each table. It does so by leveraging a PostgreSQL backend with JPA technology, mapping tabular model beans directly into the database. The implementation of JPA that is used in the project is EclipseLink.
Modules
Cube Manager is a multi-module project made of several subprojects:
- Data Wrangler: module that handles table management on data backend (PostgreSQL) and mapping between the tabular model types and the DB.
- Metadata Wrangler: module tha handles table metadata persistence on a PostgreSQL backend with JPA.
- Cube Manager API: API of cube manager which exposes the functionalities offered by a cube manager. Could be used by clients at compile time.
- Cube Manager: Default implementation of the cube manager.
- Cube Manager Parent: maven parent project that wraps all of the aforementioned modules.
Database Wrangler
Database Wrangler is a single module (an API module tailored on a generic relational DB is missing) specifically designed to work with PostgreSQL DB. It provides methods for:
- Creating or removing tables on the data bacckend
- Adding or removing a column from a table on the data backend
- Creating indexes or constraints on columns
- Setting up a triggered procedure on a table
Database connection is provided by a DatabaseProvider implementation based on tomcat jdbc library connection pooling facilities. Coordinates of the data backend are automatically retrieved from the Information System by leveraging the [Database Resource] library.
Metadata Wrangler
Metadata Wrangler provides a simple API based on tabular model beans that allows for easy storage of metadata. It provides method for:
- Saving a table
- Recover tables by table type or get all registered tables
- Recover a single table by its id
- Remove a table, provided an id
The default implementation that uses JPA and a PostgreSQL DB, which coordinates are retrieved with [Database Resource] in a similar fashion as the Data Wrangler, performs an on-the-fly translation of tabular model beans into JPA annotated beans.
Cube Manager API
Cube Manager API exposes the interface that clients use. As with version 3.0
Invalid language.
You need to specify a language like this: <source lang="html4strict">...</source>
Supported languages for syntax highlighting:
4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, aimms, algol68, apache, applescript, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, caddcl, cadlisp, cfdg, cfm, chaiscript, chapel, cil, clojure, cmake, cobol, coffeescript, cpp, csharp, css, cuesheet, d, dart, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, ezt, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, ispfpanel, j, java, java5, javascript, jcl, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nginx, nimrod, nsis, oberon2, objc, objeck, ocaml, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, pic16, pike, pixelbender, pli, plsql, postgresql, postscript, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, qml, racket, rails, rbs, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, rust, sas, scala, scheme, scilab, scl, sdlbasic, smalltalk, smarty, spark, sparql, sql, standardml, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vbscript, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xpp, yaml, z80, zxbasic
public interface CubeManager { public TableCreator createTable(TableType type); public TableMetaCreator modifyTableMeta(TableId tableId) throws NoSuchTableException; public Collection<Table> getTables(); public Collection<Table> getTables(TableType tableType); public Table getTable(TableId id) throws NoSuchTableException; public void removeTable(TableId id) throws NoSuchTableException; public Table createTimeCodelist(PeriodType periodType); }
TableCreator and TableMetaCreator are builders that allows respectively create/clone/modify a table structure and to create a new table metadata (without creating a new data table on the relational database) with modified metadata values (not the structure).
Cube Manager
Cube manager provides a default implementation for Cube Manager API.