小编sag*_*sag的帖子

从特定步骤重建docker图像

我有下面的Dockerfile.

FROM ubuntu:14.04
MAINTAINER Samuel Alexander <samuel@alexander.com>

RUN apt-get -y install software-properties-common
RUN apt-get -y update

# Install Java.
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
RUN add-apt-repository -y ppa:webupd8team/java
RUN apt-get -y update
RUN apt-get install -y oracle-java8-installer
RUN rm -rf /var/lib/apt/lists/*
RUN rm -rf /var/cache/oracle-jdk8-installer

# Define working directory.
WORKDIR /work

# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle

# JAVA PATH
ENV PATH /usr/lib/jvm/java-8-oracle/bin:$PATH

# Install maven
RUN apt-get -y update
RUN apt-get -y install …
Run Code Online (Sandbox Code Playgroud)

docker dockerfile

43
推荐指数
6
解决办法
2万
查看次数

如何找到RDD的大小

我有RDD[Row],需要持久保存到第三方存储库.但是这个第三方存储库在一次调用中最多接受5 MB.

所以我想根据RDD中存在的数据大小创建分区,而不是基于RDD中存在的行数.

如何找到a的大小RDD并根据它创建分区?

apache-spark apache-spark-sql

23
推荐指数
3
解决办法
4万
查看次数

齐柏林飞艇的Hello世界失败了

我刚刚安装了apache zeppelin(从git repo的最新源代码构建)并成功地看到它在端口10008中启动并运行.我用一行代码创建了一个新的笔记本

val a = "Hello World!"
Run Code Online (Sandbox Code Playgroud)

并运行此段并看到以下错误

java.net.ConnectException:连接被拒绝在java.net.PlainSocketImpl.socketConnect(本机方法)在java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)在java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)在java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)在java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)在java.net.Socket.connect(Socket.java:589)在org.apache. thrift.transport.TSocket.open(TSocket.java:182)在org.apache.zeppelin.interpreter.remote.ClientFactory.create(ClientFactory.java:51)在org.apache.zeppelin.interpreter.remote.ClientFactory.create( ClientFactory.java:37)位于org.apache.commons.pool2.impl的org.apache.commons.pool2.BasePooledObjectFactory.makeObject(BasePooledObjectFactory.java:60).GenericObjectPool.create(GenericObjectPool.java:861)在org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435)在org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java: 363)在org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.getClient(RemoteInterpreterProcess.java:139)在org.apache.zeppelin.interpreter.remote.RemoteInterpreter.init(RemoteInterpreter.java:137)在org.apache.zeppelin位于org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java)的org.apache.zeppelin.interpreter.LazyOpenInterpreter.getFormType(LazyOpenInterpreter.java:104)中的.interpreter.remote.RemoteInterpreter.getFormType(RemoteInterpreter.java:257) :197)org.apache.zeppelin.scheduler.Job.run(Job.java:170)at org.apache.zeppelin.scheduler.RemoteScheduler $ JobRunner.运行(RemoteScheduler.java:304)在java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)在java.util.concurrent.FutureTask.run(FutureTask.java:266)在java.util.concurrent中.ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 201(ScheduledThreadPoolExecutor.java:180)java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745)ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 201(ScheduledThreadPoolExecutor.java:180)java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 201(ScheduledThreadPoolExecutor.java:180)java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745

任何线索?

我的后端是火花1.5,我通过解释器的网络界面验证,齐柏林飞艇指向正确版本的火花并适应spark.home.

apache-spark apache-zeppelin

12
推荐指数
2
解决办法
2万
查看次数

Jenkins使用Google Cloud Source Repository

我正在尝试使用Jenkins进行CI/CD.我开发了一个Python烧瓶应用程序.我正在将此应用程序部署到Google App Engine中.到目前为止,我正在使用gcloud app deploy app.yaml命令将应用程序部署到Google App Engine.

此应用程序的代码存在于Google Cloud Source Repository中.

由于对git(Google Cloud Source Repository)的身份验证需要Google OAuth,因此我安装了Google OAuth凭据插件

现在我面临两个问题

  1. 当我使用"元数据中的Google服务帐户"凭据类型时,我没有看到"源代码管理"中列出的凭据. 见截图
  2. 当我使用"私钥中的Google服务帐户"时,我可以看到凭据.但是,当我运行我的jenkins工作时,我遇到了错误

致命:无法调用com.google.jenkins.plugins.source.GoogleRobotUsernamePassword.writeObject():无法序列化com.google.jenkins.plugins.source类的com.google.jenkins.plugins.source.GoogleRobotUsernamePasswordModule $ ForRemote#凭据.GoogleRobotUsernamePasswordModule $ ForRemote ----调试信息----消息:无法调用com.google.jenkins.plugins.source.GoogleRobotUsernamePassword.writeObject()cause-exception:java.lang.RuntimeException cause-message:序列化失败com.google.jenkins.plugins.source.GoogleRobotUsernamePasswordModule $ ForRemote类com.google.jenkins.plugins.source.GoogleRobotUsernamePasswordModule的凭据$ ForRemote -------------------- ----------- java.lang.UnsupportedOperationException:出于安全原因拒绝编组org.joda.time.DateTime; 请参阅 https://jenkins.io/redirect/class-filter/ at hudson.util.XStream2 $ BlacklistedTypesConverter.marshal(XStream2.java:543)at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69 )com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)at com.thoughtworks.xstream.core.AbstractReferenceMarshaller $ 1.convertAnother(AbstractReferenceMarshaller.java:84)

问题:如何在Jenkins中验证Google Cloud Source存储库?在Jenkins中使用Google Cloud Source存储库需要哪些步骤?插件?

google-app-engine jenkins google-cloud-platform google-cloud-source-repos

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

哪个是高效的,Dataframe或RDD还是hiveql?

我是Apache Spark的新手.

我的工作是读取两个CSV文件,从中选择一些特定列,合并,聚合并将结果写入单个CSV文件.

例如,

CSV1

name,age,deparment_id
Run Code Online (Sandbox Code Playgroud)

CSV2

department_id,deparment_name,location
Run Code Online (Sandbox Code Playgroud)

我想获得第三个CSV文件

name,age,deparment_name
Run Code Online (Sandbox Code Playgroud)

我正在将CSV加载到数据帧中.然后能够使用join,select,filter,drop数据帧中存在的几种方法获得第三个数据帧

我也可以用几个来做同样的事情 RDD.map()

我也可以通过执行hiveql使用来做同样的事情HiveContext

我想知道如果我的CSV文件很大,哪个是有效的方法?为什么?

apache-spark apache-spark-sql spark-dataframe

9
推荐指数
2
解决办法
5631
查看次数

如何从Shiny App中访问浏览器会话/ cookie

如何从Shiny应用程序中访问cookie和其他与浏览器相关的会话数据?

使用session $ clientData,我们可以获得其他客户端详细信息,如主机,端口,查询参数...

有没有其他方法可以在闪亮的应用程序中获取cookie?

cookies r shiny

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

在Unirest中获取本机REST服务错误

我们使用Unirest作为REST客户端.下面是我们调用REST服务的示例代码

HttpResponse<JsonNode> response = Unirest
  .post(url)
  .header(HEADER_CONTENT_TYPE, HEADER_VALUE_APPLICATON_JSON)
  .body(payload)
  .asJson();
Run Code Online (Sandbox Code Playgroud)

当REST服务返回json时,这是绝对的.如果出现错误,我使用的REST服务不会返回json响应.相反,它返回html错误页面.

由于Unirest试图将html转换为json,因此遇到以下问题

Caused by: com.mashape.unirest.http.exceptions.UnirestException: java.lang.RuntimeException: java.lang.RuntimeException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1]
    at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:143)
    at com.mashape.unirest.request.BaseRequest.asJson(BaseRequest.java:68)
Run Code Online (Sandbox Code Playgroud)

在这种情况下,我们只是得到这个InvalidJsonException并且实际的html错误页面丢失了.我们需要在出现错误时在我们的应用程序中显示html错误页面.

在这种情况下,我们如何才能获得原始的REST服务错误?

java json unirest mashape

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

如何从元数据中找到OData版本

我可以访问OData服务.现在我需要找到该服务的OData版本.$ metadata中有版本属性.但我不知道要哪一个拿起.

我需要把它从<edmx:Edmx Version="1.0">DataServiceVersionHTTP标头

例如,

  1. http://services.odata.org/v4/%28S%28cy2mvwlr34teasunjfqlhlyg%29%29/TripPinServiceRW/ $ metadata将Version作为4.0返回,但在响应中不包含DataServiceVersion.但它有OData Version HTTP标头

  2. http://services.odata.org/OData/OData.svc/ $ metadata将Version返回1.0,DataServiceVersion返回3.0.这不包含OData版本HTTP标头.但它有DataServiceVersion HTTP标头

  3. http://services.odata.org/V3/Northwind/Northwind.svc/ $ metadata将Version返回1.0,DataServiceVersion返回1.0.这不包含OData版本HTTP标头.但它有DataServiceVersion HTTP标头

请告诉我如何使用服务元数据找到OData版本?或者还有其他方法可以找到它吗?

rest odata

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

获取矩阵的最后一个元素

考虑我有以下矩阵

M <- matrix(1:9, 3, 3)
M
#      [,1] [,2] [,3]
# [1,]    1    4    7
# [2,]    2    5    8
# [3,]    3    6    9
Run Code Online (Sandbox Code Playgroud)

我只是想找到最后一个元素即 M[3, 3]

由于此矩阵列和行大小是动态的,我们无法对其进行硬编码 M[3, 3]

如何获得最后一个元素的值?

目前我已经完成了以下代码

M[nrow(M), ncol(M)]
# [1] 9
Run Code Online (Sandbox Code Playgroud)

有没有更好的方法呢?

r matrix

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

TableauSDK代理设置

我们使用TableauSDK(Java)将数据提取发布到Tableau Server.

我们与Tableau服务器的连接是通过代理.因此,我们刚刚设置的Java系统属性https.proxyHost,https.proxyPort,http.proxyHosthttp.proxyPort.

但似乎在上面的java系统属性中完成的代理设置没有生效.请帮助我们在TableauSDK(Java)中配置代理设置

java proxy tableau-api tableau-server

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