branch, master, updated. 646669e95bde92bf3ac91cd52c1de00094a71316
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, master has been updated via 646669e95bde92bf3ac91cd52c1de00094a71316 (commit) from ab1438bc4251850222edd7a985558422d3d9f742 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 646669e95bde92bf3ac91cd52c1de00094a71316 Author: Phil Carns <[email protected]> Date: Fri Oct 11 17:26:59 2013 -0400 ability to set replication factor in triton-cp ----------------------------------------------------------------------- Summary of changes: code/src/admin-tools/triton-cp.ae | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) Diff of changes: diff --git a/code/src/admin-tools/triton-cp.ae b/code/src/admin-tools/triton-cp.ae index 06f4af1..1444c84 100644 --- a/code/src/admin-tools/triton-cp.ae +++ b/code/src/admin-tools/triton-cp.ae @@ -53,6 +53,8 @@ static __blocking int tc_read(struct obj_ref* ref, char* buffer, int size); static __blocking int tc_write(struct obj_ref* ref, const char* buffer, int size); static __blocking int transfer(struct obj_ref *src, struct obj_ref *dest, char* buffer, int size); +int replication_factor = 1; + __blocking int aesop_main(int argc, char **argv) { triton_ret_t tret; @@ -62,14 +64,25 @@ __blocking int aesop_main(int argc, char **argv) struct obj_ref *dest; char* buffer; - if(argc != 4) + if(argc != 4 && argc != 5) { - fprintf(stderr, "Usage: %s <server> <src> <dest>\n", argv[0]); + fprintf(stderr, "Usage: %s <server> <src> <dest> <replication_factor>\n", argv[0]); fprintf(stderr, " (prefix local files with \"posix:\")\n"); fprintf(stderr, " Example: triton-cp tcp://localhost:3344 posix:/tmp/a.dat 123.123\n"); + fprintf(stderr, " The <replication_factor> argument is optional.\n"); return(-1); } + if(argc == 5) + { + ret = sscanf(argv[4], "%d", &replication_factor); + if(ret != 1) + { + fprintf(stderr, "Error: invalid replication factor.\n"); + return(-1); + } + } + svr_string = argv[1]; tret = triton_debug_init(); @@ -233,7 +246,7 @@ static __blocking int tc_open(struct obj_ref* ref, int create_if_needed) if(create_if_needed) { /* TODO: make replication factor configurable */ - tret = remote_triton_rpc_rosd_create(ref->u.triton.oid, 1, 0); + tret = remote_triton_rpc_rosd_create(ref->u.triton.oid, replication_factor, 0); if(triton_error_equal(tret, TRITON_ERR_EXIST)) { fprintf(stderr, "Error: unimplemented; need to truncate triton object.\n"); hooks/post-receive --
participants (1)
-
noreply@mcs.anl.gov