{"id":18888912,"url":"https://github.com/naver/arcus-c-client","last_synced_at":"2025-09-07T21:33:21.080Z","repository":{"id":16547708,"uuid":"19301368","full_name":"naver/arcus-c-client","owner":"naver","description":"ARCUS C client","archived":false,"fork":false,"pushed_at":"2025-04-08T02:51:53.000Z","size":2360,"stargazers_count":11,"open_issues_count":21,"forks_count":16,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-08T03:31:53.410Z","etag":null,"topics":["arcus","arcus-c-client","libmemcached"],"latest_commit_sha":null,"homepage":"https://github.com/naver/arcus","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naver.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/include.am","governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-04-30T05:01:02.000Z","updated_at":"2025-03-07T01:42:29.000Z","dependencies_parsed_at":"2023-11-14T01:44:56.543Z","dependency_job_id":"30ac3656-7558-4ad9-9e52-222904508e98","html_url":"https://github.com/naver/arcus-c-client","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Farcus-c-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Farcus-c-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Farcus-c-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Farcus-c-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naver","download_url":"https://codeload.github.com/naver/arcus-c-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975919,"owners_count":21192295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arcus","arcus-c-client","libmemcached"],"created_at":"2024-11-08T07:46:34.785Z","updated_at":"2025-09-07T21:33:21.065Z","avatar_url":"https://github.com/naver.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## arcus-c-client: Arcus C Client\n\nThis is the C client library for Arcus memcached.  It is based on\nlibmemcached 0.53.  Extensive changes are made to support Arcus\ncollection API and ZooKeeper based clustering.\n\nThe library assumes Arcus memcached, and the collection API (list,\nset, b+tree) is built in.\n\nGithub project page:\nhttps://github.com/naver/arcus\n\n## Build on Linux\n\nMake sure to install auto tools such as autoheader.\n\n    ./config/autorun.sh\n    ./configure --prefix=/install/directory\n    make\n    make install\n\n## ZooKeeper-based clustering\n\nThe use of ZooKeeper based clustering is optional.  To enable it, use\n`--enable-zk-integration` along with `--with-zookeeper` when running configure.\nMake sure to install the ZooKeeper C library from arcus-zookeeper.\n\nSet up a ZooKeeper ensemble and a directory structure for memcached\ninstances.  For instance, the following shows the configuration for\na single-server ZooKeeper ensemble listening at port 2181.\n```\n$ cat test-zk.conf\n# The number of milliseconds of each tick\ntickTime=2000\n# The number of ticks that the initial\n# synchronization phase can take\ninitLimit=10\n# The number of ticks that can pass between\n# sending a request and getting an acknowledgement\nsyncLimit=5\n# the directory where the snapshot is stored.\ndataDir=/home1/arcus/zookeeper_data\n# the port at which the clients will connect\nclientPort=2181\nmaxClientCnxns=200\n```\n\nThis script creates ZooKeeper nodes for two memcached instances: one at localhost:11211 and the other at localhost:11212.\n```\n$ cat setup-test-zk.bash\nZK_CLI=\"./zookeeper/bin/zkCli.sh\"\nZK_ADDR=\"-server localhost:2181\"\n\n$ZK_CLI $ZK_ADDR create /arcus 0\n$ZK_CLI $ZK_ADDR create /arcus/cache_list 0\n$ZK_CLI $ZK_ADDR create /arcus/cache_list/test 0\n$ZK_CLI $ZK_ADDR create /arcus/client_list 0\n$ZK_CLI $ZK_ADDR create /arcus/client_list/test 0\n$ZK_CLI $ZK_ADDR create /arcus/cache_server_mapping 0\n$ZK_CLI $ZK_ADDR create /arcus/cache_server_log 0\n$ZK_CLI $ZK_ADDR create /arcus/cache_server_mapping/127.0.0.1:11211 0\n$ZK_CLI $ZK_ADDR create /arcus/cache_server_mapping/127.0.0.1:11211/test 0\n$ZK_CLI $ZK_ADDR create /arcus/cache_server_mapping/127.0.0.1:11212 0\n$ZK_CLI $ZK_ADDR create /arcus/cache_server_mapping/127.0.0.1:11212/test 0\n```\n\nTo connect to the ZooKeeper ensemble, call one of the Arcus specific\nstartup functions as follows.\n```\narcus/multi_threaded.c:\narcus_pool_connect(pool, \"localhost:2181\", \"test\");\n\narcus/multi_process.c:\narcus_proxy_create(proxy_mc, \"localhost:2181\", \"test\");\n```\n\n## Quick start helloworld example\n\nThe following example code (arcus/sample.c) uses one memcached instance running on the local machine at port 11211.\nIt simply creates a b+tree key, inserts an element, and then retrieves it from the server.\n\n```\n#include \u003cstdlib.h\u003e\n#include \u003cstdio.h\u003e\n\n#include \"libmemcached/memcached.h\"\n\n/* No error checking/handling to minimize clutter. */\n\nint\nmain(int argc, char *argv[])\n{\n  memcached_st *mc;\n  memcached_coll_create_attrs_st attr;\n  const char *key = \"this_is_key\";\n  size_t key_length = strlen(key);\n  const uint64_t bkey = 123; /* b+tree element's key */\n  const char *value = \"helloworld\";\n  memcached_coll_result_st result;\n\n  /* Create the memcached object */\n  if (NULL == (mc = memcached_create(NULL)))\n    return -1;\n\n  /* Add the server's address */\n  if (MEMCACHED_SUCCESS != memcached_server_add(mc, \"127.0.0.1\", 11211))\n    return -1;\n\n  /* Create a b+tree key and then insert an element in one call. */\n  memcached_coll_create_attrs_init(\u0026attr, 20 /* flags */, 100 /* exptime */,\n    4000 /* maxcount */);\n  if (MEMCACHED_SUCCESS != memcached_bop_insert(mc, key, key_length,\n      bkey,\n      NULL /* eflag */, 0 /* eflag length */,\n      (const char*)value, (size_t)strlen(value)+1 /* include NULL */,\n      \u0026attr /* automatically create the b+tree key */))\n    return -1;\n  printf(\"Created a b+tree key and inserted an element.\\n\");\n\n  /* Get the element */\n  if (NULL == memcached_coll_result_create(mc, \u0026result))\n    return -1;\n  if (MEMCACHED_SUCCESS != memcached_bop_get(mc, key, key_length, bkey,\n      NULL /* no eflags filters */,\n      false /* do not delete the element */,\n      false /* do not delete the empty key */,\n      \u0026result))\n    return -1;\n\n  /* Print */\n  printf(\"Retrieved the element. value=%s\\n\",\n    memcached_coll_result_get_value(\u0026result, 0));\n  memcached_coll_result_free(\u0026result);\n\n  return 0;\n}\n```\n\nTo compile, specify the include and library paths and link against this library.\n\n```\ngcc -o sample sample.c -Wall -I/install/directory/include -L/install/directory/lib -lmemcached -lmemcachedutil\n```\n\nThen start the memcached instance.\n```\n$ cd /install/directory/bin\n$ ./memcached -p 11211 -E ../lib/default_engine.so -v\nLoaded engine: Default engine v0.1\nSupplying the following features: LRU, compare and swap\n\n```\n\nFinally run the sample. Make sure to include the path to the C library in LD_LIBRARY_PATH.\n```\n$ LD_LIBRARY_PATH=/install/directory/lib ./sample\nCreated a b+tree key and inserted an element.\nRetrieved the element. value=helloworld\n```\n\n## API Documentation\n\nPlease refer to [Arcus C Client User Guide](docs/arcus-c-client-user-guide.md)\nfor the detailed usage of Arcus C client.\n\nThe original libmemcached has man pages (see docs/man).  `make install` copies\nthese man pages to the target directory.  Arcus APIs do not have man pages.\nInstead, doxygen-style comments are added directly into header files.\nSee the following files.\n\n- libmemcached/arcus.h: ZooKeeper-based clustering\n- libmemcached/collection.h: collections API\n- libmemcached/collection_result.h: collection results API\n- libmemcached/util/pool.h: a few Arcus specific utility functions\n\n## Test cases\n\nlibmemcached includes a number of test cases in the tests directory.  Arcus\nspecific test cases have been added to tests/mem_functions.cc.  To run test\ncases, specify the memcached binary and the engine.  Here is an example.\nTest cases currently do not work with ZooKeeper-based clustering.  Do not\nuse --enable-zk-integration when running configure.\n\n    ./configure --prefix=/home1/arcus \\\n                --with-memcached=/home1/arcus/bin/memcached \\\n                --with-memcached_engine=/home1/arcus/lib/default_engine.so\n    make\n    make test\n\n    [...]\n    PASS: tests/c_sasl_test\n    ===================\n    All 23 tests passed\n    ===================\n    Tests completed\n\nIf any problem exists in test cases, please refer to [test FAQ](/docs/test_faq.md).\n\n## Issues\n\nIf you find a bug, please report it via the GitHub issues page.\n\nhttps://github.com/naver/arcus-c-client/issues\n\n## Arcus Contributors\n\nIn addition to those who had contributed to the original libmemcached, the\nfollowing people at NAVER have contributed to arcus-c-client.\n\n- Hoonmin Kim (harebox) \u003choonmin.kim@navercorp.com\u003e; \u003charebox@gmail.com\u003e\n- YeaSol Kim (ngleader) \u003csol.k@navercorp.com\u003e; \u003cngleader@gmail.com\u003e\n- HyongYoub Kim \u003chyongyoub.kim@navercorp.com\u003e\n\n## License\n\nLicensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0\n\n## Patents\n\nArcus has patents on b+tree smget operation.\nRefer to PATENTS file in this directory to get the patent information.\n\nUnder the Apache License 2.0, a perpetual, worldwide, non-exclusive,\nno-charge, royalty-free, irrevocable patent license is granted to any user for any usage.\nYou can see the specifics on the grant of patent license in LICENSE file in this directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaver%2Farcus-c-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaver%2Farcus-c-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaver%2Farcus-c-client/lists"}