问题标签 [spring-data-hadoop]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
376 浏览

hadoop2 - 自定义纱线容器

我正在测试 spring-yarn 集成 API,我对 Yarn 容器定制的最佳实践有点困惑:

1)如果我想使用spring-boot-yarn组合,告诉spring boot选择我的纱线容器实现而不是DefaultYarnContainer的正确方法是什么......我想出的唯一方法是通过容器上的ImportResource注释包含 main 方法的项目类,该方法指向带有声明的 spring 应用程序 xml:

组件扫描根本不起作用...Spring boot 仍在使用 DefaultYarnContainer...

2)如果我正确理解 Yarn 架构,那么应用程序大师负责启动容器。但是如果我为我的实现更改 DefaultYarnContainer ,那么我需要通过 run 方法手动启动容器,什么都没有启动,请问正确的方法是什么?

非常感谢您的帮助

0 投票
1 回答
141 浏览

hbase - Spring Data Hadoop 和 Hbase 1+

最近,hbase 发布了hbase 1.2,并且在hbase 1.0.0+中修复了大量的错误,我想知道 Spring 是否会升级以使用新的 API。

0 投票
1 回答
156 浏览

spring-boot - Spring boot AMQP 和 Spring Hadoop 一起最终缺少 EmbeddedServletContainerFactory bean

我有两个小应用程序,一个用途spring-boot-starter-amqp,其他用途spring-data-hadoop-boot。我可以单独运行它们而没有任何问题。

当我将它们连接在一起时,应用程序启动失败并出现异常:org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

我的主要课程非常通用,并且分别适用于它们:

我在这里迷路了。AFAIK@SpringBootApplication包含所需的所有注释,包括自动配置和组件扫描。我不需要配置 Web 环境,因为我没有使用它。当两个依赖项都在类路径中时,为什么我需要这样做,我该如何解决?

更新

我在 Spring Boot 代码中挖了一点。主要问题是SpringApplication.deduceWebEnvironment()根据类路径中某些类的存在自动检测应该配置什么样的环境。

对于 web 环境,正在检查两个类。当它们都在类路径中时,显然会检测到需要正确配置的 Web 环境。

  • javax.servlet.Servlet
  • org.springframework.web.context.ConfigurableWebApplicationContext

spring-boot-starter-amqp:1.3.1.RELEASEcontainsConfigurableWebApplicationContextspring-data-hadoop-boot:2.3.0.RELEASE-cdh5contains Servlet(在本机 Hadoop 库中)。

现在,当单独运行时,在这两种情况下都缺少上述类之一,从而导致未设置 Web 环境。

但是当我同时使用它们时 - 两个类都可以找到。检测到 Web 环境,误报,它需要配置,我无法(也不想)提供。

所以现在的问题是 - 我可以强制非 Web 环境,即使我在类路径中有这些类?或者有没有其他方法可以解决这个问题?(除了将它们从 Gradle 依赖项中排除)

0 投票
1 回答
98 浏览

spring - 如何使用spring数据设置hadoop分布式缓存

我是 spring 数据的新手,并试图通过分布式缓存分发所有 spring 数据依赖项。但它不起作用,也没有找到有用的资源。

我在application-context.xml 中的配置:-

我正在尝试将 spring-data-hadoop jar 分发到每个节点。但到目前为止,它不起作用。有办法吗?任何帮助将不胜感激

0 投票
1 回答
589 浏览

spring - 如何使用spring数据模拟hdfs操作

我是 spring data-hadoop 的新手,想问一个一般性问题。我有不同格式的文件,想用 Apache Tika 提取有用的内容,并将其作为文本文件存储在 HDFS 中。我已经浏览了 spring data-hadoop 的参考文档(http://docs.spring.io/spring-hadoop/docs/2.0.0.RELEASE/reference/html/store.html)但不明白如何去做吧。而且我没有找到任何其他有用的资源。

是否有使用 spring data-hadoop 将数据写入 HDFS 的示例项目或来源?

0 投票
2 回答
58 浏览

spring - 执行spring bean时的问题

我有一个名为 textFileWriter 的 bean,用于将字符串实体写入 HDFS。我已经在 bean 配置文件中配置了 spring bean。执行时出现 NullPointerException。请帮助我。

我的bean配置:-

主要课程:-

在这一行中出现空指针异常:-

0 投票
1 回答
1744 浏览

spring - 使用 spring data hadoop 写入 HDFS 时出现问题

我试图使用 spring data hadoop 向 HDFS 写一个简单的文本。但我在写作时遇到了一个未知问题。

线程“主”org.springframework.data.hadoop.store.StoreException 中的异常:存储输出上下文尚未初始化;嵌套异常是 java.io.IOException: Unexpected HTTP response: code=404 != 200, op=GETFILESTATUS, message=Not Found at org.springframework.data.hadoop.store.support.OutputStoreObjectSupport.getOutputContext(OutputStoreObjectSupport.java:135 ) 在 org.springframework.data.hadoop.store.output.TextFileWriter.write(TextFileWriter.java:132) 在 org.springframework.data.hadoop.store.output.AbstractDataStreamWriter.getOutput(AbstractDataStreamWriter.java:131) 在 com。 com.mstack.app.MainApp.main(MainApp.java:32) 处的 mstack.app.MainApp.someMethod(MainApp.java:37) 原因:java.io.IOException:意外的 HTTP 响应:code=404 != 200 , op=GETFILESTATUS, message=在 org.apache 上找不到。

我的 application-context.xml :-

主要课程:-

任何帮助,将不胜感激 !谢谢

0 投票
1 回答
1994 浏览

java - Spring Hadoop 配置 - 没有 org.apache.hadoop.conf.Configuration 类型的合格 bean

我正在尝试为 Hadoop/Hive 环境配置 bean。根据文档,我需要 Apache Hadoop 配置类,它应该是自动装配的。请参阅:http ://docs.spring.io/spring-hadoop/docs/2.4.0.RELEASE/reference/html/springandhadoop-store.html (第 6.2.2 节配置数据集支持)

然而,当我尝试运行我的应用程序时,我得到:NoSuchBeanDefinitionException: No qualifying bean of type [org.apache.hadoop.conf.Configuration] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.

我的课很简单:

我正在使用 Cloudera 集群,这里是依赖项:

现在,我可能错了,但我记得过去我使用过自动装配配置,而且效果很好。最新版本有什么变化吗?我错过了什么吗?

0 投票
0 回答
133 浏览

java - 使用 spring data hadoop 修复 Avro 文件名

我的目标是在 HDFS 上写一个目录。为此,我使用:

  • spring-data-hadoop:2.4.0.RELEASE
  • spring-data-hadoop-store:2.4.0.RELEASE

在我的配置类中,我定义了一个 bean

在我的服务中,我可以使用这个 bean 来写我想要的:

它工作正常,在 HDFS 上我有一个 avro 文件。名称已生成,但我找不到在其上应用文件名策略的解决方案。

我怎样才能修复名称或获取 bean?

0 投票
2 回答
7041 浏览

java - How to submit multiple Spark applications in parallel without spawning separate JVMs?

The problem is that you need to launch separate JVM to create separate session with different number of RAM per job.

How to submit few Spark applications simultaneously without manually spawning separate JVMs?

My app is run on single server, within single JVM. That appears a problem with Spark session per JVM paradigm. Spark paradigm says:

I'd like to have different configurations per Spark application without launching extra JVMs manually. Configurations:

  1. spark.executor.cores
  2. spark.executor.memory
  3. spark.dynamicAllocation.maxExecutors
  4. spark.default.parallelism

Usecase

You have started long running job, say 4-5 hours to complete. The job is run within a session with configs spark.executor.memory=28GB, spark.executor.cores=2. Now you want to launch 5-10 seconds job on user demand, without waiting 4-5 hours. This tinny job need 1GB of RAM. What would you do? Submit tinny job from behalf of long-running-job-session? Than it will claim 28GB ((

What I've found

  1. Spark allow you to configure number of CPU and executors only on the session level. Spark scheduling pool allow you to slide and dice only number of cores, not a RAM or executors, right?
  2. Spark Job Server. But they does't support Spark newer than 2.0, not an option for me. But they actually solve the problem for versions older than 2.0. In Spark JobServer features they said Separate JVM per SparkContext for isolation (EXPERIMENTAL), which means spawn new JVM per context
  3. Mesos fine-grained mode is deprecated
  4. This hack, but it's too risky to use it in production.
  5. Hidden Apache Spark REST API for job submission, read this and this. There is definitely way to specify executor memory and cores there, but still what is the behavior on submitting two jobs with different configs? As I understand this is Java REST client for it.
  6. Livy. Not familiar with it, but looks they have Java API only for batch submission, which is not an option for me.