内存缓存和带有数据流的自定义DoFn

时间:2015-01-26 17:38:55

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

我正在尝试将google memcache与数据流一起使用。我想基本上喜欢将数据转换为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();

1 个答案:

答案 0 :(得分:1)

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