<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          beansdb4jbeansdb的java客戶(hù)端

          聯(lián)合創(chuàng)作 · 2023-10-01 00:47

          這是beansdb的java客戶(hù)端, 它使用了和python客戶(hù)端一模一樣的hash算法, 所以它和python客戶(hù)端是完全兼容 — 這意味著你可以用python客戶(hù)端存一個(gè)東西進(jìn)beansdb, 然后用java客戶(hù)端把它取出來(lái)。

          示例代碼:

           // specify the beansdb nodes.
           
          Map<InetSocketAddress, Range> servers = new HashMap<InetSocketAddress, Range>();
           servers
          .put(new InetSocketAddress("localhost", 7900), new Range(, 16));
           servers
          .put(new InetSocketAddress("localhost", 7901), new Range(, 16));
           servers
          .put(new InetSocketAddress("localhost", 7902), new Range(, 16));
           
           
          // 3,2,2 is the NRW number in the Dynamo thesis
           
          Beansdb db = new Beansdb(servers, 16, 3, 2, 2);
           
           
          // set the key: foo to value: bar
           db
          .set("foo", "bar");
           
           
          // get the value of foo
           
          System.out.println(db.get("foo"));
           
           
          // get the value for keys: hello, james, foo
           
          List<String> keys = new ArrayList<String>(3);
           keys
          .add("hello");
           keys
          .add("james");
           keys
          .add("foo");
           
          Map<String, Object> ret = db.getMulti(keys);
           
           
          for (String key : ret.keySet()) {
                 
          System.out.println(key + " : " + ret.get(key));
           
          }
           
           
          // delete the key: foo
           db
          .delete("foo");
           
           
          // close the db connection
           db
          .close();
          瀏覽 21
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  成人国产一区二区三区精品麻豆 | 大肉大捧一进一出两腿 | 一级在线免费视频 | 老鸭窝laoyawo在线播放 | 操笔视频国产 |