0

MRv2 に相当する JobClient (Java、MRv1) が見つかりません。実行中のジョブの MR ジョブ ステータス、カウンターなどを読み取ろうとしています。リソースマネージャーから情報を取得する必要があると思います(ジョブが終了する前に履歴サーバーに情報がなく、ジョブの実行中にカウンターを読み取る必要があるため)。mapreduce api に欠けているクライアントはありますか?

4

1 に答える 1

0

YARN に送信した MR ジョブのアプリケーション ID がある場合は、次を使用できます。

  • YarnClient( import org.apache.hadoop.yarn.client.api.YarnClient) と
  • ApplicationReport( import org.apache.hadoop.yarn.api.records.ApplicationReport)

アプリケーション関連の統計を取得します。

たとえば、サンプルコードは次のとおりです。

// Initialize and start YARN client
YarnClient yarnClient = YarnClient.createYarnClient();
yarnClient.init(configuration);
yarnClient.start();

// Get application report
try {
    ApplicationReport applicationReport = yarnClient.getApplicationReport(ConverterUtils.toApplicationId(applicationID));
    // Get whatever you want here.
} catch (Exception e) {
    // Handle exception;
}

// Stop YARN client
yarnClient.stop();

ApplicationReportクラスから取得できる情報の一部は次のとおりです。

  1. アプリケーション リソース使用レポート

  2. アプリケーション診断

  3. 最終申請状況

  4. 開始時間と終了時間

  5. アプリケーションタイプ

  6. 優先順位

  7. 進捗等

YarnClientおよびここで API ドキュメントを確認できApplicationReportます (これは Hadoop 2.7 ドキュメントです)。

于 2016-07-15T06:05:54.613 に答える