我非常高兴HDInsight切换到Hadoop版本2,它通过YARN支持Apache Spark.对于我想要执行的任务,Apache Spark是一个比MapReduce更好的并行编程范例.
我无法找到任何关于如何将Apache Spark作业提交到我的HDInsight群集的文档.对于标准MapReduce作业的远程作业提交,我知道有几个REST端点,如Templeton和Oozie.但至于我能够找到的,通过Templeton无法运行Spark工作.我确实发现将Spark作业纳入Oozie是可能的,但我已经读到这是一件非常繁琐的事情,而且我已经阅读了一些工作失败检测报告在这种情况下不起作用.
可能必须有一种更合适的方式来提交Spark作业.有谁知道如何将Apache Spark作业的远程作业提交到HDInsight?
提前谢谢了!
我目前一直困在一个看起来很像这个问题的问题,但是问题的解决方案在我的情况下并不起作用.
我有一个tagx,其中我有一个iframe,我在其中使用jQuery将src属性设置为某个值,具体取决于所点击的超链接.标签由jspx文件嵌入,该文件主要由springform组成.一切都很好用,除了浏览器没有显示直接写在iframe下面的代码(在Firefox和Chrome中测试,对其他浏览器不确定).甚至没有显示在标签正下方的jspx中编写的代码(使用iframe嵌入标签).
containerCreator.jspx:
<div xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:roo="urn:jsptagdir:/WEB-INF/tags"
xmlns:olo_elem="urn:jsptagdir:/WEB-INF/tags/olo/admin/element"
xmlns:spring="http://www.springframework.org/tags"
id="elementen_base"
version="2.0">
<spring:url value="/admin/element/saveContainerElementBean" var="save"/>
<form:form action="${save}" method="POST" modelAttribute="containerElementBean">
<input type="submit" value="sla op"/>
<olo_elem:containerCreator path="${path}" containerId="${id}"/>
<p>I'm not visible</p>
</form:form>
</div>
Run Code Online (Sandbox Code Playgroud)
containerCreator.tagx:
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:form="http://www.springframework.org/tags/form"
xmlns:olo_elem="urn:jsptagdir:/WEB-INF/tags/olo/admin/element"
xmlns:spring="http://www.springframework.org/tags" version="2.0">
<jsp:directive.attribute name="containerId" type="java.lang.Long" required="false" description="id van de container die wordt bevat, null indien nog geen container is gebonden" />
<jsp:directive.attribute name="path" type="java.lang.String" required="false" description="pad waarin het id van een nieuw containerelement wordt gezet"/>
<spring:url value="/admin/element/editContainer/${containerId}" var="existingLink" />
<spring:url …Run Code Online (Sandbox Code Playgroud) 我有一个Array[Array[Float]]保证所有内部数组长度相同的.我想在所有内部数组上执行元素加法.
让我用一个具体的例子说明这一点.假设我的Array包含三个由七个Floats组成的Arrays,其值如下:
Array[Array[Float]] = Array(
Array(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0),
Array(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0),
Array(0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0)
)
Run Code Online (Sandbox Code Playgroud)
现在我想将其转换为大小为7的数组,其中第n个元素是我输入中第n个元素的总和Array.对于我的示例输入,输出将是:
Array[Float] = Array(1.0, 3.0, 3.0, 5.0, 5.0, 7.0, 7.0)
Run Code Online (Sandbox Code Playgroud)
为了在两个Array[Float]人身上执行此操作,我知道我可以压缩它们然后添加带有地图的元素.然而,我仍然在努力寻找能够将任意数量Array[Float]的元素相加的更通用的解决方案.
任何帮助将非常感激!
我正在使用JFreeChart使用折线图绘制两个数据系列(XYSeries).复杂因素是其中一个数据系列的y值通常远高于我的第二个数据系列的y值(假设第一个系列的y值大小为数百万的数量级,而第二系列具有数百个数量级的y值.我的第一个数据集中存在高值会导致绘图的范围使得我的第二个数据集的y值不再可理解.
在绘图中添加第二个y轴,这样我的数据系列都使用自己的y轴,可以解决这个问题.有谁知道如何用JFreeChart做到这一点?
当前完整性代码:
XYSeriesCollection dataset = new XYSeriesCollection();
XYSeries series1 = new XYSeries("series1");
XYSeries series2 = new XYSeries("series2");
// Here is my code to fill series1 and series2 with data
dataset.addSeries(series1);
dataset.addSeries(series2);
JFreeChart chart = ChartFactory.createXYLineChart(
"title", "x-axis title", "y-axis title", dataset, PlotOrientation.VERTICAL, true, true, false
);
chart.getXYPlot().setRenderer(new XYSplineRenderer());
Run Code Online (Sandbox Code Playgroud) 让我们考虑包含在R中的aplpack库中的bagplot示例 .Backplot是一个boxplot的双变量概括,因此可以深入了解两个轴中数据点的分布.
包袋示例:

示例代码:
# example of Rousseeuw et al., see R-package rpart
cardata <- structure(as.integer( c(2560,2345,1845,2260,2440,
2285, 2275, 2350, 2295, 1900, 2390, 2075, 2330, 3320, 2885,
3310, 2695, 2170, 2710, 2775, 2840, 2485, 2670, 2640, 2655,
3065, 2750, 2920, 2780, 2745, 3110, 2920, 2645, 2575, 2935,
2920, 2985, 3265, 2880, 2975, 3450, 3145, 3190, 3610, 2885,
3480, 3200, 2765, 3220, 3480, 3325, 3855, 3850, 3195, 3735,
3665, 3735, 3415, 3185, 3690, 97, 114, 81, 91, 113, 97, 97, …Run Code Online (Sandbox Code Playgroud) 在为Web应用程序编写selenium测试用例时,我遇到了xpath选择器的问题.Selenium应该点击的HTML代码元素如下:
<a title="Voeg een vak toe" href="#" onclick="javascript:$.colorbox({width:818,href:'/olo-cleanjump/profiel/addVakForm'}); return false;">
<p class="add">
<img class="add-icon" src="/olo-cleanjump/static/images/icon_add.png"/>
Voeg vak toe
</p>
</a>
Run Code Online (Sandbox Code Playgroud)
firefox的Selenium IDE插件为我提供了以下selenium代码:
driver.findElement(By.cssSelector("p.add")).click();
Run Code Online (Sandbox Code Playgroud)
这个链接调用的addVakForm javascript函数打开一个带有以下HTML的颜色框(我缩短了它,里面有大约30个类似div,类为"lesboek_popup")里面:
<div id="cboxLoadedContent" style="display: block; width: 776px; overflow: auto; height: 653px;">
<div id="profielpagina_add">
<h2>Voeg een vak toe aan je profiel</h2>
<div class="lesboek_popup">
<a class="content" href="/olo-cleanjump/profiel/addvak/120776">
<img src="" alt="">
</a>
<p class="caption">
<a href="/olo-cleanjump/profiel/addvak/120776">Engels</a>
</p>
</div>
<div class="lesboek_popup">
<a class="content" href="/olo-cleanjump/profiel/addvak/120786">
<img src="" alt="">
</a>
<p class="caption">
<a href="/olo-cleanjump/profiel/addvak/120786">Biologie</a>
</p>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
为了测试我想打开'Biologie'链接.Selenium IDE为我提供了以下selenium代码
driver.findElement(By.xpath("//div[@id='profielpagina_add']/div[20]/a")).click();
Run Code Online (Sandbox Code Playgroud)
选择这个生物学链接元素.基于此,我编写了以下测试用例:
Test …Run Code Online (Sandbox Code Playgroud)