Skip to content

Instantly share code, notes, and snippets.

@tatsuya6502
Created September 26, 2011 16:15
Show Gist options
  • Save tatsuya6502/1242624 to your computer and use it in GitHub Desktop.
Save tatsuya6502/1242624 to your computer and use it in GitHub Desktop.
Hibari DB - Python UBF Client
$ cd working-directory
$ cd hibari
$ repo forall -c "git branch norton-server-timestamp origin/norton-server-timestamp"
→ 一部エラー(Not a valid object name)になるが、それでOK。
$ repo forall -c "git checkout norton-server-timestamp"
→ 一部エラーになるが、それでOK。
$ repo branch
* dev | in all projects
kawano-thrift | in hibari/lib/gdss_ubf_proto
* norton-server-timestamp | in:
hibari-doc
hibari/lib/gdss_admin
hibari/lib/gdss_brick
hibari/lib/gdss_client
hibari/lib/gdss_s3_proto
hibari/lib/gdss_ubf_proto
hibari/lib/s3
 → norton-server-timestamp 以下のライブラリー名が、上と同じことを確認する。
$ git apply version.patch # version.patch はこの gistに含まれています。
$ make
$ make bootstrap-package # ./tmp ディレクトリ配下に Hibariがインストールされ、起動される。
...
generating: hibari-0.1.9-dev-x86_64-unknown-linux-gnu-64 ...
./rebar generate
==> rel (generate)
packaging: hibari-0.1.9-dev-x86_64-unknown-linux-gnu-64 ...
1f635dd2d4578f3e9e6cc41b5a0b44b9 hibari-0.1.9-dev-x86_64-unknown-linux-gnu-64.tgz
-rw-rw-r--. 1 tatsuya tatsuya 83 Sep 27 01:12 hibari-0.1.9-dev-x86_64-unknown-linux-gnu-64-md5sum.txt
-rw-rw-r--. 1 tatsuya tatsuya 19474223 Sep 27 01:12 hibari-0.1.9-dev-x86_64-unknown-linux-gnu-64.tgz
bootstrapping package: hibari-0.1.9-dev-x86_64-unknown-linux-gnu-64 ...
make: [bootstrap-package] Error 1 (ignored)
tar -C ./tmp -xzf ../hibari-0.1.9-dev-x86_64-unknown-linux-gnu-64.tgz
./tmp/hibari/bin/hibari start
./tmp/hibari/bin/hibari-admin bootstrap
ok
$ ./tmp/hibari/bin/hibari ping
pong
# Hibari を停止する方法
$ ./tmp/hibari/bin/hibari stop
[tatsuya@fedora-mp python]$ env PYTHONPATH=/home/tatsuya/workhub/master/py_interface/ python ubf_client.py
set k->fuga [<ubf-atom: "'ok'">]
tab1 : k : [(<ubf-atom: "'ok'">, 0, "S'fuga'\np0\n.")]
set k->hoge [(<ubf-atom: "'ts_error'">, 0)]
set k->fuga [<ubf-atom: "'ok'">]
gets k cached: 0
fuga
cas k->hana [(<ubf-atom: "'ts_error'">, 0)]
gets cached: 0
fuga
[tatsuya@fedora-mp python]$ env PYTHONPATH=/home/tatsuya/workhub/master/py_interface/ python ubf_client.py
set k->fuga [(<ubf-atom: "'ok'">, 1317053557887835L)]
tab1 : k : [(<ubf-atom: "'ok'">, 1317053557887835L, "S'fuga'\np0\n.")]
set k->hoge [(<ubf-atom: "'ok'">, 1317053557979748L)]
set k->fuga [(<ubf-atom: "'ok'">, 1317053558023681L)]
gets k cached: 1317053558023681
fuga
cas k->hana [(<ubf-atom: "'ok'">, 1317053558105757L)]
gets cached: 1317053558105757
hana
[tatsuya@fedora-mp python]$
diff --git a/rebar.config b/rebar.config
index 63f25eb..3eb163a 100644
--- a/rebar.config
+++ b/rebar.config
@@ -43,7 +43,7 @@
, {gdss_brick, "0.1.6", "lib/gdss_brick"}
, {gdss_client, "0.1.6", "lib/gdss_client"}
, {gdss_admin, "0.1.5", "lib/gdss_admin"}
- , {gdss_ubf_proto, "0.1.7", "lib/gdss_ubf_proto"}
+ , {gdss_ubf_proto, "0.1.6", "lib/gdss_ubf_proto"}
, {gdss_json_rpc_proto, "0.1.1", "lib/gdss_json_rpc_proto"}
- , {gdss_s3_proto, "0.1.2", "lib/gdss_s3_proto"}
+ , {gdss_s3_proto, "0.1.1", "lib/gdss_s3_proto"}
]}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment