Examples of FutureDigest


Examples of net.tomp2p.futures.FutureDigest

      p2.put(Number160.createHash(locationKey))
          .setData(Number160.createHash(contentKey), new Data(data))
          .setVersionKey(data.getVersionKey()).start().awaitUninterruptibly();
    }

    FutureDigest futureDigest = p1
        .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
          .getDigest()
          .keyDigest()
          .containsKey(
              new Number640(Number160.createHash(locationKey), Number160.ZERO, Number160
                  .createHash(contentKey), data.getVersionKey())));
View Full Code Here

Examples of net.tomp2p.futures.FutureDigest

          .setData(Number160.createHash(contentKey), new Data(data))
          .setVersionKey(data.getVersionKey()).start().awaitUninterruptibly();
    }

    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()
              .keyDigest().firstKey());
    }

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

Examples of net.tomp2p.futures.FutureDigest

    for (H2HTestData testData : versions) {
      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.