summaryrefslogtreecommitdiff
path: root/src/include/object_store_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/object_store_client.h')
-rw-r--r--src/include/object_store_client.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/include/object_store_client.h b/src/include/object_store_client.h
new file mode 100644
index 0000000..e6fdfda
--- /dev/null
+++ b/src/include/object_store_client.h
@@ -0,0 +1,53 @@
+#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;
+};
+
+/*����API�̰߳�ȫ��API��ʹ��˵���ο�tango_cache_client.h*/
+
+enum CACHE_ERR_CODE object_store_get_last_error(const struct cache_evbase_ctx *ctx_asyn);
+long long object_store_maximum_session(const struct object_store_instance *instance);
+void object_store_get_statistics(const struct object_store_instance *instance, struct cache_statistics *out);
+
+void object_store_global_init(void);
+
+/*����ʵ�����̰߳�ȫ���ڲ�������һ���߳�*/
+struct object_store_instance *object_store_instance_new(const char* profile_path, const char* section, int thread_num, void *runtimelog);
+
+
+//GET�ӿڣ��ɹ�����0��ʧ�ܷ���-1��future�ص���������������߳���ִ�У���ͬ
+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�ӿ�
+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);
+
+//һ�����ϴ��ӿ�
+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);
+
+//��ʽ�ϴ��ӿ�
+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
+