def load(context, path, callback): def callback_wrapper(result): r = LoaderResult() if result is not None: r.successful = True r.buffer = result else: r.error = LoaderResult.ERROR_NOT_FOUND r.successful = False callback(r) storage = Storage(context) storage.get(path, callback_wrapper)
def topic(self): config = Config(HBASE_STORAGE_TABLE=self.parent.table, HBASE_STORAGE_SERVER_PORT=9090) storage = Storage( Context(config=config, server=get_server('ACME-SEC'))) storage.put(IMAGE_URL % '2', IMAGE_BYTES) return storage.get(IMAGE_URL % '2')
def topic(self): config = Config(HBASE_STORAGE_TABLE=self.parent.table,HBASE_STORAGE_SERVER_PORT=9090) storage = Storage(Context(config=config, server=get_server('ACME-SEC'))) storage.put(IMAGE_URL % '2', IMAGE_BYTES) return storage.get(IMAGE_URL % '2')
def load(context, path, callback): storage = Storage(context) callback(storage.get(path))