简体   繁体   English

如何在Java中检索唯一的Spark作业ID?

[英]how can i retrieve a unique spark job-id in Java?

I've already seen this post . 我已经看过这篇文章 But I don't seem to be able to find applicationid on JavaSparkContext . 但是我似乎无法在JavaSparkContext上找到applicationid。

Actually want I need is a unique id that identifies the application. 实际上我需要的是用于标识应用程序的唯一ID。 I could just generate uuid and set it as app-name. 我可以生成uuid并将其设置为应用程序名称。 Is there a better way? 有没有更好的办法?

Try this :- 尝试这个 :-

JavaSC.env().conf().getAppId(); 

or 要么

ctxt.getConf().getAppId()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM