예제 #1
0
  public void write(Profile profile) {

    com.aerospike.client.Key key = new com.aerospike.client.Key("test", "demo", profile.getId());
    Bin bin1 = new Bin("bin1", profile.toJSon());
    // Bin bin2 = new Bin("bin2", "value2");

    //    console.info("Put: namespace=%s set=%s key=%s bin1=%s value1=%s bin2=%s value2=%s",
    //          key.namespace, key.setName, key.userKey, bin1.name, bin1.value, bin2.name,
    // bin2.value);

    client.put(null, key, bin1);
  }
예제 #2
0
  public void awrite(Profile profile) {

    com.aerospike.client.Key key = new com.aerospike.client.Key("test", "demo", profile.getId());
    Bin bin1 = new Bin("bin1", profile.toJSon());

    aclient.put(
        null,
        new WriteListener() {
          @Override
          public void onSuccess(Key key) {}

          @Override
          public void onFailure(AerospikeException e) {}
        },
        key,
        bin1);
  }