Google App Engine中的Blobstore对象的1MB配额限制? [英] 1MB quota limit for a blobstore object in Google App Engine?

查看:119
本文介绍了Google App Engine中的Blobstore对象的1MB配额限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 App Engine(版本1.4.3)直接编写blobstore 以保存图像。
当我尝试存储大于1MB的图片时我收到以下异常

I'm using App Engine (version 1.4.3) direct write the blobstore in order to save images. when I try to store an image which is larger than 1MB I get the following Exception

com.google.apphosting.api.ApiProxy$RequestTooLargeException: The request to API call datastore_v3.Put() was too large.

我认为每个对象的限制为2GB

这里是存储Java代码图像

Here is the Java code that stores the image

private void putInBlobStore(final String mimeType, final byte[] data) throws IOException {
    final FileService fileService = FileServiceFactory.getFileService();
    final AppEngineFile file = fileService.createNewBlobFile(mimeType);
    final FileWriteChannel writeChannel = fileService.openWriteChannel(file, true);
    writeChannel.write(ByteBuffer.wrap(data));
    writeChannel.closeFinally();
}


推荐答案

最大对象大小为2 GB,但每个API调用最多只能处理1 MB。至少对于阅读而言,但我认为写作可能是一样的。所以你可能会试图将你写入的对象分成1 MB大块,看看是否有帮助。

The maximum object size is 2 GB but each API call can only handle a maximum of 1 MB. At least for reading, but I assume it may be the same for writing. So you might try to split your writing of the object into 1 MB chunks and see if that helps.

这篇关于Google App Engine中的Blobstore对象的1MB配额限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆