小编swd*_*dev的帖子

如何使用yarn-cluster master获取进度条(包含阶段和任务)?

使用以下内容运行Spark Shell查询时:

spark-shell yarn --name myQuery -i ./my-query.scala
Run Code Online (Sandbox Code Playgroud)

在我的查询内部是简单的Spark SQL查询,我在其中阅读镶木地板文件并运行简单查询并写出镶木地板文件.运行这些查询时,我得到一个很好的进度条,如下所示:

[Stage7:===========>                              (14174 + 5) / 62500]
Run Code Online (Sandbox Code Playgroud)

当我使用完全相同的查询创建jar并使用以下命令行运行它时:

spark-submit \
  --master yarn-cluster \
  --driver-memory 16G \
  --queue default \
  --num-executors 5 \
  --executor-cores 4 \
  --executor-memory 32G \
  --name MyQuery \
  --class com.data.MyQuery \
  target/uber-my-query-0.1-SNAPSHOT.jar 
Run Code Online (Sandbox Code Playgroud)

我没有得到任何这样的进展吧.该命令只是反复说

17/10/20 17:52:25 INFO yarn.Client: Application report for application_1507058523816_0443 (state: RUNNING)
Run Code Online (Sandbox Code Playgroud)

查询工作正常,结果很好.但是我只需要在流程结束时得到反馈.我尝试了以下内容.

  1. RUNNING Hadoop Applications的网页确实有一个进度条,但它基本上没有移动.即使在spark-shell查询的情况下,进度条也没用.
  2. 我已尝试通过YARN日志获取进度条,但在作业完成之前它们不会聚合.即使这样,日志中也没有进度条.

有没有办法在集群中的jar中启动spark查询并有进度条?

jar progress-bar hadoop-yarn apache-spark apache-spark-sql

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

如何绕过Linux"Too Many Arguments"限制

我必须将256Kb的文本作为参数传递给"aws sqs"命令,但是在命令行中运行的限制大约为140Kb.这在许多地方已经讨论过,它已经在Linux内核中从2.6.23内核中解决了.

但无法让它发挥作用.我在用3.14.48-33.39.amzn1.x86_64

这是一个简单的测试示例:

#!/bin/bash

SIZE=1000
while [ $SIZE -lt 300000 ]
do
   echo "$SIZE"
   VAR="`head -c $SIZE < /dev/zero | tr '\0' 'a'`"
   ./foo "$VAR"
   let SIZE="( $SIZE * 20 ) / 19"
done
Run Code Online (Sandbox Code Playgroud)

foo剧本只是:

#!/bin/bash
echo -n "$1" | wc -c
Run Code Online (Sandbox Code Playgroud)

而我的输出是:

117037
123196
123196
129680
129680
136505
./testCL: line 11: ./foo: Argument list too long
143689
./testCL: line 11: ./foo: Argument list too long
151251
./testCL: line 11: ./foo: Argument list too …
Run Code Online (Sandbox Code Playgroud)

linux shell amazon-sqs

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

为什么Java的Math.round()无法处理这个数字?

我有这样的代码:

System.out.println("Math.round(1423562400L) => " + Math.round(1423562400L));
Run Code Online (Sandbox Code Playgroud)

结果如下:

Math.round(1423562400L) => 1423562368
Run Code Online (Sandbox Code Playgroud)

此值是64位整数,但它很容易适合32位整数,该整数应该适合双精度.到底是怎么回事?

java rounding

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

使用bash将Hex转换为带符号的64位

在bash中,需要将E83E67529A1090E7转换为-1711817203884453657

以下不起作用:

$ printf "%d\n" "0xE83E67529A1090E7"
-bash: printf: warning: 0xE83E67529A1090E7: Numerical result out of range
9223372036854775807
Run Code Online (Sandbox Code Playgroud)

无符号和正符号值有效

$ printf "%d\n" "0x183E67529A1090E7"
1746947309936087271
$ printf "%u\n" "0xE83E67529A1090E7"
16734926869825097959
Run Code Online (Sandbox Code Playgroud)

但我特别需要一个失败的负面签名值.

bash printf

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

Google App Engine"manual_scaling"无效

目前,我的Google App Engine设计有一个前端通过URL提取与居民后端交谈.新设计将使用模块而不是后端.这是谷歌希望人们去的方向,所以这应该不难,但让它在生产中运行已经困扰了我好几天." manual_scaling "对我来说不起作用.dev_appserver.py(1.8.3)中的"manual_scaling"工作正常,但在生产中不起作用.我尽可能地简化了这个问题.这是一个应该复制问题的四个文件:

源代码

的app.yaml

api_version: 1
application: myapp
version: 123456
runtime: python27
threadsafe: true
handlers:
- url: /send_hello/.*
  script: send_hello.app
- url: /hello/.*
  script: hello.app
Run Code Online (Sandbox Code Playgroud)

hello.yaml

api_version: 1
application: myapp
module: hello
version: 123456
runtime: python27
threadsafe: true
#comment out these next two lines and it works!!!
manual_scaling:
  instances: 1
handlers:
- url: /_ah/start
  script: hello.app
- url: /hello/.*
  script: hello.app
Run Code Online (Sandbox Code Playgroud)

hello.py

import webapp2
import logging
from google.appengine.api import modules

class HelloHandler(webapp2.RequestHandler):
  def get(self):
      who …
Run Code Online (Sandbox Code Playgroud)

python linux google-app-engine

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

如何在Javascript中使用多态

大多数语言对类使用单继承.这样做的模式相当明显(例如在下面的Swift代码中).我仍然试图在JavaScript中围绕模式来创建对象层次结构并重用类函数和覆盖类函数

class animal {
    func talk() {
        print ("?")
    }
}

class bird : animal {
    override func talk() {
        print("tweet tweet")
    }
    func fly() {
        print("flap flap")
    }
}

class parrot : bird {
    override func talk() {
        print("polly want a cracker")
    }
}

var a = animal()
var b = bird()
var p = parrot()

a.talk()  /// ?
b.talk()  /// tweet tweet
b.fly()   /// flap flap
p.talk()  /// polly want a cracker
p.fly()   /// flap flap
Run Code Online (Sandbox Code Playgroud)

我认为我的问题是Javascript代码看起来不像这样.什么是等效的Javascript代码,所以我可以找出模式?

javascript polymorphism inheritance

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