2018-12-14 15:07:09 +08:00
|
|
|
|
#ifndef __OBJECT_STORE_CLIENT_H__
|
|
|
|
|
|
#define __OBJECT_STORE_CLIENT_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include <event2/event.h>
|
|
|
|
|
|
#include <event.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "cache_evbase_client.h"
|
|
|
|
|
|
|
|
|
|
|
|
struct object_store_instance
|
|
|
|
|
|
{
|
|
|
|
|
|
struct cache_evbase_instance **instances;
|
|
|
|
|
|
u_int32_t instance_num;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*<2A><><EFBFBD><EFBFBD>API<50>̰߳<DFB3>ȫ<EFBFBD><C8AB>API<50><49>ʹ<EFBFBD><CAB9>˵<EFBFBD><CBB5><EFBFBD>ο<EFBFBD>tango_cache_client.h*/
|
|
|
|
|
|
|
|
|
|
|
|
enum CACHE_ERR_CODE object_store_get_last_error(const struct cache_evbase_ctx *ctx_asyn);
|
|
|
|
|
|
void object_store_get_statistics(const struct object_store_instance *instance, struct cache_statistics *out);
|
|
|
|
|
|
|
|
|
|
|
|
void object_store_global_init(void);
|
|
|
|
|
|
|
|
|
|
|
|
/*<2A><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>̰߳<DFB3>ȫ<EFBFBD><C8AB><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>߳<EFBFBD>*/
|
|
|
|
|
|
struct object_store_instance *object_store_instance_new(const char* profile_path, const char* section, int thread_num, void *runtimelog);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//GET<45>ӿڣ<D3BF><DAA3>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30>ʧ<EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD>-1<><31>future<72>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><DFB3><EFBFBD>ִ<EFBFBD>У<EFBFBD><D0A3><EFBFBD>ͬ
|
|
|
|
|
|
int object_store_fetch_object(struct object_store_instance *instance, struct future* f, struct tango_cache_meta_get *meta, enum OBJECT_LOCATION where_to_get);
|
|
|
|
|
|
int object_store_head_object(struct object_store_instance *instance, struct future* f, struct tango_cache_meta_get *meta);
|
|
|
|
|
|
struct tango_cache_result *object_store_read_result(void *promise_result);
|
|
|
|
|
|
|
|
|
|
|
|
//DELETE<54>ӿ<EFBFBD>
|
2018-12-15 21:19:20 +08:00
|
|
|
|
int object_store_delete_object(struct object_store_instance *instance, struct future* f, const char *objkey, const char *minio_addr=NULL, const char *bucket=NULL);
|
2018-12-14 15:07:09 +08:00
|
|
|
|
|
|
|
|
|
|
//һ<><D2BB><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4>ӿ<EFBFBD>
|
|
|
|
|
|
int object_store_upload_once_data(struct object_store_instance *instance, struct future* f,
|
|
|
|
|
|
enum PUT_MEMORY_COPY_WAY way, const char *data, size_t size,
|
|
|
|
|
|
struct tango_cache_meta_put *meta,
|
|
|
|
|
|
char *path/*OUT*/, size_t pathsize);
|
|
|
|
|
|
int object_store_upload_once_evbuf(struct object_store_instance *instance, struct future* f,
|
|
|
|
|
|
struct evbuffer *evbuf,
|
|
|
|
|
|
struct tango_cache_meta_put *meta,
|
|
|
|
|
|
char *path/*OUT*/, size_t pathsize);
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><>ʽ<EFBFBD>ϴ<EFBFBD><CFB4>ӿ<EFBFBD>
|
|
|
|
|
|
struct cache_evbase_ctx *object_store_update_start(struct object_store_instance *instance, struct future* f, struct tango_cache_meta_put *meta);
|
|
|
|
|
|
int object_store_update_frag_data(struct cache_evbase_ctx *ctx_asyn, enum PUT_MEMORY_COPY_WAY way, const char *data, size_t size);
|
|
|
|
|
|
int object_store_update_frag_evbuf(struct cache_evbase_ctx *ctx_asyn, struct evbuffer *evbuf);
|
|
|
|
|
|
int object_store_update_end(struct cache_evbase_ctx *ctx_asyn, char *path/*OUT*/, size_t pathsize);
|
|
|
|
|
|
void object_store_update_cancel(struct cache_evbase_ctx *ctx_asyn);
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|