问题标签 [httpfs]

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 投票
1 回答
34 浏览

hadoop - 什么是 HDFS 文件夹一分钟内数百个下载请求的最有效解决方案

在我的公司,我们有一个不断学习的过程。每 5-10 分钟我们在 HDFS 中创建一个新模型。模型是几个文件的文件夹:

  1. 型号~1G(二进制文件)
  2. 模型元数据 1K(文本文件)
  3. 模型特征 1K (csv 文件) ...

另一方面,我们有数百个模型服务实例,需要每 5-10 分钟将模型下载到本地文件系统并从中提供服务。目前,我们正在使用我们的服务(java FileSystem 客户端)中的 WebFS,但它可能会为我们的 Hadoop 集群创建负载,因为它将请求重定向到具体的数据节点。

我们考虑使用 HTTPFs 服务。它有缓存功能吗?那么第一个请求会得到一个文件夹来服务内存,而下一个请求会使用已经下载的结果吗?

还有哪些其他技术/解决方案可用于此类用例?

0 投票
1 回答
292 浏览

f# - F#- 使用 HttpFs.Client 和 Hopac:如何获取响应代码、响应标头和响应 cookie?

我将 F# 与 HttpFs.Client 和 Hopac 一起使用。

我可以使用以下代码获取 JSON/XML 响应的每个节点的响应正文和值:

但是如何获取响应代码、响应标头和响应 cookie?我需要在上面显示的相同方法中获取它,以便我也可以对这些项目进行断言。

我确实尝试过 response.StatusCode, response.Cookies.["cookie1"] 但是当我在响应后添加句点时没有出现这样的方法。

0 投票
1 回答
69 浏览

f# - F#- How can we validate the whole schema of API response using HttpFs.Client or Hopac?

I have a test where after getting a response I would like to validate the entire schema of the response (not individual response node/value comparison).

Sample test:

Is there a way that I can save my expected Schema somewhere and once I get the response I do the comparison to check that response has same number of nodes (neither less nor more than expected schema)?

I am ok to opt for other libs like FSharp.Data if we there is no direct way in HttpFs.Client. I looked at FSharp.Data (https://fsharp.github.io/FSharp.Data/library/JsonProvider.html) but not able to seek how it meets the requirements where the schema comparison needs to be done with the savedExpectedSchemaJson=ResponseJson.

0 投票
1 回答
104 浏览

f# - 带有 Http.fs 的 F# - 无法执行 GraphQL API

我没有看到任何关于如何使用 F# 和 Http.fs 执行 GraphQL API 的好的文档

如果您有正确的语法可用或指向相同的正确文档,请分享。我正在尝试使用此处给出的星球大战 API:https ://www.rithmschool.com/blog/an-introduction-to-graphql-queries

预期响应与:https ://swapi.graph.cool/

0 投票
1 回答
478 浏览

hadoop - WebHDFS FileNotFoundException rest api

我将这个问题发布为webhdfs rest api throwing file not found exception的延续

我有一个图像文件,我想通过 WebHDFS rest api 打开。

  1. 该文件存在于 hdfs 中并具有适当的权限
  2. 我可以 LISTSTATUS该文件并得到答案:

curl -i "http://namenode:50070/webhdfs/v1/tmp/file.png?op=LISTSTATUS"

  1. 所以 api 可以正确读取元数据,但我无法打开该文件:

curl -i "http://namenode:50070/webhdfs/v1/tmp/file.png?op=OPEN"

  1. 所以,根据webhdfs rest api throwing file not found exception,我可以看到请求是从 namenode 传递到 datanode1 的。Datanode1 在我的 hosts 文件中,我可以连接到它并从那里检查 webhdfs 的状态:

它是允许的,在名称节点上也是如此。

  1. 我还去查看了 hdfs 日志/var/log/hadoop/hdfs/*.{log,out},看看我是否可以发现我 curl 时触发的错误,但似乎什么也没发生。我没有看到与我的文件或 webhdfs 查询相关的条目。我在namenode和datanode1上试过了。

  2. 作为最后的努力,我试图将权限(不理想)从 644(见第 2 点)增加到 666

hdfs dfs -chmod 666 /tmp/file.png

curl -i "http://namenode:50070/webhdfs/v1/tmp/file.png?op=LISTSTATUS"

因此,似乎它确实进行了切换,但是在放宽我以前没有获得的当前权限时,不知何故我遇到了权限问题?这不像我删除了 X 标志,它一开始就不存在。access=READ_EXECUTE 是否需要 R 和 X?

现在我不知道为什么我可以看到但不能用 HDFS 读取这个文件。有人可以帮我解决这个问题吗?