projects
/
bluesky.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a new option to make caching writethrough instead of writeback.
[bluesky.git]
/
bluesky
/
s3store.c
diff --git
a/bluesky/s3store.c
b/bluesky/s3store.c
index
5ab42e1
..
b4920dc
100644
(file)
--- a/
bluesky/s3store.c
+++ b/
bluesky/s3store.c
@@
-59,7
+59,6
@@
static int s3store_put_handler(int bufferSize, char *buffer,
static S3Status s3store_properties_callback(const S3ResponseProperties *properties,
void *callbackData)
{
static S3Status s3store_properties_callback(const S3ResponseProperties *properties,
void *callbackData)
{
- g_print("(Properties callback)\n");
return S3StatusOK;
}
return S3StatusOK;
}
@@
-76,7
+75,7
@@
static void s3store_response_callback(S3Status status,
info->success = 1;
}
info->success = 1;
}
- if (errorDetails != NULL) {
+ if (errorDetails != NULL
&& errorDetails->message != NULL
) {
g_print(" Error message: %s\n", errorDetails->message);
}
}
g_print(" Error message: %s\n", errorDetails->message);
}
}
@@
-86,7
+85,6
@@
static void s3store_task(gpointer a, gpointer s)
BlueSkyStoreAsync *async = (BlueSkyStoreAsync *)a;
S3Store *store = (S3Store *)s;
BlueSkyStoreAsync *async = (BlueSkyStoreAsync *)a;
S3Store *store = (S3Store *)s;
- g_print("Start task [key=%s]...\n", async->key);
async->status = ASYNC_RUNNING;
if (async->op == STORE_OP_GET) {
async->status = ASYNC_RUNNING;
if (async->op == STORE_OP_GET) {
@@
-99,7
+97,6
@@
static void s3store_task(gpointer a, gpointer s)
handler.responseHandler.completeCallback = s3store_response_callback;
handler.getObjectDataCallback = s3store_get_handler;
handler.responseHandler.completeCallback = s3store_response_callback;
handler.getObjectDataCallback = s3store_get_handler;
- g_print("Starting fetch of %s from S3...\n", async->key);
S3_get_object(&store->bucket, async->key, NULL, 0, 0, NULL,
&handler, &info);
S3_get_object(&store->bucket, async->key, NULL, 0, 0, NULL,
&handler, &info);
@@
-128,8
+125,6
@@
static void s3store_task(gpointer a, gpointer s)
handler.responseHandler.completeCallback = s3store_response_callback;
handler.putObjectDataCallback = s3store_put_handler;
handler.responseHandler.completeCallback = s3store_response_callback;
handler.putObjectDataCallback = s3store_put_handler;
- g_print("Starting store of %s to S3 at %ld...\n",
- async->key, bluesky_now_hires());
S3_put_object(&store->bucket, async->key, encrypted->len, NULL, NULL,
&handler, &info);
S3_put_object(&store->bucket, async->key, encrypted->len, NULL, NULL,
&handler, &info);
@@
-138,10
+133,8
@@
static void s3store_task(gpointer a, gpointer s)
async->result = 0;
}
async->result = 0;
}
- // TODO: Deallocate resources
-
- g_print("Finish task...\n");
bluesky_store_async_mark_complete(async);
bluesky_store_async_mark_complete(async);
+ bluesky_store_async_unref(async);
}
static gpointer s3store_new()
}
static gpointer s3store_new()
@@
-184,6
+177,7
@@
static void s3store_submit(gpointer s, BlueSkyStoreAsync *async)
case STORE_OP_GET:
case STORE_OP_PUT:
async->status = ASYNC_PENDING;
case STORE_OP_GET:
case STORE_OP_PUT:
async->status = ASYNC_PENDING;
+ bluesky_store_async_ref(async);
g_thread_pool_push(store->thread_pool, async, NULL);
break;
g_thread_pool_push(store->thread_pool, async, NULL);
break;