Archive for the ‘Kyototycoon/cabinet’ Category

 

github.com使ってみた。公開してみた。

7月 18th, 2012

Andreessen Horowitz、GitHubに1億ドルを出資 http://japan.cnet.com/news/business/35019055/ gitは少し使ってきてなれてきたのですが、 OSSなど、いくつかのプロジェクトがgithubで公開されているのを利用させてもらったことはありますが 個人や会社で使う理由はわかりませんが、とりあえず使ってみます。 https://help.github.com/articles/create-a-repo まずは空のリポジトリを作ると説明が出ます。 Global setup: Set up git  git config –global user.name “Your Name”  git config –global user.email junichi.otake@gmail.com Add your public key       Next steps:  mkdir hello  cd hello  git init  touch README  git add README  git commit -m ‘first commit’  git remote add origin git@github.com:junichi-otake/hello.git  git […]

Read full article | コメントは受け付けていません。

kyototycoon get_bulk 複数レコードを処理する。

7月 17th, 2012

[http://fallabs.com/kyototycoon/spex.html] /rpc/get_bulk Retrieve records at once. input: DB: (optional): the database identifier. input: atomic: (optional): to perform all operations atomically. If it is omitted, non-atomic operations are performed. input: (optional): arbitrary keys which trail “_”. output: num: the number of retrieved reocrds. output: (optional): arbitrary keys which trail the character “_”. status code: 200. 配列を渡すようにget_bulk。 […]

Read full article | コメントは受け付けていません。

kyototycoon play_scriptをphpから利用する。

7月 15th, 2012

前回 play_scriptの部分を書く前だったので play_scriptの部分を 資料 [http://fallabs.com/kyototycoon/spex.html] /rpc/play_script Call a procedure of the script language extension. input: name: the name of the procedure to call. input: (optional): arbitrary records whose keys trail the character “_”. output: (optional): arbitrary keys which trail the character “_”. status code: 200, 450 (arbitrary logical error). ということで、前のクラスにplay_scriptを追加  public function play_script($name, $inmap){   […]

Read full article | コメントは受け付けていません。

kyototycoon PHPから利用する

7月 13th, 2012

[http://fallabs.com/blog-ja/promenade.cgi?id=99] 複雑なことはしないので、簡単に書いてみる。set get play_script outくらい class Data_Kyoto{  protected $host = ‘localhost';  protected $port = ‘50311’;  protected $timeout = 3;  protected $baseUrl = ”;  protected $kt ;  public function __construct(){    $this->setBase();  }  protected function setBase(){    $this->baseUrl = ‘http://’.$this->host.':’.$this->port.’/rpc/';  }  public function get($key,$db=null){    $api = $this->baseUrl.’get';    $params = array(‘key’=>$key );    if($db) $params['DB']=$db; […]

Read full article | コメントは受け付けていません。

kyototycoon luaで2つのデータベースを利用。

7月 13th, 2012

$ lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio [http://fallabs.com/blog-ja/promenade.cgi?id=124] 2つのハッシュデータベースにデータを入れるだけ 1つ目は、idとデータ 2つ目は、keyとidリスト アイテムテーブルとユーザーテーブルのような関係。 起動コマンドは、サンプルの通り scrにスクリプトを設定する Starting the server of Kyoto Tycoon Executing: ktserver -port 50311 -dmn -pid /var/ktserver/first/pid -tout 3 -log /var/ktserver/first/log -scr /home/first/backend/lua/first.lua Done first.kch user.kchとして起動 1. script : idとuserでdataを登録する。 $ ktremotemgr script -port 50311 set id 100 user fujisan data “{id:100,user:fujisan,etc}” 2. […]

Read full article | コメントは受け付けていません。

kyotocabinet kyototycoonをインストールしてluaでスクリプト追加してみる。

7月 12th, 2012

centos 6です。 zlibが必要。 luaを入れる。 yum install lua lua-devel 最新のパッケージをダウンロードします。 http://fallabs.com/kyotocabinet/ http://fallabs.com/kyototycoon/ //fallabs.com/kyotocabinet/pkg/kyotocabinet-1.2.76.tar.gz //http://fallabs.com/kyototycoon/pkg/kyototycoon-0.9.56.tar.gz ./configure make make install で。 kyototycoonには、./configure –enable-lua とオプションを付ける。 checking for lua.h… yesが入る。 make; make install ktserver: error while loading shared libraries: libkyototycoon.so.2: cannot open shared object file: No such file or directory # vim /etc/ld.so.conf.d/ktserver.conf /usr/local/libを追加。 /sbin/ldconfig -v /usr/local/lib: libkyototycoon.so.2 -> libkyototycoon.so.2.19.0 libkyotocabinet.so.16 […]

Read full article | コメントは受け付けていません。