Apache spark 当“每个上下文的最大作业数”值超过时,作业提交失败,出现通用503错误
我在配置文件中设置了context per jvm=true和max jobs per context=4 我使用以下curl命令预先创建了上下文:Apache spark 当“每个上下文的最大作业数”值超过时,作业提交失败,出现通用503错误,apache-spark,jersey,spark-jobserver,Apache Spark,Jersey,Spark Jobserver,我在配置文件中设置了context per jvm=true和max jobs per context=4 我使用以下curl命令预先创建了上下文: curl-d''http://jobserver:8090/contexts/test-上下文“ 我正在使用以下curl命令提交作业: curl-d''http://jobserver:8090/jobs?appName=test&classPath=com.xyz.Test&context=test-上下文“ 使用上述命令提交4个作业后,提交第5
curl-d''http://jobserver:8090/contexts/test-上下文“
我正在使用以下curl命令提交作业:
curl-d''http://jobserver:8090/jobs?appName=test&classPath=com.xyz.Test&context=test-上下文“
使用上述命令提交4个作业后,提交第5个作业将给出以下响应:
{
"status": "NO SLOTS AVAILABLE",
"result": "Too many running jobs (4) for job context 'test-context'"
}
这是一个得体而有用的回答
但是,当我使用从Java程序提交作业时,第5个作业的作业提交失败,出现一个通用的503异常,没有任何特定的错误消息
以下是代码片段:
public static void main(String[] args) {
WebTarget resource = client.target("http://jobserver:8090/jobs?appName=test&classPath=com.xyz.Test&context=test-context");
Response response = resource.request().post(Entity.json(""), Response.class);
System.out.println("Response:" + response);
}
输出:
响应:InboundJaxrsResponse{context=ClientResponse{method=POST,uri=http://jobserver:8090/jobs?appName=test&classPath=com.xyz.Test&context=test-上下文,状态=503,原因=服务不可用}
这种不一致的原因是什么?我的Jersey API调用中是否缺少某些内容?我能够使用以下方法获得特定的JSON响应:
response.readEntity(JSONObject.class)
或response.readEntity(String.class)