blob: 0c25f7e6636b7181574fecc5b50417d77411c3ee [file]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_16) on Fri Sep 11 10:26:00 PDT 2009 -->
<TITLE>
Overview (Avro 1.1.0 API)
</TITLE>
<META NAME="date" CONTENT="2009-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Overview (Avro 1.1.0 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?overview-summary.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="overview-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H1>
Avro 1.1.0 API
</H1>
</CENTER>
Avro is a data serialization system.
<P>
<B>See:</B>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#overview_description"><B>Description</B></A>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Packages</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="20%"><B><A HREF="org/apache/avro/package-summary.html">org.apache.avro</A></B></TD>
<TD>Avro kernel classes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="20%"><B><A HREF="org/apache/avro/file/package-summary.html">org.apache.avro.file</A></B></TD>
<TD>A container file for Avro data.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="20%"><B><A HREF="org/apache/avro/generic/package-summary.html">org.apache.avro.generic</A></B></TD>
<TD>A generic representation for Avro data.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="20%"><B><A HREF="org/apache/avro/io/package-summary.html">org.apache.avro.io</A></B></TD>
<TD>Input/output utilities.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="20%"><B><A HREF="org/apache/avro/io/parsing/package-summary.html">org.apache.avro.io.parsing</A></B></TD>
<TD>Implementation of Avro schemas as LL(1) grammars.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="20%"><B><A HREF="org/apache/avro/ipc/package-summary.html">org.apache.avro.ipc</A></B></TD>
<TD>Support for inter-process calls.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="20%"><B><A HREF="org/apache/avro/reflect/package-summary.html">org.apache.avro.reflect</A></B></TD>
<TD>Use Java reflection to generate schemas and protocols for existing classes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="20%"><B><A HREF="org/apache/avro/specific/package-summary.html">org.apache.avro.specific</A></B></TD>
<TD>Generate specific Java classes for schemas and protocols</i>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="20%"><B><A HREF="org/apache/avro/util/package-summary.html">org.apache.avro.util</A></B></TD>
<TD>Common utility classes.</TD>
</TR>
</TABLE>
<P>
&nbsp;<A NAME="overview_description"><!-- --></A>
<P>
Avro is a data serialization system.
<h2>Overview</h2>
<p>Avro provides:
<ul>
<li>Rich data structures.
<li>A compact, fast, binary data format.
<li>A container file, to store persistent data.
<li>Remote procedure call (RPC).
<li>Simple integration with dynamic languages. Code generation
is not required to read or write data files nor to use or
implement RPC protocols. Code generation as an optional
optimization, only worth implementing for statically typed
languages.
</ul>
<h2>Schemas</h2>
<p>Avro relies on <i><A HREF="org/apache/avro/Schema.html" title="class in org.apache.avro"><CODE>schemas</CODE></A></i>.
When Avro data is read, the schema used when writing it is always
present. This permits each datum to be written with no per-value
overheads, making serialization both fast and small. This also
facilitates use with dynamic, scripting languages, since data,
together with its schema, is fully self-describing.
<p>When Avro data is stored in a <A HREF="org/apache/avro/file/DataFileWriter.html" title="class in org.apache.avro.file"><CODE>file</CODE></A>, its schema is stored with
it, so that files may be processed later by any program. If the
program reading the data expects a different schema this can be
easily resolved, since both schemas are present.
<p>When Avro is used in <A HREF="org/apache/avro/ipc/package-summary.html"><CODE>RPC</CODE></A>, the client
and server exchange schemas in the connection handshake. (This
can be optimized so that, for most calls, no schemas are actually
transmitted.) Since both client and server both have the other's
full schema, correspondence between same named fields, missing
fields, extra fields, etc. can all be easily resolved.
<p>Avro schemas are defined with
with <a href="http://www.json.org/">JSON</a> . This facilitates
implementation in languages that already have JSON libraries.
<h2>Comparison with other systems</h2>
Avro provides functionality similar to systems such
as <a href="http://incubator.apache.org/thrift/">Thrift</a>,
<a href="http://code.google.com/protobuf/">Protocol Buffers</a>,
etc. Avro differs from these systems in the following fundamental
aspects.
<ul>
<li><i>Dynamic typing</i>: Avro does not require that code be
generated. Data is always accompanied by a schema that permits
full processing of that data without code generation, static
datatypes, etc. This facilitates construction of generic
data-processing systems and languages.
<li><i>Untagged data</i>: Since the schema is present when data is
read, considerably less type information need be encoded with
data, resulting in smaller serialization size.</li>
<li><i>No manually-assigned field IDs</i>: When a schema changes,
both the old and new schema are always present when processing
data, so differences may be resolved symbolically, using field
names.
</ul>
<P>
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?overview-summary.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="overview-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &copy; 2009 The Apache Software Foundation
</BODY>
</HTML>