http://git-wip-us.apache.org/repos/asf/asterixdb-site/blob/444ca1b3/content/docs/0.9.2/udf.html ---------------------------------------------------------------------- diff --git a/content/docs/0.9.2/udf.html b/content/docs/0.9.2/udf.html new file mode 100644 index 0000000..8d9c237 --- /dev/null +++ b/content/docs/0.9.2/udf.html @@ -0,0 +1,429 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia at 2017-07-27 + | Rendered using Apache Maven Fluido Skin 1.3.0 +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta name="Date-Revision-yyyymmdd" content="20170727" /> + <meta http-equiv="Content-Language" content="en" /> + <title>AsterixDB – Support for User Defined Functions in AsterixDB</title> + <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" /> + <link rel="stylesheet" href="./css/site.css" /> + <link rel="stylesheet" href="./css/print.css" media="print" /> + + + <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script> + + + +<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-41536543-1', 'uci.edu'); + ga('send', 'pageview');</script> + + </head> + <body class="topBarDisabled"> + + + + + <div class="container-fluid"> + <div id="banner"> + <div class="pull-left"> + <a href="./" id="bannerLeft"> + <img src="images/asterixlogo.png" alt="AsterixDB"/> + </a> + </div> + <div class="pull-right"> </div> + <div class="clear"><hr/></div> + </div> + + <div id="breadcrumbs"> + <ul class="breadcrumb"> + + + <li id="publishDate">Last Published: 2017-07-27</li> + + + + <li id="projectVersion" class="pull-right">Version: 0.9.2-SNAPSHOT</li> + + <li class="divider pull-right">|</li> + + <li class="pull-right"> <a href="index.html" title="Documentation Home"> + Documentation Home</a> + </li> + + </ul> + </div> + + + <div class="row-fluid"> + <div id="leftColumn" class="span3"> + <div class="well sidebar-nav"> + + + <ul class="nav nav-list"> + <li class="nav-header">Get Started - Installation</li> + + <li> + + <a href="ncservice.html" title="Option 1: using NCService"> + <i class="none"></i> + Option 1: using NCService</a> + </li> + + <li> + + <a href="ansible.html" title="Option 2: using Ansible"> + <i class="none"></i> + Option 2: using Ansible</a> + </li> + + <li> + + <a href="aws.html" title="Option 3: using Amazon Web Services"> + <i class="none"></i> + Option 3: using Amazon Web Services</a> + </li> + + <li> + + <a href="yarn.html" title="Option 4: using YARN"> + <i class="none"></i> + Option 4: using YARN</a> + </li> + + <li> + + <a href="install.html" title="Option 5: using Managix (deprecated)"> + <i class="none"></i> + Option 5: using Managix (deprecated)</a> + </li> + <li class="nav-header">AsterixDB Primer</li> + + <li> + + <a href="sqlpp/primer-sqlpp.html" title="Option 1: using SQL++"> + <i class="none"></i> + Option 1: using SQL++</a> + </li> + + <li> + + <a href="aql/primer.html" title="Option 2: using AQL"> + <i class="none"></i> + Option 2: using AQL</a> + </li> + <li class="nav-header">Data Model</li> + + <li> + + <a href="datamodel.html" title="The Asterix Data Model"> + <i class="none"></i> + The Asterix Data Model</a> + </li> + <li class="nav-header">Queries - SQL++</li> + + <li> + + <a href="sqlpp/manual.html" title="The SQL++ Query Language"> + <i class="none"></i> + The SQL++ Query Language</a> + </li> + + <li> + + <a href="sqlpp/builtins.html" title="Builtin Functions"> + <i class="none"></i> + Builtin Functions</a> + </li> + <li class="nav-header">Queries - AQL</li> + + <li> + + <a href="aql/manual.html" title="The Asterix Query Language (AQL)"> + <i class="none"></i> + The Asterix Query Language (AQL)</a> + </li> + + <li> + + <a href="aql/builtins.html" title="Builtin Functions"> + <i class="none"></i> + Builtin Functions</a> + </li> + <li class="nav-header">API/SDK</li> + + <li> + + <a href="api.html" title="HTTP API"> + <i class="none"></i> + HTTP API</a> + </li> + + <li> + + <a href="csv.html" title="CSV Output"> + <i class="none"></i> + CSV Output</a> + </li> + <li class="nav-header">Advanced Features</li> + + <li> + + <a href="aql/fulltext.html" title="Support of Full-text Queries"> + <i class="none"></i> + Support of Full-text Queries</a> + </li> + + <li> + + <a href="aql/externaldata.html" title="Accessing External Data"> + <i class="none"></i> + Accessing External Data</a> + </li> + + <li> + + <a href="feeds/tutorial.html" title="Support for Data Ingestion"> + <i class="none"></i> + Support for Data Ingestion</a> + </li> + + <li class="active"> + + <a href="#"><i class="none"></i>User Defined Functions</a> + </li> + + <li> + + <a href="aql/filters.html" title="Filter-Based LSM Index Acceleration"> + <i class="none"></i> + Filter-Based LSM Index Acceleration</a> + </li> + + <li> + + <a href="aql/similarity.html" title="Support of Similarity Queries"> + <i class="none"></i> + Support of Similarity Queries</a> + </li> + </ul> + + + + <hr class="divider" /> + + <div id="poweredBy"> + <div class="clear"></div> + <div class="clear"></div> + <div class="clear"></div> + <a href="./" title="AsterixDB" class="builtBy"> + <img class="builtBy" alt="AsterixDB" src="images/asterixlogo.png" /> + </a> + </div> + </div> + </div> + + + <div id="bodyColumn" class="span9" > + + <!-- ! Licensed to the Apache Software Foundation (ASF) under one + ! or more contributor license agreements. See the NOTICE file + ! distributed with this work for additional information + ! regarding copyright ownership. The ASF licenses this file + ! to you under the Apache License, Version 2.0 (the + ! "License"); you may not use this file except in compliance + ! with the License. You may obtain a copy of the License at + ! + ! http://www.apache.org/licenses/LICENSE-2.0 + ! + ! Unless required by applicable law or agreed to in writing, + ! software distributed under the License is distributed on an + ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ! KIND, either express or implied. See the License for the + ! specific language governing permissions and limitations + ! under the License. + ! --><h1>Support for User Defined Functions in AsterixDB</h1> +<div class="section"> +<h2><a name="Table_of_Contents"></a><a name="atoc" id="#toc">Table of Contents</a></h2> + +<ul> + +<li><a href="#PreprocessingCollectedData">Using UDF to preprocess feed-collected data</a></li> + +<li><a href="#WritingAnExternalUDF">Writing an External UDF</a></li> + +<li><a href="#CreatingAnAsterixDBLibrary">Creating an AsterixDB Library</a></li> + +<li><a href="#installingUDF">Installing an AsterixDB Library</a></li> +</ul> +<p>In this document, we describe the support for implementing, using, and installing user-defined functions (UDF) in AsterixDB. We will explain how we can use UDFs to preprocess, e.g., data collected using feeds (see the <a href="feeds/tutorial.html">feeds tutorial</a>).</p> +<div class="section"> +<h3><a name="Installing_an_AsterixDB_Library"></a><a name="installingUDF">Installing an AsterixDB Library</a></h3> +<p>We assume you have followed the <a href="../install.html">installation instructions</a> to set up a running AsterixDB instance. Let us refer your AsterixDB instance by the name “my_asterix”.</p> + +<ul> + +<li> +<p>Step 1: Stop the AsterixDB instance if it is in the ACTIVE state.</p> + +<div class="source"> +<div class="source"> +<pre>$ managix stop -n my_asterix +</pre></div></div></li> + +<li> +<p>Step 2: Install the library using Managix install command. Just to illustrate, we use the help command to look up the syntax</p> + +<div class="source"> +<div class="source"> +<pre>$ managix help -cmd install +Installs a library to an asterix instance. +Options +n Name of Asterix Instance +d Name of the dataverse under which the library will be installed +l Name of the library +p Path to library zip bundle +</pre></div></div></li> +</ul> +<p>Above is a sample output and explains the usage and the required parameters. Each library has a name and is installed under a dataverse. Recall that we had created a dataverse by the name - “feeds” prior to creating our datatypes and dataset. We shall name our library - “testlib”.</p> +<p>We assume you have a library zip bundle that needs to be installed. To install the library, use the Managix install command. An example is shown below.</p> + +<div class="source"> +<div class="source"> +<pre> $ managix install -n my_asterix -d feeds -l testlib -p extlibs/asterix-external-data-0.8.7-binary-assembly.zip +</pre></div></div> +<p>You should see the following message:</p> + +<div class="source"> +<div class="source"> +<pre> INFO: Installed library testlib +</pre></div></div> +<p>We shall next start our AsterixDB instance using the start command as shown below.</p> + +<div class="source"> +<div class="source"> +<pre> $ managix start -n my_asterix +</pre></div></div> +<p>You may now use the AsterixDB library in AQL statements and queries. To look at the installed artifacts, you may execute the following query at the AsterixDB web-console.</p> + +<div class="source"> +<div class="source"> +<pre> for $x in dataset Metadata.Function + return $x + + for $x in dataset Metadata.Library + return $x +</pre></div></div> +<p>Our library is now installed and is ready to be used.</p></div></div> +<div class="section"> +<h2><a name="Preprocessing_Collected_Data"></a><a name="PreprocessingCollectedData" id="PreprocessingCollectedData">Preprocessing Collected Data</a></h2> +<p>In the following we assume that you already created the <tt>TwitterFeed</tt> and its corresponding data types and dataset following the instruction explained in the <a href="feeds/tutorial.html">feeds tutorial</a>.</p> +<p>A feed definition may optionally include the specification of a user-defined function that is to be applied to each feed object prior to persistence. Examples of pre-processing might include adding attributes, filtering out objects, sampling, sentiment analysis, feature extraction, etc. We can express a UDF, which can be defined in AQL or in a programming language such as Java, to perform such pre-processing. An AQL UDF is a good fit when pre-processing a object requires the result of a query (join or aggregate) over data contained in AsterixDB datasets. More sophisticated processing such as sentiment analysis of text is better handled by providing a Java UDF. A Java UDF has an initialization phase that allows the UDF to access any resources it may need to initialize itself prior to being used in a data flow. It is assumed by the AsterixDB compiler to be stateless and thus usable as an embarrassingly parallel black box. In contrast, the AsterixDB compiler can reason about an AQL UDF and involve the use of indexes during its invocation.</p> +<p>We consider an example transformation of a raw tweet into its lightweight version called <tt>ProcessedTweet</tt>, which is defined next.</p> + +<div class="source"> +<div class="source"> +<pre> use dataverse feeds; + + create type ProcessedTweet if not exists as open { + id: string, + user_name:string, + location:point, + created_at:string, + message_text:string, + country: string, + topics: {{string}} + }; + + create dataset ProcessedTweets(ProcessedTweet) + primary key id; +</pre></div></div> +<p>The processing required in transforming a collected tweet to its lighter version of type <tt>ProcessedTweet</tt> involves extracting the topics or hash-tags (if any) in a tweet and collecting them in the referred “topics” attribute for the tweet. Additionally, the latitude and longitude values (doubles) are combined into the spatial point type. Note that spatial data types are considered as first-class citizens that come with the support for creating indexes. Next we show a revised version of our example TwitterFeed that involves the use of a UDF. We assume that the UDF that contains the transformation logic into a “ProcessedTweet” is available as a Java UDF inside an AsterixDB library named ‘testlib’. We defer the writing of a Java UDF and its installation as part of an AsterixDB library to a later section of this document.</p> + +<div class="source"> +<div class="source"> +<pre> use dataverse feeds; + + create feed ProcessedTwitterFeed if not exists + using "push_twitter" + (("type-name"="Tweet"), + ("consumer.key"="************"), + ("consumer.secret"="**************"), + ("access.token"="**********"), + ("access.token.secret"="*************")) + + apply function testlib#addHashTagsInPlace; +</pre></div></div> +<p>Note that a feed adaptor and a UDF act as pluggable components. These contribute towards providing a generic “plug-and-play” model where custom implementations can be provided to cater to specific requirements.</p> +<div class="section"> +<div class="section"> +<h4><a name="Building_a_Cascade_Network_of_Feeds"></a>Building a Cascade Network of Feeds</h4> +<p>Multiple high-level applications may wish to consume the data ingested from a data feed. Each such application might perceive the feed in a different way and require the arriving data to be processed and/or persisted differently. Building a separate flow of data from the external source for each application is wasteful of resources as the pre-processing or transformations required by each application might overlap and could be done together in an incremental fashion to avoid redundancy. A single flow of data from the external source could provide data for multiple applications. To achieve this, we introduce the notion of primary and secondary feeds in AsterixDB.</p> +<p>A feed in AsterixDB is considered to be a primary feed if it gets its data from an external data source. The objects contained in a feed (subsequent to any pre-processing) are directed to a designated AsterixDB dataset. Alternatively or additionally, these objects can be used to derive other feeds known as secondary feeds. A secondary feed is similar to its parent feed in every other aspect; it can have an associated UDF to allow for any subsequent processing, can be persisted into a dataset, and/or can be made to derive other secondary feeds to form a cascade network. A primary feed and a dependent secondary feed form a hierarchy. As an example, we next show an example AQL statement that redefines the previous feed “ProcessedTwitterFeed” in terms of their respective parent feed (TwitterFeed).</p> + +<div class="source"> +<div class="source"> +<pre> use dataverse feeds; + + drop feed ProcessedTwitterFeed if exists; + + create secondary feed ProcessedTwitterFeed from feed TwitterFeed + apply function testlib#addHashTags; + + connect feed ProcessedTwitterFeed to dataset ProcessedTweets; +</pre></div></div> +<p>The <tt>addHashTags</tt> function is already provided in the example UDF.To see what objects are being inserted into the dataset, we can perform a simple dataset scan after allowing a few moments for the feed to start ingesting data:</p> + +<div class="source"> +<div class="source"> +<pre> use dataverse feeds; + + for $i in dataset ProcessedTweets limit 10 return $i; +</pre></div></div> +<p>For an example of how to write a Java UDF from scratch, the source for the example UDF that has been used in this tutorial is available <a class="externalLink" href="https://github.com/apache/asterixdb/tree/master/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library">here</a></p></div></div></div> +<div class="section"> +<h2><a name="Unstalling_an_AsterixDB_Library"></a><a name="installingUDF">Unstalling an AsterixDB Library</a></h2> +<p>To uninstall a library, use the Managix uninstall command as follows:</p> + +<div class="source"> +<div class="source"> +<pre> $ managix stop -n my_asterix + + $ managix uninstall -n my_asterix -d feeds -l testlib +</pre></div></div></div> + </div> + </div> + </div> + + <hr/> + + <footer> + <div class="container-fluid"> + <div class="row span12">Copyright © 2017 + <a href="https://www.apache.org/">The Apache Software Foundation</a>. + All Rights Reserved. + + </div> + + <?xml version="1.0" encoding="UTF-8"?> +<div class="row-fluid">Apache AsterixDB, AsterixDB, Apache, the Apache + feather logo, and the Apache AsterixDB project logo are either + registered trademarks or trademarks of The Apache Software + Foundation in the United States and other countries. + All other marks mentioned may be trademarks or registered + trademarks of their respective owners.</div> + + + </div> + </footer> + </body> +</html>
http://git-wip-us.apache.org/repos/asf/asterixdb-site/blob/444ca1b3/content/docs/0.9.2/yarn.html ---------------------------------------------------------------------- diff --git a/content/docs/0.9.2/yarn.html b/content/docs/0.9.2/yarn.html new file mode 100644 index 0000000..9b332f0 --- /dev/null +++ b/content/docs/0.9.2/yarn.html @@ -0,0 +1,734 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia at 2017-07-27 + | Rendered using Apache Maven Fluido Skin 1.3.0 +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta name="Date-Revision-yyyymmdd" content="20170727" /> + <meta http-equiv="Content-Language" content="en" /> + <title>AsterixDB – Introduction</title> + <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" /> + <link rel="stylesheet" href="./css/site.css" /> + <link rel="stylesheet" href="./css/print.css" media="print" /> + + + <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script> + + + +<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-41536543-1', 'uci.edu'); + ga('send', 'pageview');</script> + + </head> + <body class="topBarDisabled"> + + + + + <div class="container-fluid"> + <div id="banner"> + <div class="pull-left"> + <a href="./" id="bannerLeft"> + <img src="images/asterixlogo.png" alt="AsterixDB"/> + </a> + </div> + <div class="pull-right"> </div> + <div class="clear"><hr/></div> + </div> + + <div id="breadcrumbs"> + <ul class="breadcrumb"> + + + <li id="publishDate">Last Published: 2017-07-27</li> + + + + <li id="projectVersion" class="pull-right">Version: 0.9.2-SNAPSHOT</li> + + <li class="divider pull-right">|</li> + + <li class="pull-right"> <a href="index.html" title="Documentation Home"> + Documentation Home</a> + </li> + + </ul> + </div> + + + <div class="row-fluid"> + <div id="leftColumn" class="span3"> + <div class="well sidebar-nav"> + + + <ul class="nav nav-list"> + <li class="nav-header">Get Started - Installation</li> + + <li> + + <a href="ncservice.html" title="Option 1: using NCService"> + <i class="none"></i> + Option 1: using NCService</a> + </li> + + <li> + + <a href="ansible.html" title="Option 2: using Ansible"> + <i class="none"></i> + Option 2: using Ansible</a> + </li> + + <li> + + <a href="aws.html" title="Option 3: using Amazon Web Services"> + <i class="none"></i> + Option 3: using Amazon Web Services</a> + </li> + + <li class="active"> + + <a href="#"><i class="none"></i>Option 4: using YARN</a> + </li> + + <li> + + <a href="install.html" title="Option 5: using Managix (deprecated)"> + <i class="none"></i> + Option 5: using Managix (deprecated)</a> + </li> + <li class="nav-header">AsterixDB Primer</li> + + <li> + + <a href="sqlpp/primer-sqlpp.html" title="Option 1: using SQL++"> + <i class="none"></i> + Option 1: using SQL++</a> + </li> + + <li> + + <a href="aql/primer.html" title="Option 2: using AQL"> + <i class="none"></i> + Option 2: using AQL</a> + </li> + <li class="nav-header">Data Model</li> + + <li> + + <a href="datamodel.html" title="The Asterix Data Model"> + <i class="none"></i> + The Asterix Data Model</a> + </li> + <li class="nav-header">Queries - SQL++</li> + + <li> + + <a href="sqlpp/manual.html" title="The SQL++ Query Language"> + <i class="none"></i> + The SQL++ Query Language</a> + </li> + + <li> + + <a href="sqlpp/builtins.html" title="Builtin Functions"> + <i class="none"></i> + Builtin Functions</a> + </li> + <li class="nav-header">Queries - AQL</li> + + <li> + + <a href="aql/manual.html" title="The Asterix Query Language (AQL)"> + <i class="none"></i> + The Asterix Query Language (AQL)</a> + </li> + + <li> + + <a href="aql/builtins.html" title="Builtin Functions"> + <i class="none"></i> + Builtin Functions</a> + </li> + <li class="nav-header">API/SDK</li> + + <li> + + <a href="api.html" title="HTTP API"> + <i class="none"></i> + HTTP API</a> + </li> + + <li> + + <a href="csv.html" title="CSV Output"> + <i class="none"></i> + CSV Output</a> + </li> + <li class="nav-header">Advanced Features</li> + + <li> + + <a href="aql/fulltext.html" title="Support of Full-text Queries"> + <i class="none"></i> + Support of Full-text Queries</a> + </li> + + <li> + + <a href="aql/externaldata.html" title="Accessing External Data"> + <i class="none"></i> + Accessing External Data</a> + </li> + + <li> + + <a href="feeds/tutorial.html" title="Support for Data Ingestion"> + <i class="none"></i> + Support for Data Ingestion</a> + </li> + + <li> + + <a href="udf.html" title="User Defined Functions"> + <i class="none"></i> + User Defined Functions</a> + </li> + + <li> + + <a href="aql/filters.html" title="Filter-Based LSM Index Acceleration"> + <i class="none"></i> + Filter-Based LSM Index Acceleration</a> + </li> + + <li> + + <a href="aql/similarity.html" title="Support of Similarity Queries"> + <i class="none"></i> + Support of Similarity Queries</a> + </li> + </ul> + + + + <hr class="divider" /> + + <div id="poweredBy"> + <div class="clear"></div> + <div class="clear"></div> + <div class="clear"></div> + <a href="./" title="AsterixDB" class="builtBy"> + <img class="builtBy" alt="AsterixDB" src="images/asterixlogo.png" /> + </a> + </div> + </div> + </div> + + + <div id="bodyColumn" class="span9" > + + <!-- ! Licensed to the Apache Software Foundation (ASF) under one + ! or more contributor license agreements. See the NOTICE file + ! distributed with this work for additional information + ! regarding copyright ownership. The ASF licenses this file + ! to you under the Apache License, Version 2.0 (the + ! "License"); you may not use this file except in compliance + ! with the License. You may obtain a copy of the License at + ! + ! http://www.apache.org/licenses/LICENSE-2.0 + ! + ! Unless required by applicable law or agreed to in writing, + ! software distributed under the License is distributed on an + ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ! KIND, either express or implied. See the License for the + ! specific language governing permissions and limitations + ! under the License. + ! --><h1>Introduction</h1> +<div class="section"> +<h2><a name="Table_of_Contents"></a><a name="toc" id="toc">Table of Contents</a></h2> + +<ul> + +<li><a href="#arch">Architecture Overview</a></li> + +<li><a href="#prereq">Prerequisites</a></li> + +<li><a href="#tut">Tutorial Installation</a></li> + +<li><a href="#faq">FAQ and Common Issues</a></li> + +<li><a href="#detail">Reference guide to AsterixDB’s YARN Client</a></li> +</ul> +<p>This is a guide describing how to deploy AsterixDB onto a YARN-based environment.</p></div> +<div class="section"> +<h2><a name="AsterixDB_and_the_YARN_environment"></a><a name="arch" id="arch">AsterixDB and the YARN environment</a></h2> +<p>AsterixDB uses a shared-nothing architecture and local file-based storage- not HDFS. Hence we are reliant on the local storage on each node (‘iodevices’ in AsterixDB ). In YARN there are 3 main types of storage available: </p> + +<ul> + +<li>HDFS file storage (only suitable for long-lived artifacts, can be slower than local disk)</li> + +<li>Ephemeral container storage that is cleaned by YARN after a container exits (unsuitable except for transient artifacts)</li> + +<li>Node-local destinations not managed by YARN, but which are accesable by the container and live beyond its termination.</li> +</ul> +<p>AsterixDB uses only the last type of storage, which is available with both the DefaultContainerExecutor and LinuxContainerExecutor. However keep in mind that with the DefaultContainerExecutor, the directory must be accessable by the same process that the YARN NodeManager is running as, while with the LinuxContainerExecutor it must be accessable by the unix user who is running the job.</p></div> +<div class="section"> +<h2><a name="Prerequisites"></a><a name="prereq" id="prereq">Prerequisites</a></h2> +<p>For this tutorial it will be assumed that we have a YARN cluster with the proper environment variables set. To test this, try running the DistributedShell example that is distributed as part of Apache Hadoop. If that sample application can be run successfully then the environment should be acceptable for launching AsterixDB on to your YARN-enabled cluster.</p> +<div class="section"> +<h3><a name="Vagrant_and_Puppet_Virtualized_cluster_for_Tutorial"></a>Vagrant and Puppet Virtualized cluster for Tutorial</h3> +<p>For the purposes of this tutorial, a virtualized cluster that matches all of the tutorial configurations can be found at <a class="externalLink" href="https://github.com/parshimers/yarn-sample-cluster">https://github.com/parshimers/yarn-sample-cluster</a>. It requires a machine with about 4-8GB of RAM to run. To start with this cluster, first clone the repository:</p> + +<div class="source"> +<div class="source"> +<pre> ↪ git clone https://github.com/parshimers/yarn-sample-cluster.git + Cloning into 'yarn-sample-cluster'... + remote: Counting objects: 490, done. + remote: Compressing objects: 100% (315/315), done. + remote: Total 490 (delta 152), reused 490 (delta 152) + Receiving objects: 100% (490/490), 521.34 KiB | 201.00 KiB/s, done. + Resolving deltas: 100% (152/152), done. + Checking connectivity... done. +</pre></div></div> +<p>If the ‘hostmanager’ plugin for Vagrant isn’t already installed, install it like so:</p> + +<div class="source"> +<div class="source"> +<pre> ↪ vagrant plugin install vagrant-hostmanager + Installing the 'vagrant-hostmanager' plugin. This can take a few minutes... + Installed the plugin 'vagrant-hostmanager (1.5.0)'! +</pre></div></div> +<p>Then start the tutorial cluster. The hostmanger plugin may ask for sudo at some point, because it updates your hosts file to include the virtual machines.</p> + +<div class="source"> +<div class="source"> +<pre> ↪ vagrant up + Bringing machine 'nc2' up with 'virtualbox' provider... + Bringing machine 'nc1' up with 'virtualbox' provider... + Bringing machine 'cc' up with 'virtualbox' provider... + ... +</pre></div></div> +<p>Once vagrant returns, the environment will be ready. The working directory with the Vagrantfile is also visible to each of the virtual machines (in the /vagrant directory), so we will unzip the Asterix binaries here as well for easy access. The YARN binary can be found on the AsterixDB <a class="externalLink" href="https://asterixdb.apache.org/download.html">downloads page</a></p> + +<div class="source"> +<div class="source"> +<pre>↪ unzip -d asterix-yarn/ asterix-yarn-binary-assembly.zip +... +</pre></div></div> +<p>To log into the node from which we will run the rest of the tutorial, use ‘vagrant ssh’ to get to the CC node and move to the YARN client’s location:</p> + +<div class="source"> +<div class="source"> +<pre> ↪ vagrant ssh cc + [vagrant@cc ~]$ + [vagrant@cc ~]$ cd /vagrant/asterix-yarn + [vagrant@cc asterix-yarn]$ +</pre></div></div> +<h1><a name="tut" id="tut">Tutorial installation</a></h1></div></div> +<div class="section"> +<h2><a name="Configuration"></a>Configuration</h2> +<p>To deploy AsterixDB onto a YARN cluster, we need to construct a configuration file that describes the resources that will be requested from YARN for AsterixDB. </p> + +<div class="source"> + +<div class="source"> +<pre> +<img src="images/yarn_clust.png" alt="Illustration of a simple YARN cluster with AsterixDB processes." /> +<i>Fig. 1</i>: Illustration of a simple YARN cluster with AsterixDB processes and their locations +</pre></div> +</div> +<p>This AsterixDB cluster description file corresponds to the above deployed scenario.</p> + +<div class="source"> +<div class="source"> +<pre> <cluster xmlns="yarn_cluster"> + <name>my_awesome_instance</name> + <txn_log_dir>/home/yarn/</txn_log_dir> + <iodevices>/home/yarn/</iodevices> + <store>asterix-data</store> + <master_node> + <id>cc</id> + <client_ip>10.10.0.2</client_ip> + <cluster_ip>10.10.0.2</cluster_ip> + <client_port>1098</client_port> + <cluster_port>1099</cluster_port> + <http_port>8888</http_port> + </master_node> + <node> + <id>nc1</id> + <cluster_ip>10.10.0.3</cluster_ip> + </node> + <node> + <id>nc2</id> + <cluster_ip>10.10.0.4</cluster_ip> + </node> + <metadata_node>nc1</metadata_node> + </cluster> +</pre></div></div> +<p>In this example we have 3 NCs and one CC. Each node is defined by a unique name (not necessarily hostname) and an IP on which AsterixDB nodes will listen and communicate with eachother. This is the ‘cluster_ip’ parameter. The ‘client_ip’ parameter is the interface on which client-facing services are presented, for example the web interface. For the next step this file will be saved as ‘my_awesome_cluster_desc.xml’ in the configs directory.</p></div> +<div class="section"> +<h2><a name="Installing_and_starting_the_instance"></a>Installing and starting the instance</h2> +<p>With this configuration in hand, the YARN client can be used to deploy AsterixDB onto the cluster:</p> + +<div class="source"> +<div class="source"> +<pre> [vagrant@cc asterix-yarn]$ bin/asterix -n my_awesome_instance -c configs/my_awesome_cluster_desc.xml install + Waiting for new AsterixDB Instance to start . + Asterix successfully deployed and is now running. +</pre></div></div> +<p>The instance will be visible in the YARN RM similar to the below image +<div class="source"> </p> +<div class="source"> +<pre> <img src="images/running_inst.png" alt="Illustration of a simple YARN cluster with AsterixDB processes." /> <i>Fig. 2</i>: Hadoop YARN Resource Manager dashboard with running AsterixDB instance </pre></div> </div> +<p>Once the client returns success, the instance is now ready to be used. We can now use the asterix instance at the CC’s IP (10.10.0.2), on the default port (19001).</p> + +<div class="source"> + +<div class="source"> +<pre> +<img src="images/asterix_webui.png" alt="Illustration of a simple YARN cluster with AsterixDB processes." /> +<i>Fig. 3</i>: AsterixDB Web User Interface +</pre></div> +</div> +<p>From here, to try things out we could run the ADM & AQL 101 tutorial or any other sample workload.</p></div> +<div class="section"> +<h2><a name="Stopping_the_instance"></a>Stopping the instance</h2> +<p>To stop the instance that was just deployed, the <tt>stop</tt> command is used:</p> + +<div class="source"> +<div class="source"> +<pre> [vagrant@cc asterix-yarn]$ bin/asterix -n my_awesome_instance stop + Stopping instance my_awesome_instance +</pre></div></div> +<p>This attempts a graceful shutdown of the instance. If for some reason this does not succeed, the <tt>kill</tt> action can be used to force shutdown in a similar fashion:</p> + +<div class="source"> +<div class="source"> +<pre> [vagrant@cc asterix-yarn]$ bin/asterix -n my_awesome_instance kill + Are you sure you want to kill this instance? In-progress tasks will be aborted + Are you sure you want to do this? (yes/no): yes +</pre></div></div></div> +<div class="section"> +<h2><a name="Managing_stopped_instances"></a>Managing stopped instances</h2> +<p>After stopping the instance no containers on any YARN NodeManagers are allocated. However, the state of the instance is still persisted on the local disks (and to a lesser extent, HDFS) of each machine where a Node Controller was deployed, in the iodevices and transaction log folders. Every instance, running or not can be viewed via the <tt>describe</tt> action:</p> + +<div class="source"> +<div class="source"> +<pre> [vagrant@cc asterix-yarn]$ bin/asterix describe + Existing AsterixDB instances: + Instance my_awesome_instance is stopped +</pre></div></div></div> +<div class="section"> +<h2><a name="Starting_inactive_instances"></a>Starting inactive instances</h2> +<p>To start the instance back up once more, the <tt>start</tt> action is used:</p> + +<div class="source"> +<div class="source"> +<pre> [vagrant@cc asterix-yarn]$ bin/asterix -n my_awesome_instance start + Waiting for AsterixDB instance to resume . + Asterix successfully deployed and is now running. +</pre></div></div></div> +<div class="section"> +<h2><a name="Shutting_down_vagrant"></a>Shutting down vagrant</h2> +<p>To stop the virtual machines, issue the vagrant halt command from the host machine in the folder containing the Vagrantfile:</p> + +<div class="source"> +<div class="source"> +<pre> ↪ vagrant halt +</pre></div></div> +<h1><a name="detail" id="detail">Listing of Commands and Options</a></h1></div> +<div class="section"> +<h2><a name="Overview"></a>Overview</h2> +<p>All commands take the format</p> + +<div class="source"> +<div class="source"> +<pre> asterix [action-specific option] [action] +</pre></div></div> +<div class="section"> +<h3><a name="Technical_details"></a>Technical details</h3> +<p>AsterixDB’s YARN client is based on static allocation of containers within Node Managers based on IP. The AM and CC processes are currently not integrated in any fashion.</p> +<p>The <tt>asterix</tt> command itself is simply a wrapper/launcher around the AsterixClient java class, that provides time-saving default parameters. It is possible to run the client directly with <tt>java -jar</tt> given the correct options as well.</p></div></div> +<div class="section"> +<h2><a name="Actions"></a>Actions</h2> +<p>Below is a description of the various actions available via the AsterixDB YARN client</p> + +<table border="0" class="table table-striped"> + <thead> + +<tr class="a"> + +<th>Action </th> + +<th>Description </th> + </tr> + </thead> + <tbody> + +<tr class="b"> + +<td><tt>start</tt> </td> + +<td>Starts an existing instance specified by the -name flag </td> + </tr> + +<tr class="a"> + +<td><tt>install</tt> </td> + +<td>Deploys and starts an AsterixDB instance described by the config specified in the -c parameter, and named by the -n parameter </td> + </tr> + +<tr class="b"> + +<td><tt>stop</tt> </td> + +<td>Attempts graceful shutdown of an AsterixDB instance specified in the -name parameter </td> + </tr> + +<tr class="a"> + +<td><tt>kill</tt> </td> + +<td>Forcefully stops an instance by asking YARN to terminate all of its containers. </td> + </tr> + +<tr class="b"> + +<td><tt>destroy</tt> </td> + +<td>Remove the instance specified by -name and all of its stored resources from the cluster </td> + </tr> + +<tr class="a"> + +<td><tt>describe</tt> </td> + +<td>Show all instances, running or not, visible to the AsterixDB YARN client </td> + </tr> + +<tr class="b"> + +<td><tt>backup</tt> </td> + +<td>Copies the artifacts from a stopped instance to another directory on HDFS so that the instance can be reverted to that state </td> + </tr> + +<tr class="a"> + +<td><tt>restore</tt> </td> + +<td>Restores an instance to the state saved in a snapshot </td> + </tr> + +<tr class="b"> + +<td><tt>lsbackup</tt> </td> + +<td>Lists the stored snapshots from an instance </td> + </tr> + +<tr class="a"> + +<td><tt>rmbackup</tt> </td> + +<td>Removes a snapshot from HDFS </td> + </tr> + +<tr class="b"> + +<td><tt>libinstall</tt></td> + +<td>Installs an external library or UDF for use in queries </td> + </tr> + </tbody> +</table></div> +<div class="section"> +<h2><a name="Options"></a>Options</h2> +<p>Below are all availabe options, and which actions they can be applied to</p> + +<table border="0" class="table table-striped"> + <thead> + +<tr class="a"> + +<th>Option </th> + +<th>Long Form </th> + +<th>Short Form </th> + +<th>Usage </th> + +<th>Applicability </th> + </tr> + </thead> + <tbody> + +<tr class="b"> + +<td>Configuration Path </td> + +<td><tt>-asterixConf</tt> </td> + +<td><tt>-c</tt> </td> + +<td><tt>-c [/path/to/file]</tt>. Path to an AsterixDB Cluster Description File </td> + +<td>Only required with <tt>create</tt> . A configuration in DFS defines the existance of an instance. </td> + </tr> + +<tr class="a"> + +<td>Instance Name </td> + +<td><tt>-name</tt> </td> + +<td><tt>-n</tt> </td> + +<td><tt>-n [instance name]</tt> Name/Identifier for instance. </td> + +<td>Required for all actions except <tt>describe</tt> and <tt>lsbackup</tt> </td> + </tr> + +<tr class="b"> + +<td>Asterix Binary Path </td> + +<td><tt>-asterixTar</tt> </td> + +<td><tt>-tar</tt> </td> + +<td><tt>-tar [/path/to/binary]</tt> Path to asterix-server binary. </td> + +<td>This is the AsterixDB server binary that is distributed and run on the DFS. Usually set by default via the launcher script and cached for each instance. Can be manually set, only used in <tt>create</tt> and <tt>install</tt> with <tt>-r</tt> </td> + </tr> + +<tr class="a"> + +<td>Force </td> + +<td><tt>-force</tt> </td> + +<td><tt>-f</tt> </td> + +<td><tt>-f</tt>. Use at your own risk. Disables any sanity-checking during an action. </td> + +<td>Can be applied to any action, but is mostly useful in cases where an instance cannot be removed properly via <tt>destroy</tt> and cleanup of DFS files is desired. </td> + </tr> + +<tr class="b"> + +<td>Refresh </td> + +<td><tt>-refresh</tt> </td> + +<td><tt>-r</tt> </td> + +<td><tt>-r</tt>. Replaces cached binary with one mentioned in <tt>-tar</tt>. </td> + +<td>This only has an effect with the <tt>start</tt> action. It can be used to replace/upgrade the binary cached for an instance on the DFS. </td> + </tr> + +<tr class="a"> + +<td>Base Parameters </td> + +<td><tt>-baseConf</tt> </td> + +<td><tt>-bc</tt> </td> + +<td><tt>-bc [path/to/params]</tt>. Specifies parameter file to use during instance creation/alteration. </td> + +<td>This file specifies various internal properties of the AsterixDB system, such as Buffer Cache size and Page size, among many others. It can be helpful to tweak parameters in this file, however caution should be exercised in keeping them at sane values. Only used during <tt>alter</tt> and <tt>create</tt>. </td> + </tr> + +<tr class="b"> + +<td>External library path </td> + +<td><tt>-externalLibs</tt> </td> + +<td><tt>-l</tt> </td> + +<td><tt>-l [path/to/library]</tt>. Specifies an external library to upload to an existing instance. </td> + +<td>Only used in <tt>libinstall</tt>. Specifies the file containing the external function to install </td> + </tr> + +<tr class="a"> + +<td>External library dataverse. </td> + +<td><tt>-libDataverse</tt> </td> + +<td><tt>-ld</tt> </td> + +<td><tt>-ld [existing dataverse name]</tt> </td> + +<td>Only used in <tt>libinstall</tt>. Specifies the dataverse to install the library in an <tt>-l</tt> option to. </td> + </tr> + +<tr class="b"> + +<td>Snapshot ID </td> + +<td><tt>-snapshot</tt> </td> + +<td>[none] </td> + +<td><tt>-snapshot [backup timestamp/ID]</tt> </td> + +<td>Used with <tt>rmbackup</tt> and <tt>restore</tt> to specify which backup to perform the respective operation on. </td> + </tr> + </tbody> +</table> +<h1><a name="faq" id="faq">Frequently Asked Questions and Common Issues</a></h1> +<div class="section"> +<h3><a name="Q:_Where_are_the_AsterixDB_logs_located"></a>Q: Where are the AsterixDB logs located?</h3> +<p>A: YARN manages the logs for each container. They are visible in the YARN Resource Manager’s web interface or through the hadoop command line utilities ( see <a class="externalLink" href="http://hortonworks.com/blog/simplifying-user-logs-management-and-access-in-yarn/">http://hortonworks.com/blog/simplifying-user-logs-management-and-access-in-yarn/</a> for more details). </p></div> +<div class="section"> +<h3><a name="Q:_Why_does_AsterixDB_fail_to_start_and_the_logs_contain_errors_like_Container_is_running_beyond_virtual_memory_limits._"></a>Q: Why does AsterixDB fail to start, and the logs contain errors like ‘Container is running beyond virtual memory limits.’ ?</h3> +<p>A: This is a quirk of YARN’s memory management that can be observed on certain operating systems (mainly CentOS). It is benign unless it causes problems of this type. A work around is to set <tt>yarn.nodemanager.vmem-check-enabled</tt> to <tt>false</tt> in the yarn-site.xml configuration for Hadoop YARN. This makes the NodeManagers avoid checking the virtual memory entirely and instead rely on resident set size to check memory usage among containers.</p></div> +<div class="section"> +<h3><a name="Q:_How_do_I_upgrade_my_existing_instance"></a>Q: How do I upgrade my existing instance?</h3> +<p>A: This is a complex question. Generally, one can use the <tt>refresh</tt> option to upgrade the version of an extant AsterixDB instance. However one must be cautious- we do not guarantee ABI compatability between releases. Therefore extreme caution should be exercised when attempting to upgrade this way!</p></div> +<div class="section"> +<h3><a name="Q:_Does_AsterixDB_work_on_YARN_for_Windows"></a>Q: Does AsterixDB work on YARN for Windows?</h3> +<p>A: In general, yes! It has been done without much real issue. However it is a infrequent use case, so expect the deployment to have some hiccups. We’re always listening on the <a class="externalLink" href="mailto:us...@asterixdb.apache.org">us...@asterixdb.apache.org</a> mailing list for any issues.</p></div></div> + </div> + </div> + </div> + + <hr/> + + <footer> + <div class="container-fluid"> + <div class="row span12">Copyright © 2017 + <a href="https://www.apache.org/">The Apache Software Foundation</a>. + All Rights Reserved. + + </div> + + <?xml version="1.0" encoding="UTF-8"?> +<div class="row-fluid">Apache AsterixDB, AsterixDB, Apache, the Apache + feather logo, and the Apache AsterixDB project logo are either + registered trademarks or trademarks of The Apache Software + Foundation in the United States and other countries. + All other marks mentioned may be trademarks or registered + trademarks of their respective owners.</div> + + + </div> + </footer> + </body> +</html> http://git-wip-us.apache.org/repos/asf/asterixdb-site/blob/444ca1b3/content/download.html ---------------------------------------------------------------------- diff --git a/content/download.html b/content/download.html index 3d18950..ba714e9 100644 --- a/content/download.html +++ b/content/download.html @@ -53,10 +53,10 @@ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Documentation<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li class="dropdown-header">Stable release</li> - <li><a href="docs/0.9.1/index.html">Documentation for 0.9.1<i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="docs/0.9.2/index.html">Documentation for 0.9.2<i class="fa fa-external-link fa-sm"></i></a></li> <li class="divider"></li> <li class="dropdown-header">Snapshot release</li> - <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.2-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.3-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> </ul> </li> <li><a href="about.html">About</a></li> @@ -143,7 +143,7 @@ <div class="col-md-6"> - <p><a class="btn btn-md btn-success" href="http://www.apache.org/dyn/closer.lua/asterixdb/asterixdb-0.9.1/asterix-server-0.9.1-binary-assembly.zip" role="button">Download AsterixDB 0.9.1 <i class="fa fa-download fa-lg"></i> </a></p> + <p><a class="btn btn-md btn-success" href="http://www.apache.org/dyn/closer.lua/asterixdb/asterixdb-0.9.2/asterix-server-0.9.2-binary-assembly.zip" role="button">Download AsterixDB 0.9.2 <i class="fa fa-download fa-lg"></i> </a></p> </div> @@ -165,7 +165,7 @@ <div class="col-md-6"> - <p><a class="btn btn-md btn-success" href="http://www.apache.org/dyn/closer.lua/asterixdb/asterixdb-0.9.1/asterix-installer-0.9.1-binary-assembly.zip" role="button">Download AsterixDB 0.9.1 <i class="fa fa-download fa-lg"></i> </a></p> + <p><a class="btn btn-md btn-success" href="http://www.apache.org/dyn/closer.lua/asterixdb/asterixdb-0.9.2/asterix-installer-0.9.2-binary-assembly.zip" role="button">Download AsterixDB 0.9.2 <i class="fa fa-download fa-lg"></i> </a></p> </div> @@ -188,7 +188,7 @@ <div class="col-md-6"> - <p><a class="btn btn-md btn-success" href="http://www.apache.org/dyn/closer.lua/asterixdb/asterixdb-0.9.1/asterix-yarn-0.9.1-binary-assembly.zip" role="button">Download AsterixDB 0.9.1 <i class="fa fa-download fa-lg"></i> </a></p> + <p><a class="btn btn-md btn-success" href="http://www.apache.org/dyn/closer.lua/asterixdb/asterixdb-0.9.2/asterix-yarn-0.9.2-binary-assembly.zip" role="button">Download AsterixDB 0.9.2 <i class="fa fa-download fa-lg"></i> </a></p> </div> http://git-wip-us.apache.org/repos/asf/asterixdb-site/blob/444ca1b3/content/extension.html ---------------------------------------------------------------------- diff --git a/content/extension.html b/content/extension.html index b729e16..ba35062 100644 --- a/content/extension.html +++ b/content/extension.html @@ -53,10 +53,10 @@ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Documentation<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li class="dropdown-header">Stable release</li> - <li><a href="docs/0.9.1/index.html">Documentation for 0.9.1<i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="docs/0.9.2/index.html">Documentation for 0.9.2<i class="fa fa-external-link fa-sm"></i></a></li> <li class="divider"></li> <li class="dropdown-header">Snapshot release</li> - <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.2-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.3-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> </ul> </li> <li><a href="about.html">About</a></li> http://git-wip-us.apache.org/repos/asf/asterixdb-site/blob/444ca1b3/content/index.html ---------------------------------------------------------------------- diff --git a/content/index.html b/content/index.html index 92b8856..9f7b0c4 100644 --- a/content/index.html +++ b/content/index.html @@ -53,10 +53,10 @@ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Documentation<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li class="dropdown-header">Stable release</li> - <li><a href="docs/0.9.1/index.html">Documentation for 0.9.1<i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="docs/0.9.2/index.html">Documentation for 0.9.2<i class="fa fa-external-link fa-sm"></i></a></li> <li class="divider"></li> <li class="dropdown-header">Snapshot release</li> - <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.2-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.3-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> </ul> </li> <li><a href="about.html">About</a></li> @@ -111,19 +111,19 @@ <div class="col-lg-4"> <h3 id="key-features">Key Features</h3> <ul> - <li><a href="docs/0.9.1/aql/datamodel.html"><strong>Flexible</strong></a> data model</li> + <li><a href="docs/0.9.2/aql/datamodel.html"><strong>Flexible</strong></a> data model</li> <li><a href="http://asterix.ics.uci.edu/pub/vldb14-storage.pdf"><strong>Distributed</strong></a> storage and transaction</li> - <li><a href="docs/0.9.1/feeds/tutorial.html"><strong>Fast</strong></a> data ingestion</li> + <li><a href="docs/0.9.2/feeds/tutorial.html"><strong>Fast</strong></a> data ingestion</li> <li><a href="http://asterix.ics.uci.edu/pub/ICDE11_conf_full_690.pdf"><strong>Scalable</strong></a>, data-parallel query execution runtime</li> - <li><a href="docs/0.9.1/aql/manual.html"><strong>Declarative</strong></a> query language</li> + <li><a href="docs/0.9.2/aql/manual.html"><strong>Declarative</strong></a> query language</li> </ul> <p><strong>AsterixDB</strong> supports various storage and indexing options:</p> <ul> - <li><a href="docs/0.9.1/aql/primer.html"><strong>Managed datasets</strong></a>, internal LSM-based storage</li> - <li><a href="docs/0.9.1/aql/externaldata.html"><strong>External datasets</strong></a>, e.g., data on HDFS</li> - <li><a href="docs/0.9.1/aql/primer.html"><strong>Secondary indexes</strong></a>, for both storage options.</li> + <li><a href="docs/0.9.2/aql/primer.html"><strong>Managed datasets</strong></a>, internal LSM-based storage</li> + <li><a href="docs/0.9.2/aql/externaldata.html"><strong>External datasets</strong></a>, e.g., data on HDFS</li> + <li><a href="docs/0.9.2/aql/primer.html"><strong>Secondary indexes</strong></a>, for both storage options.</li> </ul> </div> @@ -182,17 +182,17 @@ </div> <div class="col-md-4"> <h3 id="community-and-support">Community and Support</h3> - <p>If you have any questions, please feel free to ask on our <a href="mailto:users@asterixdb.apache.org">users</a> mailing list, which you can subscribe to by sending an empty email to <a href="users-subscr...@asterixdb.apache.org">users-subscribe</a>. Check out the <a href="community.html">Community</a> page for more details.</p> + <p>If you have any questions, please feel free to ask on our <a href="mailto:us...@asterixdb.apache.org">users</a> mailing list, which you can subscribe to by sending an empty email to <a href="users-subscr...@asterixdb.apache.org">users-subscribe</a>. Check out the <a href="community.html">Community</a> page for more details.</p> <p>If you would like to know more about how to contribute to AsterixDB or any of its related components, head on over to the <a href="dev-setup.html">Contributing</a> page to learn more.</p> </div> <div class="col-md-4"> <h3 id="download">Download</h3> - <p><a class="btn btn-md btn-success" href="http://www.apache.org/dyn/closer.lua/asterixdb/asterixdb-0.9.1/asterix-installer-0.9.1-binary-assembly.zip" role="button">Download AsterixDB 0.9.1 <i class="fa fa-download fa-lg"></i></a> + <p><a class="btn btn-md btn-success" href="http://www.apache.org/dyn/closer.lua/asterixdb/asterixdb-0.9.2/asterix-installer-0.9.2-binary-assembly.zip" role="button">Download AsterixDB 0.9.2 <i class="fa fa-download fa-lg"></i></a> <a class="btn btn-md btn-info" href="https://github.com/apache/asterixdb/" role="button">GitHub <i class="fa fa-github fa-lg"></i></a></p> - <p><a href="docs/0.9.1/install.html">Installation Guide</a></p> + <p><a href="docs/0.9.2/install.html">Installation Guide</a></p> - <p><a href="docs/0.9.1/aql/primer.html">AsterixDB 101</a></p> + <p><a href="docs/0.9.2/aql/primer.html">AsterixDB 101</a></p> </div> </div> http://git-wip-us.apache.org/repos/asf/asterixdb-site/blob/444ca1b3/content/pushing.html ---------------------------------------------------------------------- diff --git a/content/pushing.html b/content/pushing.html index 87863a2..b8b5d3c 100644 --- a/content/pushing.html +++ b/content/pushing.html @@ -53,10 +53,10 @@ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Documentation<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li class="dropdown-header">Stable release</li> - <li><a href="docs/0.9.1/index.html">Documentation for 0.9.1<i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="docs/0.9.2/index.html">Documentation for 0.9.2<i class="fa fa-external-link fa-sm"></i></a></li> <li class="divider"></li> <li class="dropdown-header">Snapshot release</li> - <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.2-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.3-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> </ul> </li> <li><a href="about.html">About</a></li> http://git-wip-us.apache.org/repos/asf/asterixdb-site/blob/444ca1b3/content/site.html ---------------------------------------------------------------------- diff --git a/content/site.html b/content/site.html index ea2c536..a813cee 100644 --- a/content/site.html +++ b/content/site.html @@ -53,10 +53,10 @@ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Documentation<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li class="dropdown-header">Stable release</li> - <li><a href="docs/0.9.1/index.html">Documentation for 0.9.1<i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="docs/0.9.2/index.html">Documentation for 0.9.2<i class="fa fa-external-link fa-sm"></i></a></li> <li class="divider"></li> <li class="dropdown-header">Snapshot release</li> - <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.2-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.3-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> </ul> </li> <li><a href="about.html">About</a></li> http://git-wip-us.apache.org/repos/asf/asterixdb-site/blob/444ca1b3/content/tools.html ---------------------------------------------------------------------- diff --git a/content/tools.html b/content/tools.html index 9f3cd00..c1a749e 100644 --- a/content/tools.html +++ b/content/tools.html @@ -53,10 +53,10 @@ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Documentation<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li class="dropdown-header">Stable release</li> - <li><a href="docs/0.9.1/index.html">Documentation for 0.9.1<i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="docs/0.9.2/index.html">Documentation for 0.9.2<i class="fa fa-external-link fa-sm"></i></a></li> <li class="divider"></li> <li class="dropdown-header">Snapshot release</li> - <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.2-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> + <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.9.3-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li> </ul> </li> <li><a href="about.html">About</a></li> http://git-wip-us.apache.org/repos/asf/asterixdb-site/blob/444ca1b3/docs/0.9.2/api.html ---------------------------------------------------------------------- diff --git a/docs/0.9.2/api.html b/docs/0.9.2/api.html new file mode 100644 index 0000000..c440c85 --- /dev/null +++ b/docs/0.9.2/api.html @@ -0,0 +1,479 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia at 2017-07-27 + | Rendered using Apache Maven Fluido Skin 1.3.0 +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta name="Date-Revision-yyyymmdd" content="20170727" /> + <meta http-equiv="Content-Language" content="en" /> + <title>AsterixDB – HTTP API to AsterixDB</title> + <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" /> + <link rel="stylesheet" href="./css/site.css" /> + <link rel="stylesheet" href="./css/print.css" media="print" /> + + + <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script> + + + +<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-41536543-1', 'uci.edu'); + ga('send', 'pageview');</script> + + </head> + <body class="topBarDisabled"> + + + + + <div class="container-fluid"> + <div id="banner"> + <div class="pull-left"> + <a href="./" id="bannerLeft"> + <img src="images/asterixlogo.png" alt="AsterixDB"/> + </a> + </div> + <div class="pull-right"> </div> + <div class="clear"><hr/></div> + </div> + + <div id="breadcrumbs"> + <ul class="breadcrumb"> + + + <li id="publishDate">Last Published: 2017-07-27</li> + + + + <li id="projectVersion" class="pull-right">Version: 0.9.2-SNAPSHOT</li> + + <li class="divider pull-right">|</li> + + <li class="pull-right"> <a href="index.html" title="Documentation Home"> + Documentation Home</a> + </li> + + </ul> + </div> + + + <div class="row-fluid"> + <div id="leftColumn" class="span3"> + <div class="well sidebar-nav"> + + + <ul class="nav nav-list"> + <li class="nav-header">Get Started - Installation</li> + + <li> + + <a href="ncservice.html" title="Option 1: using NCService"> + <i class="none"></i> + Option 1: using NCService</a> + </li> + + <li> + + <a href="ansible.html" title="Option 2: using Ansible"> + <i class="none"></i> + Option 2: using Ansible</a> + </li> + + <li> + + <a href="aws.html" title="Option 3: using Amazon Web Services"> + <i class="none"></i> + Option 3: using Amazon Web Services</a> + </li> + + <li> + + <a href="yarn.html" title="Option 4: using YARN"> + <i class="none"></i> + Option 4: using YARN</a> + </li> + + <li> + + <a href="install.html" title="Option 5: using Managix (deprecated)"> + <i class="none"></i> + Option 5: using Managix (deprecated)</a> + </li> + <li class="nav-header">AsterixDB Primer</li> + + <li> + + <a href="sqlpp/primer-sqlpp.html" title="Option 1: using SQL++"> + <i class="none"></i> + Option 1: using SQL++</a> + </li> + + <li> + + <a href="aql/primer.html" title="Option 2: using AQL"> + <i class="none"></i> + Option 2: using AQL</a> + </li> + <li class="nav-header">Data Model</li> + + <li> + + <a href="datamodel.html" title="The Asterix Data Model"> + <i class="none"></i> + The Asterix Data Model</a> + </li> + <li class="nav-header">Queries - SQL++</li> + + <li> + + <a href="sqlpp/manual.html" title="The SQL++ Query Language"> + <i class="none"></i> + The SQL++ Query Language</a> + </li> + + <li> + + <a href="sqlpp/builtins.html" title="Builtin Functions"> + <i class="none"></i> + Builtin Functions</a> + </li> + <li class="nav-header">Queries - AQL</li> + + <li> + + <a href="aql/manual.html" title="The Asterix Query Language (AQL)"> + <i class="none"></i> + The Asterix Query Language (AQL)</a> + </li> + + <li> + + <a href="aql/builtins.html" title="Builtin Functions"> + <i class="none"></i> + Builtin Functions</a> + </li> + <li class="nav-header">API/SDK</li> + + <li class="active"> + + <a href="#"><i class="none"></i>HTTP API</a> + </li> + + <li> + + <a href="csv.html" title="CSV Output"> + <i class="none"></i> + CSV Output</a> + </li> + <li class="nav-header">Advanced Features</li> + + <li> + + <a href="aql/fulltext.html" title="Support of Full-text Queries"> + <i class="none"></i> + Support of Full-text Queries</a> + </li> + + <li> + + <a href="aql/externaldata.html" title="Accessing External Data"> + <i class="none"></i> + Accessing External Data</a> + </li> + + <li> + + <a href="feeds/tutorial.html" title="Support for Data Ingestion"> + <i class="none"></i> + Support for Data Ingestion</a> + </li> + + <li> + + <a href="udf.html" title="User Defined Functions"> + <i class="none"></i> + User Defined Functions</a> + </li> + + <li> + + <a href="aql/filters.html" title="Filter-Based LSM Index Acceleration"> + <i class="none"></i> + Filter-Based LSM Index Acceleration</a> + </li> + + <li> + + <a href="aql/similarity.html" title="Support of Similarity Queries"> + <i class="none"></i> + Support of Similarity Queries</a> + </li> + </ul> + + + + <hr class="divider" /> + + <div id="poweredBy"> + <div class="clear"></div> + <div class="clear"></div> + <div class="clear"></div> + <a href="./" title="AsterixDB" class="builtBy"> + <img class="builtBy" alt="AsterixDB" src="images/asterixlogo.png" /> + </a> + </div> + </div> + </div> + + + <div id="bodyColumn" class="span9" > + + <!-- ! Licensed to the Apache Software Foundation (ASF) under one + ! or more contributor license agreements. See the NOTICE file + ! distributed with this work for additional information + ! regarding copyright ownership. The ASF licenses this file + ! to you under the Apache License, Version 2.0 (the + ! "License"); you may not use this file except in compliance + ! with the License. You may obtain a copy of the License at + ! + ! http://www.apache.org/licenses/LICENSE-2.0 + ! + ! Unless required by applicable law or agreed to in writing, + ! software distributed under the License is distributed on an + ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ! KIND, either express or implied. See the License for the + ! specific language governing permissions and limitations + ! under the License. + ! --><h1>HTTP API to AsterixDB</h1> +<div class="section"> +<h2><a name="Table_of_Contents"></a><a name="toc" id="toc">Table of Contents</a></h2> + +<ul> + +<li><a href="#queryservice">Query Service API</a></li> + +<li><a href="#querystatus">Query Status API</a></li> + +<li><a href="#queryresult">Query Result API</a></li> +</ul></div> +<div class="section"> +<h2><a name="POST_queryservice_Back_to_TOC"></a><a name="queryservice" id="queryservice">POST /query/service</a><font size="4"> <a href="#toc">[Back to TOC]</a></font></h2> +<p><b>Description</b> Returns result for query as JSON. The response is a JSON object that contains some result metadata along with either an embedded result or an opaque handle that can be used to navigate to the result (see the decription of the <tt>mode</tt> parameter for more details).</p> +<p><b>Parameters</b></p> + +<ul> + +<li><tt>statement</tt> - Specifies at least one valid SQL++ statement to run. The statements need to be urlencoded. Required.</li> + +<li><tt>pretty</tt> - If the parameter <tt>pretty</tt> is given with the value <tt>true</tt>, the result will be indented. (Optional)</li> + +<li><tt>client_context_id</tt> - A user-defined sequence of characters that the API receives and returns unchanged. This can be used e.g. to match individual requests, jobs, and responses. Another option could be to use it for groups of requests if an application decides to put e.g. an group identifier into that field to route groups of responses to a particular response processor.</li> + +<li><tt>mode</tt> - Result delivery mode. Possible values are <tt>immediate</tt>, <tt>deferred</tt>, <tt>async</tt> (default: <tt>immediate</tt>). If the delivery mode is <tt>immediate</tt> the query result is returned with the response. If the delivery mode is <tt>deferred</tt> the response contains a handle to the <a href="#queryresult">result</a>. If the delivery mode is <tt>async</tt> the response contains a handle to the query’s <a href="#querystatus">status</a>.</li> +</ul> +<p><b>Command (immediate result delivery)</b></p> + +<div class="source"> +<div class="source"> +<pre>$ curl -v --data-urlencode "statement=select 1;" \ + --data pretty=true \ + --data client_context_id=xyz \ + http://localhost:19002/query/service +</pre></div></div> +<p><b>Sample response</b></p> + +<div class="source"> +<div class="source"> +<pre>> POST /query/service HTTP/1.1 +> Host: localhost:19002 +> User-Agent: curl/7.43.0 +> Accept: */* +> Content-Length: 57 +> Content-Type: application/x-www-form-urlencoded +> +< HTTP/1.1 200 OK +< transfer-encoding: chunked +< connection: keep-alive +< content-type: application/json; charset=utf-8 +< +{ + "requestID": "5f72e78c-482a-45bf-b174-6443c8273025", + "clientContextID": "xyz", + "signature": "*", + "results": [ { + "$1" : 1 + } ] + , + "status": "success", + "metrics": { + "elapsedTime": "20.263371ms", + "executionTime": "19.889389ms", + "resultCount": 1, + "resultSize": 15 + } +} +</pre></div></div> +<p><b>Command (<a name="deferred" id="deferred">deferred result delivery</a>)</b></p> + +<div class="source"> +<div class="source"> +<pre>$ curl -v --data-urlencode "statement=select 1;" \ + --data mode=deferred \ + http://localhost:19002/query/service +</pre></div></div> +<p><b>Sample response</b></p> + +<div class="source"> +<div class="source"> +<pre>> POST /query/service HTTP/1.1 +> Host: localhost:19002 +> User-Agent: curl/7.43.0 +> Accept: */* +> Content-Length: 37 +> Content-Type: application/x-www-form-urlencoded +> +< HTTP/1.1 200 OK +< transfer-encoding: chunked +< connection: keep-alive +< content-type: application/json; charset=utf-8 +< +{ + "requestID": "6df7afb4-5f83-49b6-8c4b-f11ec84c4d7e", + "signature": "*", + "handle": "http://localhost:19002/query/service/result/7-0", + "status": "success", + "metrics": { + "elapsedTime": "12.270570ms", + "executionTime": "11.948343ms", + "resultCount": 0, + "resultSize": 0 + } +} +</pre></div></div> +<p><b>Command (<a name="async" id="async>">async result delivery</a>)</b></p> + +<div class="source"> +<div class="source"> +<pre>$ curl -v --data-urlencode "statement=select 1;" \ + --data mode=async \ + http://localhost:19002/query/service +</pre></div></div> +<p><b>Sample response</b></p> + +<div class="source"> +<div class="source"> +<pre>> POST /query/service HTTP/1.1 +> Host: localhost:19002 +> User-Agent: curl/7.43.0 +> Accept: */* +> Content-Length: 34 +> Content-Type: application/x-www-form-urlencoded +> +< HTTP/1.1 200 OK +< transfer-encoding: chunked +< connection: keep-alive +< content-type: application/json; charset=utf-8 +< +{ + "requestID": "c5858420-d821-4c0c-81a4-2364386827c2", + "signature": "*", + "status": "running", + "handle": "http://localhost:19002/query/service/status/9-0", + "metrics": { + "elapsedTime": "9.727006ms", + "executionTime": "9.402282ms", + "resultCount": 0, + "resultSize": 0 + } +} +</pre></div></div></div> +<div class="section"> +<h2><a name="GET_queryservicestatus_Back_to_TOC"></a><a name="querystatus" id="querystatus">GET /query/service/status</a><font size="4"> <a href="#toc">[Back to TOC]</a></font></h2> +<p><b>Description</b> Returns status of an <tt>async</tt> query request. The response is a JSON object that has a similar structure to the responses for the <a href="#queryservice">/query/service</a> endpoint. Possible status values for the status are <tt>running</tt>, <tt>success</tt>, <tt>timeout</tt>, <tt>failed</tt>, and <tt>fatal</tt>. If the status value is <tt>success</tt>, the response also contains a handle to the <a href="#queryresult">result</a>. URLs for this endpoint are usually not constructed by the application, they are simply extracted from the <tt>handle</tt> field of the response to a request to the <a href="#queryservice">/query/service</a> endpoint.</p> +<p><b>Command</b></p> +<p>This example shows a request/reponse for the (opaque) status handle that was returned by the <a href="#async">async result delivery</a> example.</p> + +<div class="source"> +<div class="source"> +<pre>$ curl -v http://localhost:19002/query/service/status/9-0 +</pre></div></div> +<p><b>Sample response</b></p> + +<div class="source"> +<div class="source"> +<pre>> GET /query/service/status/9-0 HTTP/1.1 +> Host: localhost:19002 +> User-Agent: curl/7.43.0 +> Accept: */* +> +< HTTP/1.1 200 OK +< transfer-encoding: chunked +< connection: keep-alive +< content-type: application/json; charset=utf-8 +< +{ + "status": "success", + "handle": "http://localhost:19002/query/service/result/9-0" +} +</pre></div></div></div> +<div class="section"> +<h2><a name="GET_queryserviceresult_Back_to_TOC"></a><a name="queryresult" id="queryresult">GET /query/service/result</a><font size="4"> <a href="#toc">[Back to TOC]</a></font></h2> +<p><b>Description</b> Returns result set for an <tt>async</tt> or <tt>deferred</tt> query request. The response is a plain result without a wrapping JSON object. URLs for this endpoint are usually not constructed by the application, they are simply extracted from the <tt>handle</tt> field of the response to a request to the <a href="#queryservice">/query/service</a> or the <a href="#querystatus">/query/service/status</a> endpoint.</p> +<p><b>Command</b></p> +<p>This example shows a request/reponse for the (opaque) result handle that was returned by the <a href="#deferred">deferred result delivery</a> example.</p> + +<div class="source"> +<div class="source"> +<pre>$ curl -v http://localhost:19002/query/service/result/7-0 +</pre></div></div> +<p><b>Sample response</b></p> + +<div class="source"> +<div class="source"> +<pre>> GET /query/service/result/7-0 HTTP/1.1 +> Host: localhost:19002 +> User-Agent: curl/7.43.0 +> Accept: */* +> +< HTTP/1.1 200 OK +< transfer-encoding: chunked +< connection: keep-alive +< content-type: application/json +< +[ { "$1": 1 } + ] +</pre></div></div></div> + </div> + </div> + </div> + + <hr/> + + <footer> + <div class="container-fluid"> + <div class="row span12">Copyright © 2017 + <a href="https://www.apache.org/">The Apache Software Foundation</a>. + All Rights Reserved. + + </div> + + <?xml version="1.0" encoding="UTF-8"?> +<div class="row-fluid">Apache AsterixDB, AsterixDB, Apache, the Apache + feather logo, and the Apache AsterixDB project logo are either + registered trademarks or trademarks of The Apache Software + Foundation in the United States and other countries. + All other marks mentioned may be trademarks or registered + trademarks of their respective owners.</div> + + + </div> + </footer> + </body> +</html>