MRv2 に相当する JobClient (Java、MRv1) が見つかりません。実行中のジョブの MR ジョブ ステータス、カウンターなどを読み取ろうとしています。リソースマネージャーから情報を取得する必要があると思います(ジョブが終了する前に履歴サーバーに情報がなく、ジョブの実行中にカウンターを読み取る必要があるため)。mapreduce api に欠けているクライアントはありますか?
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
クラスから取得できる情報の一部は次のとおりです。
アプリケーション リソース使用レポート
アプリケーション診断
最終申請状況
開始時間と終了時間
アプリケーションタイプ
優先順位
進捗等
YarnClient
およびここで API ドキュメントを確認できApplicationReport
ます (これは Hadoop 2.7 ドキュメントです)。
于 2016-07-15T06:05:54.613 に答える