1

Oozie で Hbase Map-Reduce ジョブをスケジュールしたいのですが、次の問題に直面しています。

How/Where  to specify these properties in oozie workflow ?
(    i> Table name for Mapper/Reducer 
     ii> scan object for Mapper         )


    Scan scan = new Scan(new Get());

    scan.setMaxVersions();

    scan.addColumn(Bytes.toBytes(FAMILY),
            Bytes.toBytes(VALUE));
    scan.addColumn(Bytes.toBytes(FAMILY),
            Bytes.toBytes(DATE));

    Job job = new Job(conf, JOB_NAME + "_" + TABLE_USER);
    // These two properties :-
    TableMapReduceUtil.initTableMapperJob(TABLE_USER, scan,
            Mapper.class, Text.class, Text.class, job);
    TableMapReduceUtil.initTableReducerJob(DETAILS_TABLE,
            Reducer.class, job);

また

please let me know the best way to schedule a Hbase Map-Reduce Job by Oozie .

ありがとう :) :)

4

2 に答える 2

3

(私によると) Hbase Map_Reduce ジョブをスケジュールする最善の方法は、.java ファイルとしてスケジュールすることです。 それはうまく機能し、スキャンを文字列などに変更するコードを書く必要はありません。したがって、より良いオプションが得られるまで、Javaファイルのようなジョブをスケジュールしています。

workflow-app xmlns="uri:oozie:workflow:0.1" name="java-main-wf">
<start to="java-node"/>
<action name="java-node">
    <java>
          <job-tracker></job-tracker>
        <name-node></name-node>
        <configuration>
            <property>
                <name>mapred.job.queue.name</name>
                <value>${queueName}</value>
            </property>
        </configuration>
        <main-class>org.apache.oozie.example.DemoJavaMain</main-class>
        <arg>Hello</arg>
        <arg>Oozie!</arg>
     <arg>This</arg>
        <arg>is</arg>
     <arg>Demo</arg>
        <arg>Oozie!</arg>

    </java>
    <ok to="end"/>
    <error to="fail"/>
</action>
<kill name="fail">
    <message>Java failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>

于 2012-09-25T09:47:56.773 に答える