incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: The only valid NOTICE and LICENSE files are in the src dir. This is in prep to remove the src/ directory and have each project live at the root.
Date Tue, 04 Jun 2013 02:35:00 GMT
Updated Branches:
  refs/heads/0.1.5 9f4f8a17d -> 757288e8f


The only valid NOTICE and LICENSE files are in the src dir.  This is in prep to remove the
src/ directory and have each project live at the root.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/757288e8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/757288e8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/757288e8

Branch: refs/heads/0.1.5
Commit: 757288e8f07bb255b8f7a02179477920abe0a50a
Parents: 9f4f8a1
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Mon Jun 3 22:33:59 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Mon Jun 3 22:33:59 2013 -0400

----------------------------------------------------------------------
 LICENSE       |  202 -----------------------------
 NOTICE        |   26 ----
 README.md     |  366 ----------------------------------------------------
 src/README.md |  366 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 366 insertions(+), 594 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/757288e8/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/757288e8/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
deleted file mode 100644
index 840ad2f..0000000
--- a/NOTICE
+++ /dev/null
@@ -1,26 +0,0 @@
-Apache Blur
-Copyright 2012-2013 The Apache Software Foundation
-
-This product includes software developed by The Apache Software
-Foundation (http://www.apache.org/).
-
-Includes software from other Apache Software Foundation projects,
-including, but not limited to:
-- Lucene under Apache License, Version 2.0
-- Hadoop under Apache License, Version 2.0
-- ZooKeeper under Apache License, Version 2.0
-- Thrift under Apache License, Version 2.0
-- Apache Log4j under The Apache Software License, Version 2.0
-- Commons CLI under The Apache Software License, Version 2.0
-- Apache MRUnit under The Apache Software License, Version 2.0
-
-This project also includes:
-- JLine under BSD
-- Guava under The Apache Software License, Version 2.0
-- SLF4J API Module under MIT License
-- SLF4J LOG4J-12 Binding under MIT License
-- concurrentlinkedhashmap (http://code.google.com/p/concurrentlinkedhashmap/)
-   under The Apache Software License, Version 2.0
-- Metrics by Coda Hale, Yammer.com under The Apache Software License, Version 2.0
-
-

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/757288e8/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
deleted file mode 100644
index b5ce1b9..0000000
--- a/README.md
+++ /dev/null
@@ -1,366 +0,0 @@
-Blur
-====
-
-Blur is a NoSQL data store built on top of Lucene, Hadoop, Thrift, and Zookeeper.  Tables
consist of a series of shards (Lucene indexes) that are distributed across a cluster of commodity
servers.
-
-Mail List
-----
-blur-dev@googlegroups.com or go to http://groups.google.com/group/blur-dev
-
-Getting Started
-----
-
-### Clone
-
-First clone the project and compile the project using Maven.  Once this is complete the blur
libraries and dependences will be copied into the lib directory.
-
-### Zookeeper Setup
-
-Setup [Zookeeper][Zookeeper].  It is recommended that all production setups use a clustered
Zookeeper environment, following best [practices][replicated_zk].
-
-### Hadoop Setup
-
-Blur requires Hadoop to be installed because of library dependencies, but running the Hadoop
daemons on the servers is optional.
-
-### HDFS Notes
-
-If you are running Blur on a single machine this is not necessary, but [single node][single_node]
setup is still required for libraries.
-
-Setup Hadoop's HDFS filesystem, which is required for clustered setup.  Though possible,
the Map/Reduce system is not recommended to be run on the same machines the are running the
Blur daemons.  Follow the Hadoop [cluster setup][cluster_setup] guide.
-
-### HDFS Options
-
-HDFS is not required to be installed and running on the same servers as Blur.  However if
the source HDFS is being used for heavy Map/Reduce or any other heavy I/O operations, performance
could be affected.  The storage location for each table is setup independently and via a URI
location (e.g. hdfs://&lt;namenode&gt;:&lt;port&gt;/blur/tables/table/path).
 So there may be several tables online in a Blur cluster and each one could reference a different
HDFS instance.  This assumes that all the HDFS instances are compatible with one another.
-	
-NOTE: The normal 0.20.2 is not compatible with Cloudera's 0.20.2 CDH3u2 version.  Meaning
you cannot install CDH3 on your Blur servers and reference a normal 0.20.2 HDFS instance for
storage (you can not mix these Hadoop versions, and there may be other combinations of CDH
and Apache Hadoop that do not work together).  Blur has not been tested with Hadoop version
[0.20.203.0][0.20.203.0].
-
-### blur-env.sh Configuration
-
-Next you will need to configure the `config/blur-env.sh` file.  The two exports that are
required:
-
-    export JAVA_HOME=/usr/lib/j2sdk1.6-sun
-    export HADOOP_HOME=/var/hadoop-0.20.2
-
-### blur.properties Configuration
-
-Then you will need to setup the `config/blur.properties` file.  The default site configuration:
-
-    blur.zookeeper.connection=localhost
-    blur.cluster.name=default
-
-Other options:
-
-By default if the `blur.*.hostname` properties are left blank, the default value is the result
of `InetAddress.getLocalHost().getHostName();`.  Hostname is required to be unique for every
server.
-    
-    blur.shard.hostname=
-    blur.shard.bind.address=0.0.0.0
-    blur.shard.bind.port=40020
-    blur.shard.server.thrift.thread.count=32
-    blur.shard.opener.thread.count=16
-    blur.shard.cache.max.querycache.elements=128
-    blur.shard.cache.max.timetolive=60000
-    blur.shard.filter.cache.class=com.nearinfinity.blur.manager.DefaultBlurFilterCache
-    blur.shard.index.warmup.class=com.nearinfinity.blur.manager.indexserver.DefaultBlurIndexWarmup
-    blur.shard.index.deletion.policy.class=org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy
-    blur.shard.blockcache.direct.memory.allocation=true
-    blur.shard.blockcache.slab.count=1
-    blur.shard.safemodedelay=60000
-    blur.max.clause.count=1024
-    blur.indexmanager.search.thread.count=32
-
-    blur.controller.hostname=
-    blur.controller.bind.address=0.0.0.0
-    blur.controller.bind.port=40010
-    blur.controller.server.thrift.thread.count=32
-    blur.controller.server.remote.thread.count=64
-    blur.controller.remote.fetch.count=100
-    blur.controller.cache.max.querycache.elements=128
-    blur.controller.cache.max.timetolive=60000
-
-    blur.zookeeper.system.time.tolerance=3000
-
-
-### shards
-
-Then in the `config/shards` list the servers that should run as blur shard servers.  By default
shard servers run on port `40020` and bind to the `0.0.0.0` address.
-
-    shard1
-    shard2
-    shard3
-
-### controllers
-
-Like the shards file, in the `config/controllers` list servers that will run as the blur
controller servers.  By default controller servers run on port `40010` and bind to the `0.0.0.0`
address.
-
-    controller1
-    controller2
-
-NOTE: If you are going to run a single shard server running controllers is not required.
 A single shard server is fully functional on it's own.  Controllers and the shard servers
share the same thrift API, so later your code won't have to be modified to run against a cluster.
-
-### $BLUR_HOME
-
-It is a good idea to add `export BLUR_HOME=/var/blur` in your `.bash_profile`.
-
-### Setup Nodes
-
-Copy the Blur directory to the same location on all servers in the cluster.
-
-Running Blur
-----
-
-### Start
-
-To start the entire cluster run `bin/start-all.sh`, this will execute `bin/start-shards.sh`
and then `bin/start-controllers.sh`.  These two scripts start blur on all the servers.
-
-### Stop
-
-To shutdown blur run `bin/stop-all.sh`, this will stop all the blur processes on all the
servers.
-
-Thrift Client
-----
-
-All of the examples below require Thrift to execute, if you have successfully gotten to this
point you already have the libraries required.
-
-### Plain Thrift API example
-
-    TTransport trans = new TSocket("controller1", 40010);
-    TProtocol proto = new TBinaryProtocol(new TFramedTransport(trans));
-    Client client = new Client(proto);
-    try {
-        trans.open();
-        //use client here
-    } catch (Exception e) {
-        //do something smart...
-    } finally {
-        trans.close();
-    }
-
-### Automatic connect/pool/error retry API example
-
-    Blur.Iface client = BlurClient.getClient("controller1:40010");
-    List<String> tableNames = client.tableList();
-	
-### Async Thrift client helper API example
-
-    AsyncClientPool pool = new AsyncClientPool(10,60000); // 10 connections per host with
a timeout of 60 seconds.
-    AsyncIface client = pool.getClient(Blur.AsyncIface.class, "controller1:40010");
-	client.tableList(new AsyncMethodCallback<tableList_call>() {
-        @Override
-        public void onError(Exception exception) {
-            //do something smart...
-        }  
-        @Override
-        public void onComplete(tableList_call response) {
-            //process result
-	    }
-    });
-
-Creating a Table
-----
-
-### Standalone mode
-
-If you are running on a single node you may reference a local directory for storing the index
data.
-
-    AnalyzerDefinition ad = new AnalyzerDefinition();
-    
-    TableDescriptor td = new TableDescriptor(); 
-    td.setTableUri("file:///tmp/blur-tables/test-table"); // Location on the local machine
-    td.setAnalyzerDefinition(ad);
-    td.setName("test-table");
-    
-    client.createTable(td);
-
-### Cluster mode
-
-If you are running in a cluster you have to use HDFS as the table storage.  The number of
shards should be based on how many indexes your hardware can support as well as the volume
of data.
-
-    AnalyzerDefinition ad = new AnalyzerDefinition();
-    
-    TableDescriptor td = new TableDescriptor();
-    td.setShardCount(16);
-    td.setTableUri("hdfs://<namenode>:<port>/blur/tables/test-table"); // Location
in HDFS
-    td.setAnalyzerDefinition(ad);
-    td.setName("test-table");
-    
-    client.createTable(td);
-
-Loading Data
-----
-
-### Thrift
-
-This is the long thrift way of creating a lot of objects to create a simple row and load
into a table.
-
-    List<Column> columns = new ArrayList<Column>();
-    columns.add(new Column("columnname", "value"));
-
-    Record record = new Record();
-    record.setRecordId("recordid-5678");
-    record.setFamily("column-family");
-    record.setColumns(columns);
-
-    RecordMutation recordMutation = new RecordMutation();
-    recordMutation.setRecord(record);
-    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
-
-    List<RecordMutation> recordMutations = new ArrayList<RecordMutation>();
-    recordMutations.add(recordMutation);
-
-    RowMutation mutation = new RowMutation();
-    mutation.setTable("test-table");
-    mutation.setRowId("rowid-1234");
-    mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
-    mutation.setRecordMutations(recordMutations);
-    
-    client.mutate(mutation);
-
-This is the shorter way of creating the same RowMutation.
-
-    import static com.nearinfinity.blur.utils.BlurUtil.*;
-
-    RowMutation mutation = newRowMutation("test-table", "rowid-1234", 
-            newRecordMutation("column-family", "recordid-5678", 
-                newColumn("columnname", "value")));
-
-    client.mutate(mutation);
-
-### Map/Reduce Bulk Load
-    // Driver Class
-    public class BlurMapReduce {
-      public static void main(String[] args) {
-	    Configuration configuration = new Configuration();
-	    String[] otherArgs = new GenericOptionsParser(configuration, args).getRemainingArgs();
-	    if (otherArgs.length != 2) {
-	      System.err.println("Usage: blurindexer <in> <out>");
-	      System.exit(2);
-	    }
-      
-        AnalyzerDefinition ad = new AnalyzerDefinition();
-
-        TableDescriptor td = new TableDescriptor();
-        td.setShardCount(1);
-        td.setTableUri("hdfs://<namenode>:<port>/blur/tables/test-table"); //
Location in HDFS
-        td.setAnalyzerDefinition(ad);
-      
-        BlurTask blurTask = new BlurTask();
-        blurTask.setTableDescriptor(td);
-
-        // The copy locks are used to throttle how many concurrent 
-        // copies from the reducers are occuring at the same time.
-        // This is normally needed because the indexing cluster is 
-        // typically larger in size than the blur cluster.
-
-        Job job = blurTask.configureJob(configuration);  
-        job.setJarByClass(BlurExampleIndexer.class);
-        job.setMapperClass(BlurExampleMapper.class);
-        job.setInputFormatClass(TextInputFormat.class);
-        job.setOutputFormatClass(TextOutputFormat.class);
-    
-        FileInputFormat.addInputPath(job, new Path(otherArgs[0]));
-        FileOutputFormat.setOutputPath(job, new Path(otherArgs[1], "job-" + System.currentTimeMillis()));
-        System.exit(job.waitForCompletion(true) ? 0 : 1);
-      }
-
-      public static class BlurExampleMapper extends BlurMapper<LongWritable, Text>
{
-        @Override
-        protected void setup(Context context) throws IOException, InterruptedException {
-            super.setup(context);
-            record = _mutate.getRecord();
-            _mutate.setMutateType(MUTATE_TYPE.ADD);
-        }
-  	
-        @Override
-        protected void map(LongWritable key, Text value, Context context) throws IOException,
InterruptedException {
-          // Reset record
-          record.clearColumns();
-          
-          // Set row id
-          record.setRowId("rowid");
-          
-          // Set record id
-          record.setRecordId("recordid");
-          
-          // Set column family
-          record.setFamily("cf1");
-          
-          // Add a column entry
-          record.addColumn(new BlurColumn("column name", "value"));
-
-          // Obviously you would probably parse the value being passed into the method to
extract column data.
-          
-          // Set the key (usually the rowid)
-          byte[] bs = record.getRowId().getBytes();
-          _key.set(bs, 0, bs.length);
-          context.write(_key, _mutate);
-          _recordCounter.increment(1);
-          context.progress();
-        }
-      }
-    }
-
-Fetching Data
-----
-
-Simple example of how to fetch an entire row from a table by rowid:
-
-    Selector selector = new Selector();
-    selector.setRowId("rowid-1234");
-    FetchResult fetchRow = client.fetchRow("test-table", selector);
-    FetchRowResult rowResult = fetchRow.getRowResult();
-    Row row = rowResult.getRow();
-
-To select a subset of columns from a column family:
-
-    Set<String> columnNames = new HashSet<String>();
-    columnNames.add("columnname");
-    selector.putToColumnsToFetch("column-family", columnNames);
-
-To select all the columns from a subset of column families:
-
-    selector.addToColumnFamiliesToFetch("column-family");
-
-Searching
-----
-
-The blur query language is the same as Lucene's [query parser][queryparser] syntax.
-
-### Simple search
-
-The search example will do a full text search for `value` in each column in every column
family.  This is a result of the basic setup, so this behavior can be configured.
-
-    BlurQuery blurQuery = new BlurQuery();
-    SimpleQuery simpleQuery = new SimpleQuery();
-    simpleQuery.setQueryStr("value");
-    blurQuery.setSimpleQuery(simpleQuery);
-    blurQuery.setSelector(new Selector());
-
-    BlurResults blurResults = client.query("test-table", blurQuery);
-    for (BlurResult result : blurResults.getResults()) {
-       // do something with the result
-    }
-
-Shorted version of the same thing:
-
-    import static com.nearinfinity.blur.utils.BlurUtil.*;
-
-    BlurQuery blurQuery = newSimpleQuery("value");
-    BlurResults blurResults = client.query("test-table", blurQuery);
-    for (BlurResult result : blurResults.getResults()) {
-       System.out.println(result);
-    }
-
-The data loaded in the Loading Data section above put `value` in the `columnname` column
in the `column-family` column family.  So you could also search for the row by using the `column-family.columnname:value`
and find all the rows that contain `value` in `columnname`.
-
-### Expert Search
-
-Example coming.
-
-
-
-[cluster_setup]: http://hadoop.apache.org/common/docs/r0.20.203.0/cluster_setup.html
-[single_node]: http://hadoop.apache.org/common/docs/r0.20.203.0/single_node_setup.html
-[Zookeeper]: http://zookeeper.apache.org/doc/r3.3.3/zookeeperStarted.html
-[queryparser]: http://lucene.apache.org/java/3_3_0/queryparsersyntax.html
-[replicated_zk]: http://zookeeper.apache.org/doc/r3.3.3/zookeeperStarted.html#sc_RunningReplicatedZooKeeper
-[0.20.203.0]: http://hadoop.apache.org/common/docs/r0.20.203.0/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/757288e8/src/README.md
----------------------------------------------------------------------
diff --git a/src/README.md b/src/README.md
new file mode 100644
index 0000000..b5ce1b9
--- /dev/null
+++ b/src/README.md
@@ -0,0 +1,366 @@
+Blur
+====
+
+Blur is a NoSQL data store built on top of Lucene, Hadoop, Thrift, and Zookeeper.  Tables
consist of a series of shards (Lucene indexes) that are distributed across a cluster of commodity
servers.
+
+Mail List
+----
+blur-dev@googlegroups.com or go to http://groups.google.com/group/blur-dev
+
+Getting Started
+----
+
+### Clone
+
+First clone the project and compile the project using Maven.  Once this is complete the blur
libraries and dependences will be copied into the lib directory.
+
+### Zookeeper Setup
+
+Setup [Zookeeper][Zookeeper].  It is recommended that all production setups use a clustered
Zookeeper environment, following best [practices][replicated_zk].
+
+### Hadoop Setup
+
+Blur requires Hadoop to be installed because of library dependencies, but running the Hadoop
daemons on the servers is optional.
+
+### HDFS Notes
+
+If you are running Blur on a single machine this is not necessary, but [single node][single_node]
setup is still required for libraries.
+
+Setup Hadoop's HDFS filesystem, which is required for clustered setup.  Though possible,
the Map/Reduce system is not recommended to be run on the same machines the are running the
Blur daemons.  Follow the Hadoop [cluster setup][cluster_setup] guide.
+
+### HDFS Options
+
+HDFS is not required to be installed and running on the same servers as Blur.  However if
the source HDFS is being used for heavy Map/Reduce or any other heavy I/O operations, performance
could be affected.  The storage location for each table is setup independently and via a URI
location (e.g. hdfs://&lt;namenode&gt;:&lt;port&gt;/blur/tables/table/path).
 So there may be several tables online in a Blur cluster and each one could reference a different
HDFS instance.  This assumes that all the HDFS instances are compatible with one another.
+	
+NOTE: The normal 0.20.2 is not compatible with Cloudera's 0.20.2 CDH3u2 version.  Meaning
you cannot install CDH3 on your Blur servers and reference a normal 0.20.2 HDFS instance for
storage (you can not mix these Hadoop versions, and there may be other combinations of CDH
and Apache Hadoop that do not work together).  Blur has not been tested with Hadoop version
[0.20.203.0][0.20.203.0].
+
+### blur-env.sh Configuration
+
+Next you will need to configure the `config/blur-env.sh` file.  The two exports that are
required:
+
+    export JAVA_HOME=/usr/lib/j2sdk1.6-sun
+    export HADOOP_HOME=/var/hadoop-0.20.2
+
+### blur.properties Configuration
+
+Then you will need to setup the `config/blur.properties` file.  The default site configuration:
+
+    blur.zookeeper.connection=localhost
+    blur.cluster.name=default
+
+Other options:
+
+By default if the `blur.*.hostname` properties are left blank, the default value is the result
of `InetAddress.getLocalHost().getHostName();`.  Hostname is required to be unique for every
server.
+    
+    blur.shard.hostname=
+    blur.shard.bind.address=0.0.0.0
+    blur.shard.bind.port=40020
+    blur.shard.server.thrift.thread.count=32
+    blur.shard.opener.thread.count=16
+    blur.shard.cache.max.querycache.elements=128
+    blur.shard.cache.max.timetolive=60000
+    blur.shard.filter.cache.class=com.nearinfinity.blur.manager.DefaultBlurFilterCache
+    blur.shard.index.warmup.class=com.nearinfinity.blur.manager.indexserver.DefaultBlurIndexWarmup
+    blur.shard.index.deletion.policy.class=org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy
+    blur.shard.blockcache.direct.memory.allocation=true
+    blur.shard.blockcache.slab.count=1
+    blur.shard.safemodedelay=60000
+    blur.max.clause.count=1024
+    blur.indexmanager.search.thread.count=32
+
+    blur.controller.hostname=
+    blur.controller.bind.address=0.0.0.0
+    blur.controller.bind.port=40010
+    blur.controller.server.thrift.thread.count=32
+    blur.controller.server.remote.thread.count=64
+    blur.controller.remote.fetch.count=100
+    blur.controller.cache.max.querycache.elements=128
+    blur.controller.cache.max.timetolive=60000
+
+    blur.zookeeper.system.time.tolerance=3000
+
+
+### shards
+
+Then in the `config/shards` list the servers that should run as blur shard servers.  By default
shard servers run on port `40020` and bind to the `0.0.0.0` address.
+
+    shard1
+    shard2
+    shard3
+
+### controllers
+
+Like the shards file, in the `config/controllers` list servers that will run as the blur
controller servers.  By default controller servers run on port `40010` and bind to the `0.0.0.0`
address.
+
+    controller1
+    controller2
+
+NOTE: If you are going to run a single shard server running controllers is not required.
 A single shard server is fully functional on it's own.  Controllers and the shard servers
share the same thrift API, so later your code won't have to be modified to run against a cluster.
+
+### $BLUR_HOME
+
+It is a good idea to add `export BLUR_HOME=/var/blur` in your `.bash_profile`.
+
+### Setup Nodes
+
+Copy the Blur directory to the same location on all servers in the cluster.
+
+Running Blur
+----
+
+### Start
+
+To start the entire cluster run `bin/start-all.sh`, this will execute `bin/start-shards.sh`
and then `bin/start-controllers.sh`.  These two scripts start blur on all the servers.
+
+### Stop
+
+To shutdown blur run `bin/stop-all.sh`, this will stop all the blur processes on all the
servers.
+
+Thrift Client
+----
+
+All of the examples below require Thrift to execute, if you have successfully gotten to this
point you already have the libraries required.
+
+### Plain Thrift API example
+
+    TTransport trans = new TSocket("controller1", 40010);
+    TProtocol proto = new TBinaryProtocol(new TFramedTransport(trans));
+    Client client = new Client(proto);
+    try {
+        trans.open();
+        //use client here
+    } catch (Exception e) {
+        //do something smart...
+    } finally {
+        trans.close();
+    }
+
+### Automatic connect/pool/error retry API example
+
+    Blur.Iface client = BlurClient.getClient("controller1:40010");
+    List<String> tableNames = client.tableList();
+	
+### Async Thrift client helper API example
+
+    AsyncClientPool pool = new AsyncClientPool(10,60000); // 10 connections per host with
a timeout of 60 seconds.
+    AsyncIface client = pool.getClient(Blur.AsyncIface.class, "controller1:40010");
+	client.tableList(new AsyncMethodCallback<tableList_call>() {
+        @Override
+        public void onError(Exception exception) {
+            //do something smart...
+        }  
+        @Override
+        public void onComplete(tableList_call response) {
+            //process result
+	    }
+    });
+
+Creating a Table
+----
+
+### Standalone mode
+
+If you are running on a single node you may reference a local directory for storing the index
data.
+
+    AnalyzerDefinition ad = new AnalyzerDefinition();
+    
+    TableDescriptor td = new TableDescriptor(); 
+    td.setTableUri("file:///tmp/blur-tables/test-table"); // Location on the local machine
+    td.setAnalyzerDefinition(ad);
+    td.setName("test-table");
+    
+    client.createTable(td);
+
+### Cluster mode
+
+If you are running in a cluster you have to use HDFS as the table storage.  The number of
shards should be based on how many indexes your hardware can support as well as the volume
of data.
+
+    AnalyzerDefinition ad = new AnalyzerDefinition();
+    
+    TableDescriptor td = new TableDescriptor();
+    td.setShardCount(16);
+    td.setTableUri("hdfs://<namenode>:<port>/blur/tables/test-table"); // Location
in HDFS
+    td.setAnalyzerDefinition(ad);
+    td.setName("test-table");
+    
+    client.createTable(td);
+
+Loading Data
+----
+
+### Thrift
+
+This is the long thrift way of creating a lot of objects to create a simple row and load
into a table.
+
+    List<Column> columns = new ArrayList<Column>();
+    columns.add(new Column("columnname", "value"));
+
+    Record record = new Record();
+    record.setRecordId("recordid-5678");
+    record.setFamily("column-family");
+    record.setColumns(columns);
+
+    RecordMutation recordMutation = new RecordMutation();
+    recordMutation.setRecord(record);
+    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
+
+    List<RecordMutation> recordMutations = new ArrayList<RecordMutation>();
+    recordMutations.add(recordMutation);
+
+    RowMutation mutation = new RowMutation();
+    mutation.setTable("test-table");
+    mutation.setRowId("rowid-1234");
+    mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
+    mutation.setRecordMutations(recordMutations);
+    
+    client.mutate(mutation);
+
+This is the shorter way of creating the same RowMutation.
+
+    import static com.nearinfinity.blur.utils.BlurUtil.*;
+
+    RowMutation mutation = newRowMutation("test-table", "rowid-1234", 
+            newRecordMutation("column-family", "recordid-5678", 
+                newColumn("columnname", "value")));
+
+    client.mutate(mutation);
+
+### Map/Reduce Bulk Load
+    // Driver Class
+    public class BlurMapReduce {
+      public static void main(String[] args) {
+	    Configuration configuration = new Configuration();
+	    String[] otherArgs = new GenericOptionsParser(configuration, args).getRemainingArgs();
+	    if (otherArgs.length != 2) {
+	      System.err.println("Usage: blurindexer <in> <out>");
+	      System.exit(2);
+	    }
+      
+        AnalyzerDefinition ad = new AnalyzerDefinition();
+
+        TableDescriptor td = new TableDescriptor();
+        td.setShardCount(1);
+        td.setTableUri("hdfs://<namenode>:<port>/blur/tables/test-table"); //
Location in HDFS
+        td.setAnalyzerDefinition(ad);
+      
+        BlurTask blurTask = new BlurTask();
+        blurTask.setTableDescriptor(td);
+
+        // The copy locks are used to throttle how many concurrent 
+        // copies from the reducers are occuring at the same time.
+        // This is normally needed because the indexing cluster is 
+        // typically larger in size than the blur cluster.
+
+        Job job = blurTask.configureJob(configuration);  
+        job.setJarByClass(BlurExampleIndexer.class);
+        job.setMapperClass(BlurExampleMapper.class);
+        job.setInputFormatClass(TextInputFormat.class);
+        job.setOutputFormatClass(TextOutputFormat.class);
+    
+        FileInputFormat.addInputPath(job, new Path(otherArgs[0]));
+        FileOutputFormat.setOutputPath(job, new Path(otherArgs[1], "job-" + System.currentTimeMillis()));
+        System.exit(job.waitForCompletion(true) ? 0 : 1);
+      }
+
+      public static class BlurExampleMapper extends BlurMapper<LongWritable, Text>
{
+        @Override
+        protected void setup(Context context) throws IOException, InterruptedException {
+            super.setup(context);
+            record = _mutate.getRecord();
+            _mutate.setMutateType(MUTATE_TYPE.ADD);
+        }
+  	
+        @Override
+        protected void map(LongWritable key, Text value, Context context) throws IOException,
InterruptedException {
+          // Reset record
+          record.clearColumns();
+          
+          // Set row id
+          record.setRowId("rowid");
+          
+          // Set record id
+          record.setRecordId("recordid");
+          
+          // Set column family
+          record.setFamily("cf1");
+          
+          // Add a column entry
+          record.addColumn(new BlurColumn("column name", "value"));
+
+          // Obviously you would probably parse the value being passed into the method to
extract column data.
+          
+          // Set the key (usually the rowid)
+          byte[] bs = record.getRowId().getBytes();
+          _key.set(bs, 0, bs.length);
+          context.write(_key, _mutate);
+          _recordCounter.increment(1);
+          context.progress();
+        }
+      }
+    }
+
+Fetching Data
+----
+
+Simple example of how to fetch an entire row from a table by rowid:
+
+    Selector selector = new Selector();
+    selector.setRowId("rowid-1234");
+    FetchResult fetchRow = client.fetchRow("test-table", selector);
+    FetchRowResult rowResult = fetchRow.getRowResult();
+    Row row = rowResult.getRow();
+
+To select a subset of columns from a column family:
+
+    Set<String> columnNames = new HashSet<String>();
+    columnNames.add("columnname");
+    selector.putToColumnsToFetch("column-family", columnNames);
+
+To select all the columns from a subset of column families:
+
+    selector.addToColumnFamiliesToFetch("column-family");
+
+Searching
+----
+
+The blur query language is the same as Lucene's [query parser][queryparser] syntax.
+
+### Simple search
+
+The search example will do a full text search for `value` in each column in every column
family.  This is a result of the basic setup, so this behavior can be configured.
+
+    BlurQuery blurQuery = new BlurQuery();
+    SimpleQuery simpleQuery = new SimpleQuery();
+    simpleQuery.setQueryStr("value");
+    blurQuery.setSimpleQuery(simpleQuery);
+    blurQuery.setSelector(new Selector());
+
+    BlurResults blurResults = client.query("test-table", blurQuery);
+    for (BlurResult result : blurResults.getResults()) {
+       // do something with the result
+    }
+
+Shorted version of the same thing:
+
+    import static com.nearinfinity.blur.utils.BlurUtil.*;
+
+    BlurQuery blurQuery = newSimpleQuery("value");
+    BlurResults blurResults = client.query("test-table", blurQuery);
+    for (BlurResult result : blurResults.getResults()) {
+       System.out.println(result);
+    }
+
+The data loaded in the Loading Data section above put `value` in the `columnname` column
in the `column-family` column family.  So you could also search for the row by using the `column-family.columnname:value`
and find all the rows that contain `value` in `columnname`.
+
+### Expert Search
+
+Example coming.
+
+
+
+[cluster_setup]: http://hadoop.apache.org/common/docs/r0.20.203.0/cluster_setup.html
+[single_node]: http://hadoop.apache.org/common/docs/r0.20.203.0/single_node_setup.html
+[Zookeeper]: http://zookeeper.apache.org/doc/r3.3.3/zookeeperStarted.html
+[queryparser]: http://lucene.apache.org/java/3_3_0/queryparsersyntax.html
+[replicated_zk]: http://zookeeper.apache.org/doc/r3.3.3/zookeeperStarted.html#sc_RunningReplicatedZooKeeper
+[0.20.203.0]: http://hadoop.apache.org/common/docs/r0.20.203.0/
\ No newline at end of file


Mime
View raw message