小编Raj*_*mar的帖子

将静态数据集与DStream连接时出现Spark检查点错误

我试图在Java中使用Spark Streaming应用程序.我的Spark应用程序使用textFileStream()以每1 分钟的间隔从Hadoop目录读取连续的feed .我需要对传入的DStream执行Spark聚合(分组依据)操作.聚合后,我汇总接合DStream<Key, Value1>RDD<Key, Value2>RDD<Key, Value2>由读取静态数据集创建()文本文件从Hadoop的目录.

启用检查点时会出现问题.使用空检查点目录,它运行正常.运行2-3批后,我用ctrl+ 关闭它c并再次运行.在第二次运行时,它会立即抛出火花异常:"SPARK-5063"

Exception in thread "main" org.apache.spark.SparkException: RDD transformations and actions can only be invoked by the driver, not inside of other transformations; for example, rdd1.map(x => rdd2.values.count() * x) is invalid because the values transformation and count action cannot be performed inside of the rdd1.map transformation. For more information, see SPARK-5063
Run Code Online (Sandbox Code Playgroud)

以下是火花应用代码块:

private void compute(JavaSparkContext sc, …
Run Code Online (Sandbox Code Playgroud)

java apache-spark hadoop2 spark-streaming

6
推荐指数
0
解决办法
420
查看次数

使用Gmail API发送电子邮件时出错?

我正在尝试使用Gmail java API发送邮件.我得到以下错误.

Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
  "code" : 403,
  "errors" : [ {
    "domain" : "global",
    "message" : "Insufficient Permission",
    "reason" : "insufficientPermissions"
  } ],
  "message" : "Insufficient Permission"
}
    at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:111)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:38)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:314)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1060)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:412)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:345)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:463)
    at GMailLibrary.SendEmail.sendMessage(SendEmail.java:32)
    at GMailLibrary.GMailAuthentication.main(GMailAuthentication.java:85)
Java Result: 1
Run Code Online (Sandbox Code Playgroud)

我使用身份验证代码完成了身份验证部分.以下是我发送电子邮件的代码.

public class SendEmail 
{
      public static void sendMessage(Gmail service, String userId, MimeMessage email)throws MessagingException, IOException 
      {
            Message message = createMessageWithEmail(email);
            message …
Run Code Online (Sandbox Code Playgroud)

java sendmail gmail-api

1
推荐指数
1
解决办法
3947
查看次数