Translate

Translate to EnglishÜbersetzen Sie zum Deutsch/GermanΜεταφράστε στα ελληνικά/GreekПереведите к русскому/RussianOversetter til Norsk/NorwegianÖversätta till Svensk/Swedishहिन्दी अनुवाद करने के लिए/Hindi
Tradueix al català/CatalanTulkot uz latviešu/LatvianPreložiť do slovenčiny/SlovakVertaal aan het Nederlands/Dutchترجمة الى العربية/ArabicTraduzca al Español/SpanishTraduisez au Français/French
Traduca ad Italiano/ItalianTraduza ao Português/Portuguese日本語に翻訳しなさい /Japanese한국어에게 번역하십시오/Korean中文翻译/Chinese Simplified中文翻译/Chinese TraditionalПереклад на українську/Ukrainian
Image of Operating System Concepts
Image of RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)
Image of Modern Operating Systems (3rd Edition)
Image of Advanced Programming in the UNIX Environment, Second Edition (Addison-Wesley Professional Computing Series)

RSS Ingester For XAM Reference VIM

Recently SNIA released a new version of the XAM SDK with lots of new features. Included in this SDK was a new Reference VIM. This post shows you how to use this SDK to write a small RSS ingester application in Java which uses the new Reference VIM as the XAM Storage System.

Amazon SimpleDB Typica Tutorial

This post discusses how to use the Java Typica library to access and manipulate data stored in an Amazon SimpleDB service. A number of complete examples, ranging from very simple to more advanced, are provided.

XAM Query Language

As well as providing vendor-independent means of creating, retrieving, modifying and deleting XSets, the SNIA XAM v1.0 specification also defines a query language (XAM QL), based on a subset of the SQL language, for selecting and retrieving the XUIDs of XSets based on content-defined criteria.

The set of reserved words for this query language is quite small: select, where, and, or, not, like, exists, binding, readonly, typeof, length, date, TRUE, FALSE, before, after, contains, and within. By design, XAM queries look like an SQL select statement. The query language is case insensitive and uses the ASCII character set.

Here is an example of a simple XAM query: select “.xset.xuid” where “com.example.name” = ’Tuckers Plantation’

Version 1.0 of the XAM specification defines two levels of query language support, i.e. Level 1 and Level 2. Level 1 defines queries on properties and field attributes in XSets and is mandatory. Any XSet property value that is accessible to an application program via the XAM library can be queried. Level 2 extends Level 1 to support queries on XStreams and is optional. Both levels of query are accessed through a single, defined job type that all XAM providers must support. Since no vendor that I am aware of has actually implemented level 2 queries, the remainder of this post focuses on level 1 queries.

A XAM query statement consists of a mandatory select clause followed by an optional where clause. For XAM v1.0 the only valid select clause is select ‘.xset.xuid’. This specifies that the application is requesting a list of XUID values. For example select “.xset.xuid ”

will return a list of every XSet that is readable at the time of the query.

The where clause is used to specify a subset of XSets to be matched. For level 1 queries it is restricted to comparisons between XSet properties and literal values and/or field attributes and literal values. select “.xset.xuid” where “.xam.time.xuid” > date(’2009-02-01T00:00:00.0’)

will return the list of all Xsets which were created on or after February 1st 2009.

The following table shows which field and literal types can be validly compared. xam_intxam_doublexam_stringxam_datetimexam_xuid int** double** string* datetime* XUID* The XAM library validates that strings and strings liberals are conforming UTF-8 strings. Non-conforming UTF-8 string literals generate a XAM non-fatal query syntax error. Issues such as single versus multiple glyph characters and non printable characters are unspecified and are

XAM Mandated Fields

In this post I look at what fields are mandated by the SNIA XAM v1.0 specification and write a small Java application to retrieve their default values using the XAM Reference VIM and EMC’s Centera XAM VIM.

What is meant by a field in XAM? According to Section 3.1.5 of the XAM specification v1.0, Part 1, a field is a piece of uniquely identifiable data that can be attached to an XSet, an XSystem, or a XAM Library.

More concretely, a field has a name, a number of attributes that describe how to interact with the object, and a value. Any XAM primary object, i.e. an XSystem, an XSet, or a XAM Library object can contain one or more fields.

Field names are case sentitive UTF-8 encoded strings with a maximum length of 512 bytes and no embedded NULL characters. To avoid namespace clashes, the field namespace is allocated between SNIA, XAM storage system vendors and XAM application vendors. The following table shows the currently reserved namespace for field names: NAMESPACEDESCRIPTION .xam.* The XAM Library-owned portion of the namespace. Fields in this namespace shall be defined in this specification and its follow-ons and shall not be extended by XAM Storage System vendors. .xsystem.*The XSystem-owned portion of the namespace. Fields in this namespace shall be defined in this specification and its follow-ons and shall not be extended by XAM Storage System vendors. .xset.* The XSet-owned portion of the namespace. Fields in this namespace shall be defined in this specification and its follow-ons and shall not be extended by XAM Storage System vendors. .vnd.<reverseDNS>.*The XAM System vendor-owned namespace within the XSystem namespace, where is the XAM Storage System vendor’s reverse DNS name org.snia.*Reserved for SNIA org.snia.xam.* Reserved for SNIA FCWG To avoid field namespace clashes between XAM storage system vendors in the remaining unreserved namespace and aleviate the need for a central XAM field name registry, the first portion of a vendor field name shall be the vendor’s domain name in reverse order, followed by the vendor-defined field name, e.g. com.emc.centera.xam.vim.version.

As mentionly previously a field can have attributes. The following four attributes are mandated by the XAM specification: ATTRIBUTE NAMEDESCRIPTION TypeThe MIME type of the value. The type attribute shall be US-ASCII encoded with a maximum length of 512 bytes. BindingA Boolean value indicating if the field is bound to the XUID of the XSet. ReadonlyA Boolean value indicating

XAM Canonical Format

One of the key requirements for achieving long term data persistence is the ability to move data between archiving systems or, in the language of the SNIA XAM (eXtensible Access Method) specification, moving XSets between XSystems.

The XAM v1.0 specification supports this requirement by providing support for exporting and importing Xsets.  It specifies the methods used to export an XSet from an XSystem, the resultant XSet canonical data interchange format (package) and the methods used to import an Xset into an Xsystem. 

This post assumes that you are somewhat familiar with XAM and how to program to that specification using Java.  It focuses on the format and content of the XSet canonical format package which consists of two main parts: an XML document which describes the policies, properties and streams of one or more XSets followed by the binary representation of the stream(s).

The package format conforms to the 2005 W3C XML-binary Optimized Packaging (XOP) recommendation. To quote from the recommendation:

XOP define a general purpose serialization mechanism for the XML Infoset with binary content that is not only applicable to SOAP and MIME packaging, but to any XML Infoset and any packaging mechanism.

If you are unfamiliar with XOP, and most people are, an article by Andrey Butov in the December 2005 issue of Doctor Dobb’s Journal contained a good introduction.

More than one XSet can be contained in a package.  However the current XAM SDK reference implementation only supports one XSet.  The XML document (AKA the XSet manifest) is a valid and well-formed XML document whose root element is xsets.  It can be parsed and manipulated using XSLT and other XML tools.  Annex B of the XAM Architecture document contains an XML Schema Definition (XSD) for the XSet manifest.

In order to study the package format in more detail, I wrote a small Java application called StoreHelloWorld which creates a new XSet containing two XStreams.  The first Xstream contains the source code for the ubiquitous HelloWorld.java program.  The second XStream contains the binary object HelloWorld.class encoded to base64 and with a MIME type of application/base64.  Normally you should not encode an XStream but displaying binary files in a blog is problematic and hence the workaround.

Here is the source code for StoreHelloWorld. import java.io.BufferedOutputStream; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.InputStream; import