草庐IT

hadoop map-reduce : how to deploy non-jar files

coder 2024-01-07 原文

您好,当我使用 hadoop jar ..args.. 提交我的 jar 以进行 map-reduce 作业时,我想知道如何部署非 jar 文件。

对于 hadoop 流,有 --file 选项来发送文件,对于 spark,我们有 --files 但我在文档中找不到这样的选项。

在提交 hadoop map-reduce 作业时,是否可以将非 jar 文件与我的 jar 一起发送?

最佳答案

Applications can specify a comma separated list of paths which would be present in the current working directory of the task using the option -files

The -libjars option allows applications to add jars to the classpaths of the maps and reduces. The option -archives allows them to pass comma separated list of archives as arguments. These archives are unarchived and a link with name of the archive is created in the current working directory of tasks. More details about the command line options are available at Commands Guide.

Running wordcount example with -libjars, -files and -archives: hadoop jar hadoop-examples.jar wordcount -files cachefile.txt -libjars mylib.jar -archives myarchive.zip input output Here, myarchive.zip will be placed and unzipped into a directory by the name "myarchive.zip".

Users can specify a different symbolic name for files and archives passed through -files and -archives option, using #.

For example, hadoop jar hadoop-examples.jar wordcount -files dir1/dict.txt#dict1,dir2/dict.txt#dict2 -archives mytar.tgz#tgzdir input output Here, the files dir1/dict.txt and dir2/dict.txt can be accessed by tasks using the symbolic names dict1 and dict2 respectively. The archive mytar.tgz will be placed and unarchived into a directory by the name "tgzdir".

关于hadoop map-reduce : how to deploy non-jar files,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38363700/

有关hadoop map-reduce : how to deploy non-jar files的更多相关文章

  1. ruby - 用 map reduce 解决一个问题 - 2

    我想在ruby​​中模拟我对像hadoop这样的系统的map和reduce函数的实现,以验证这个想法至少有效。我有以下问题。我有两个元素列表:List13-A4-B5-C7-D8-FList22-A8-B6-C9-D4-E我需要构建一个公共(public)列表,其中包括与两个列表中公共(public)字母关联的数字总和:commonList5-A12-B11-C16-D我想用map和reduce操作制作一个ruby​​脚本来解决这个问题。我不确定如何解决这个问题或在ruby​​脚本中模拟这个问题要遵循什么程序。感谢任何帮助。 最佳答案

  2. ruby - inject 和 ruby​​ 中的 reduce 是一样的吗? - 2

    我看到他们一起记录了here.它们是一样的吗?为什么Ruby有那么多别名(比如数组的map/collect)?非常感谢。 最佳答案 是的,它在许多其他编程语言和数学中也被称为fold。为了让具有不同背景的程序员更直观,Ruby有很多别名。如果您想在数组上使用#length,您可以。如果你想使用#size,那也没关系! 关于ruby-inject和ruby​​中的reduce是一样的吗?,我们在StackOverflow上找到一个类似的问题: https://s

  3. javascript - 如何在 JavaScript 中使用 reduce 而不是 for 循环构建 contains 函数? - 2

    我想这是两个问题。我仍然在使用reduce方法时遇到问题,我得到了使用它的简单方法reduce([1,2,3],函数(a,b){返回a+b;},0);//6将它与数字以外的任何东西一起使用真的让我感到困惑。那么我如何使用reduce代替for循环来构建一个包含函数呢?评论将不胜感激。谢谢大家。functioncontains(collection,target){for(vari=0;i 最佳答案 这是你需要的:functioncontains(collection,target){returncollection.reduce(f

  4. javascript - 在不制作副本的情况下替换 react redux reducer 中的新状态 - 2

    如果我已经完全替换了状态的一部分,我是否仍然需要使用Object.assign或扩展运算符来复制原始状态并将其替换为新状态,或者我可以直接返回我的reducer中的新状态?constfetching=(state={isFetching:false},action)=>{switch(action.type){case'REQUESTING':returnObject.assign({},state,{isFetching:true})case'RECEIVE_POKEMON_TYPE_INFO':returnObject.assign({},state,{isFetching:fal

  5. javascript - 重组 "withReducer": justification of async reducer function call - 2

    我正在使用withReducerHOC并注意到这种行为:例如,在点击处理程序上调用它:importReactfrom'react'import{withReducer}from'recompose'import{compose}from'ramda'exportdefaultcompose(withReducer('state','dispatch',(state,{value})=>{console.log(value)return{...state,value}},{value:'zero'}))((props)=>{const{dispatch,state}=props,onCl

  6. javascript - React/Redux reducer 在初始化期间返回 undefined - 2

    我正在开发我的第一个React/Redux项目。一切顺利,然后我尝试创建一个新的reducer。我认为这是一个非常简单的方法,但是当我加载页面时出现错误“ReducerX在初始化期间返回未定义”。跟踪表明这是在combineReducers()中发生的。我发现了几个类似的问题,但没有解决问题。关于这个问题:WhydoIget“Reducer[...]returnedundefinedduringinitialization”despiteprovidinginitialStatetocreateStore()?问题是他们在createStore()中使用了initialState,而我

  7. javascript - 使用 javascript array.reduce 删除重复项 - 2

    我是javascript的新手,我自己从网络教程中学习它时遇到了一些挑战。请帮助我解决以下问题。问题:编写一个函数,它接受两个或多个数组,并按照原始提供的数组的顺序返回一个新的唯一值数组。换句话说,所有数组中出现的所有值都应按其原始顺序包含,但最终数组中没有重复项。唯一数字应按其原始顺序排序,但最终数组不应按数字顺序排序。只使用Array.reduce来解决这个问题!您的解决方案应如下所示:functionunite(arr1,arr2,arr3){returnarr1;}unite([1,2,3],[5,2,1,4],[2,1]);我无法理解如何在这里使用reduce。与此相比,所有

  8. javascript - 如何在 Indesign 脚本中使用 Array.reduce() 等高阶函数? - 2

    我已经开始了一个项目,我需要使用Adob​​eIndesign和ExtendScript以编程方式从一系列INDD文件中提取一些数据。在这些程序中用于编写脚本的Javascript版本不支持我习惯使用的任何高阶函数(Array.reduce()、Array.forEach()、Array.map()等...)。有没有办法将此功能添加到ExtendScript中?我觉得我在一个四英尺高的天花板的房间里走来走去。 最佳答案 使用PolyfillExtendScript似乎支持纯Javascript对象的原型(prototype)设计(但

  9. javascript - Angular .js : How to reduce font size dynamically based on characters' length? - 2

    我正在使用以下代码动态显示名称:{{profile.name}}屏幕尺寸始终为320px如果名称很短,它可以正常工作,但如果名称很长,那么名称就会分成两行,这会扰乱我的布局。所以我想在名称变得太长时自动减小字体大小......那么有什么方法可以查看div的内容并根据字符长度动态应用不同的字体大小吗? 最佳答案 使用ng-class当name很长时将一个类附加到元素20),'verylong':(profile.name.length>40)}">{{profile.name}}然后使用该类在您的CSS中更改字体大小。

  10. javascript - Lodash 与 JavaScript 内置的 map、reduce、filter - 2

    我想知道为这3个函数[map(),reduce(),filter()包含Lodash是否更好]或者只是使用它们的ES6版本。我更喜欢使用Lodash函数,它对我的​​用例来说更简单一些。但是,我知道使用ES6函数可能会带来性能优势。还想知道Lodash是否比ES6更向后兼容?关于如何测试我的实现性能的建议?关于继续使用Lodash还是使用ES6的建议? 最佳答案 Lodash是一个很好的工具,如果你有更复杂的算法,它更易读等。它内置了很多任务的函数,这些任务在原生ES6中实现起来并不那么容易,它真的很方便并且可以让你免于头痛。但是对

随机推荐