[Overlayweaver-discuss-ja] DHTFilter(EntryFilter) =?iso-2022-jp?B?GyRCJE47SCQkSn0bKEI=?=
Brought to you by:
shudo
From: Atsushi H. <hn...@ir...> - 2006-02-11 13:52:20
Attachments:
dht-filter-test.tar.gz
|
花岡といいます. DHTFilter(EntryFilter) の使い方について教えてください. test/ow/dht/DHTTest.java の get の部分を, valueSet = ((DHTImpl<String>) dht).get(key, null, new EntryFilter<String>() { public String filter(String value) { return (value.compareTo("foo") > 0) ? value : null; } }); というようにすれば,指定した key でヒットしても, 対応する value が "foo" より大きくないと返さない, というようなフィルタがかけられるのではと思ってやってみました. 意図した通りの結果になるときと,添付したログのように, NotSerializableException が発生するときがあります. ローカルに <key,value> がある場合は成功して, リモートにある場合は Message.java:141 で DHTFilter のオブジェクトが シリアライズできずに例外が発生しているように思うのですが… 環境は, (ibook/192.168.0.5): Mac OS X 10.4.4 java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-83) Java HotSpot(TM) Client VM (build 1.5.0_05-48, mixed mode, sharing) (debian/192.168.0.3): Debian etch java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing) で,添付したソースを使って 192.168.0.5 を起動後, 192.168.0.3 から 192.168.0.5 に join しました. そもそも,((DHTImpl<String>) dht) というようなキャストをやって, DHT.java のインタフェースをかいくぐっていいのでしょうか? よろしくお願いいたします. -- 花岡 篤史 hn...@ir... |