English 中文(简体)
Java Hadoop:是否可以只读一卷内容?
原标题:Java Hadoop: is it possible to read the contents of a file only once?
  • 时间:2012-05-04 20:08:33
  •  标签:
  • java
  • hadoop

我有一份档案,其中我储存一些数据,这些数据应当由每个制图员用于某些计算。

我知道如何读到档案中的数据,这可以在地图仪功能中进行,然而,这一数据对于每个地图绘制者来说都是一样的,因此,我想在制图过程之前将数据储存在某个地方(可变),然后使用地图仪中的内容。

如果我在地图功能中这样做,例如有一份包含10条线的文件作为投入,那么地图功能就会被称作10次,正确吗? 因此,如果我阅读地图功能中的档案内容,我将读10次,没有必要。

预先感谢

最佳回答

由于你们的许多制图员都在不同的证书(可能还有不同机器)内操作,因此,在将数据提交给Hadoop之前,你不能在申请中阅读。 然而,您可使用Distributed Cache 至“Distribute application-specific large, Read- only file effectively”

根据这一联系:“效率产生于以下事实:档案只每一份工作复印一次,而且能够保存在奴隶制度上没有档案的档案。

问题回答

如果我理解正确的话,你只想把1项功能放在档案中读到所有线。 假设是,我在此就这样认为。

The mapper allows you to read 1 line at a time for safety sake so that you can control how many lines of input to read. And this takes a certain amount of memory. For one example, what if the file is large like 1GB size. Are you willing to read all the contents? This will take up a considerable amount of memory and have impact on the performance. This is the safety aspect that I mentioned earlier.

My conclusion is that there is no Mapper function that reads all the contents of a file. Do you agree?





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签