【问题标题】:memcache and a custom DoFn with dataflow内存缓存和带有数据流的自定义 DoFn
【发布时间】:2015-01-26 17:38:54
【问题描述】:

我正在尝试将 google memcache 与数据流一起使用。我本质上想将数据转换为内存缓存。是否可以在数据流中使用 google memcache api?

我收到以下错误: java.util.concurrent.ExecutionException: com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'memcache' or call 'Set()' was not found. com.google.appengine.api.utils.FutureWrapper.setExceptionResult(FutureWrapper.java:65)

这是代码行:

AsyncMemcacheService asyncCache =     MemcacheServiceFactory.getAsyncMemcacheService("namespace");
asyncCache.put("key", "value", Expiration.byDeltaSeconds(100000)).get();

【问题讨论】:

  • 您是否尝试使用 appengine 库?这似乎有问题,因为 Appengine 运行时在 Dataflow 中不可用。

标签: google-app-engine google-cloud-dataflow


【解决方案1】:

我认为memcache 是 App Engine 的一部分,不能在 App Engine 之外直接访问。因此,您将无法直接从 Dataflow 访问它。您可以做的是创建一个充当代理的 App Engine 服务并从 Dataflow 向该服务发送请求。

【讨论】:

  • 这很有趣,因为 Dataflow FAQ 提到数据流是在管道之间共享数据的一种选择 :-)
  • Memcache 现在可通过 GAE RemoteAPI 在数据流中使用。
猜你喜欢
  • 2012-08-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-08-29
  • 2011-07-08
  • 1970-01-01
  • 2014-12-23
相关资源
最近更新 更多