Package net.tomp2p.futures

Examples of net.tomp2p.futures.FutureDigest.awaitUninterruptibly()


    Assert.assertTrue(ttl > futureGet.getData().ttlSeconds());

    // check decrement of ttl through a get meta
    FutureDigest futureDigest = p1.digest(lKey).setDomainKey(dKey).setContentKey(cKey)
        .setVersionKey(vKey).returnMetaValues().start();
    futureDigest.awaitUninterruptibly();
    Assert.assertTrue(futureDigest.isSuccess());
    Data dataMeta = futureDigest.getDigest().dataMap().values().iterator().next();
    Assert.assertTrue(ttl > dataMeta.ttlSeconds());

    // wait again a moment, till data gets expired
View Full Code Here


        .digest(Number160.createHash(locationKey))
        .from(new Number640(Number160.createHash(locationKey), Number160.ZERO, Number160
            .createHash(contentKey), Number160.ZERO))
        .to(new Number640(Number160.createHash(locationKey), Number160.ZERO, Number160
            .createHash(contentKey), Number160.MAX_VALUE)).start();
    futureDigest.awaitUninterruptibly();

    assertTrue(futureDigest.getDigest().keyDigest().isEmpty());

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
View Full Code Here

        .contentKey(Number160.createHash(contentKey)).setVersionKey(data.getVersionKey()).start();
    futureRemove.awaitUninterruptibly();

    FutureDigest futureDigest = p1.digest(Number160.createHash(locationKey))
        .setContentKey(Number160.createHash(contentKey)).setVersionKey(data.getVersionKey()).start();
    futureDigest.awaitUninterruptibly();

    assertTrue(futureDigest.getDigest().keyDigest().isEmpty());

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
View Full Code Here

    FutureRemove futureRemove = p1.remove(lKey).setDomainKey(dKey).contentKey(cKey).start();
    futureRemove.awaitUninterruptibly();

    // check with a normal digest
    FutureDigest futureDigest = p1.digest(lKey).setContentKey(cKey).setDomainKey(dKey).start();
    futureDigest.awaitUninterruptibly();
    assertTrue(futureDigest.getDigest().keyDigest().isEmpty());

    // check with a from/to digest
    futureDigest = p1.digest(lKey).from(new Number640(lKey, dKey, cKey, Number160.ZERO))
        .to(new Number640(lKey, dKey, cKey, Number160.MAX_VALUE)).start();
View Full Code Here

    assertTrue(futureDigest.getDigest().keyDigest().isEmpty());

    // check with a from/to digest
    futureDigest = p1.digest(lKey).from(new Number640(lKey, dKey, cKey, Number160.ZERO))
        .to(new Number640(lKey, dKey, cKey, Number160.MAX_VALUE)).start();
    futureDigest.awaitUninterruptibly();
    assertTrue(futureDigest.getDigest().keyDigest().isEmpty());

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
  }
View Full Code Here

        .to(new Number640(lKey, dKey, cKey, Number160.MAX_VALUE)).start();
    futureRemove.awaitUninterruptibly();

    FutureDigest futureDigest = p1.digest(lKey).from(new Number640(lKey, dKey, cKey, Number160.ZERO))
        .to(new Number640(lKey, dKey, cKey, Number160.MAX_VALUE)).start();
    futureDigest.awaitUninterruptibly();

    // should be empty
    assertTrue(futureDigest.getDigest().keyDigest().isEmpty());

    p1.shutdown().awaitUninterruptibly();
View Full Code Here

        .digest(Number160.createHash(locationKey))
        .from(new Number640(Number160.createHash(locationKey), Number160.ZERO, Number160
            .createHash(contentKey), Number160.ZERO))
        .to(new Number640(Number160.createHash(locationKey), Number160.ZERO, Number160
            .createHash(contentKey), Number160.MAX_VALUE)).start();
    futureDigest.awaitUninterruptibly();

    assertEquals(numberOfContent, futureDigest.getDigest().keyDigest().size());

    for (H2HTestData data : content) {
      assertTrue(futureDigest
View Full Code Here

    for (H2HTestData data : content) {
      FutureDigest future = p1.digest(Number160.createHash(locationKey)).setDomainKey(Number160.ZERO)
          .setContentKey(Number160.createHash(contentKey)).setVersionKey(data.getVersionKey())
          .start();
      future.awaitUninterruptibly();

      assertEquals(1, future.getDigest().keyDigest().size());
      assertEquals(
          new Number640(Number160.createHash(locationKey), Number160.ZERO,
              Number160.createHash(contentKey), data.getVersionKey()), future.getDigest()
View Full Code Here

      parameters.setVersionKey(testData.getVersionKey()).setData(testData);
      node.getDataManager().putUnblocked(parameters).awaitUninterruptibly();
    }

    FutureDigest futureDigest = node.getDataManager().getDigestUnblocked(parameters);
    futureDigest.awaitUninterruptibly();

    assertEquals(H2HConstants.MAX_VERSIONS_HISTORY, futureDigest.getDigest().keyDigest().size());
    int i = 0;
    for (Number160 storedVersion : futureDigest.getDigest().keyDigest().values()) {
      assertEquals(newerVersions.get(i++).getVersionKey(), storedVersion);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.