1
我想下载数量有限的应用引擎实体,比方说只有500个。是否可以通过Python bulkloader API来实现?App Engine下载数量有限的实体
我想下载数量有限的应用引擎实体,比方说只有500个。是否可以通过Python bulkloader API来实现?App Engine下载数量有限的实体
AFAIK bulkloader API旨在获取给定Kind的所有实体或所有实体。
如果你想下载500个具体的实体,您可以依赖远程API作为this article
调试转变故障描述remotly访问数据存储,而无需下载所有的实体是非常有用的。以下是我对基于1.6.4 SDK的散装加载程序的修改:
diff -r 1/google/appengine/tools/appcfg.py 2/google/appengine/tools/appcfg.py 3562a3563 > 'limit', 3667a3669,3671 > parser.add_option('--limit', type='int', dest='limit', > action='store', default=None, > help='Number of records to download (for debugging).') diff -r 1/google/appengine/tools/bulkloader.py 2/google/appengine/tools/bulkloader.py 1252c1252,1253 throttle_class=None, > limit=None): 1285a1287,1289 > if limit != None: > logger.info("Aborting download after downloading %s entities" % limit) > self.limit_cnt = limit 1424a1429,1432 > if self.limit_cnt and self.limit_cnt <= 0: > logger.info("Reached limit, abort downloading more entities") > return [] > 1429a1438 > self.limit_cnt = self.limit_cnt - len(results) 1431c1440 while result_pb.more_results() and self.limit_cnt > 0: 3377a3387 > self.limit = arg_dict['limit'] 3429c3439,3440 self.throttle_class, > self.limit) 3689c3700 'rps_limit', 'limit') 3723a3735 > arg_dict['limit'] = None