Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for 
change notification.

The "HadoopSupport_JP" page has been changed by yukim.
http://wiki.apache.org/cassandra/HadoopSupport_JP?action=diff&rev1=9&rev2=10

--------------------------------------------------

  ## page was copied from HadoopSupport
- Cassandra version 0.6 and later support running Hadoop jobs against data in 
Cassandra, out of the box.  See 
https://svn.apache.org/repos/asf/cassandra/trunk/contrib/word_count/ for an 
example.  (Inserting the ''output'' of a Hadoop job into Cassandra has always 
been possible.)  Cassandra rows or row fragments (that is, pairs of key + 
`SortedMap` of columns) are input to Map tasks for processing by your job, as 
specified by a `SlicePredicate` that describes which columns to fetch from each 
row.  Here's how this looks in the word_count example, which selects just one 
configurable columnName from each row:
+ # language ja
+ 
バージョン0.6以降のCassandraは、保持しているデータに対するHadoopのジョブ実行をサポートしています。https://svn.apache.org/repos/asf/cassandra/trunk/contrib/word_count/
 
にサンプルがあります(Hadoopジョブの''出力''をCassandraに入力するのももちろん可能です)。Cassandraの行または行フラグメント(キーと、カラムの`SortedMap`のペア)がMapタスクの入力となります。それは各行からどのカラムをフェッチするかを決めるための
 `SlicePredicate` 
で指定されます。word_countサンプルでは1つのカラムを各行から選択していますが、その部分の処理は以下のようになっています。
  
  {{{
              ConfigHelper.setColumnFamily(job.getConfiguration(), KEYSPACE, 
COLUMN_FAMILY);
              SlicePredicate predicate = new 
SlicePredicate().setColumn_names(Arrays.asList(columnName.getBytes()));
              ConfigHelper.setSlicePredicate(job.getConfiguration(), predicate);
  }}}
- Cassandra also provides a [[http://hadoop.apache.org/pig/|Pig]] `LoadFunc` 
for running jobs in the Pig DSL instead of writing Java code by hand.  This is 
in https://svn.apache.org/repos/asf/cassandra/trunk/contrib/pig/.
+ 
Javaのコードを記述するのではなく[[http://hadoop.apache.org/pig/|Pig]]のDSLでジョブを実行出来るようにCassandraは`LoadFunc`を提供します。https://svn.apache.org/repos/asf/cassandra/trunk/contrib/pig/
 にあります。
  
- Cassandra's splits are location-aware (this is the nature of the Hadoop 
InputSplit design).  Cassandra gives hadoop a list of locations with each split 
of data, and Hadoop tries to schedule jobs on instances near that data, which 
in practice means you should have Hadoop instances on each of your Cassandra 
machines.
+ 
Cassandraのsplitはロケーションアウェアです(これはHadoopのInputSplitの設計の本質でもあります)。CassandraはデータのsplitとともにロケーションのリストもHadoopに渡します。Hadoopはデータに一番近いインスタンスでジョブを実行するようにスケジューリングします。ということはHadoopインスタンスをCassandraのマシンそれぞれに載せるのがよいでしょう。
  
+ 
0.6.2/0.7より前のリリースでは、ジョブを失敗させる原因となるリソースのリークが確認されています(コネクションが正常にリリースされないことによるリソースリーク)。環境の設定によりますが、この問題に遭遇することがあります。回避策としては、プロセスがオープン可能なファイルディスクリプタの上限を上げることです(linux/bashでは`ulimit
 -n 32000`とする、等)。エラーはHadoopのジョブ側にThriftのTimedOutExceptionとして報告されます。
- Releases before  0.6.2/0.7 are affected by a small resource leak that may 
cause jobs to fail (connections are not released properly, causing a resource 
leak). Depending on your local setup you may hit this issue, and workaround it 
by raising the limit of open file descriptors for the process (e.g. in 
linux/bash using `ulimit -n 32000`). 
- The error will be reported on the hadoop job side as a thrift 
TimedOutException.
  
- If you are testing the integration against a single node and you obtain some 
failures, this may be normal: you are probably overloading the single machine, 
which may again result in timeout errors. You can workaround it by reducing the 
number of concurrent tasks
+ 
1つのノードに対してHadoop連携テストを行っていて何らかのエラーが発生した場合、それは正常なことかもしれません。1台のマシンに対して負荷を与えすぎるとタイムアウトエラーが発生します。その場合、同時実行するタスクの数を減らすことで回避することが可能です。
  {{{
               Configuration conf = job.getConfiguration(); 
               conf.setInt("mapred.tasktracker.map.tasks.maximum",1); 
  }}}
  
- Also, you may reduce the size in rows of the batch you are reading from 
cassandra 
+ また、Cassandraからバッチで読み込む行数を減らすには以下のようにします。
  {{{
               ConfigHelper.setRangeBatchSize(job.getConfiguration(), 1000);
  }}}

Reply via email to