Package net.tomp2p.dht

Examples of net.tomp2p.dht.PeerDHT.shutdown()


    } finally {
      if (sender != null) {
        sender.shutdown().awaitUninterruptibly();
      }
      if (receiver != null) {
        receiver.shutdown().awaitUninterruptibly();
      }
    }
  }
 
  @Test
View Full Code Here


    } finally {
      if (sender != null) {
        sender.shutdown().awaitUninterruptibly();
      }
      if (receiver != null) {
        receiver.shutdown().awaitUninterruptibly();
      }
    }
  }

  @Test
View Full Code Here

    } finally {
      if (sender != null) {
        sender.shutdown().awaitUninterruptibly();
      }
      if (receiver != null) {
        receiver.shutdown().awaitUninterruptibly();
      }
    }
  }

  @Test
View Full Code Here

    } finally {
      if (sender != null) {
        sender.shutdown().awaitUninterruptibly();
      }
      if (receiver != null) {
        receiver.shutdown().awaitUninterruptibly();
      }
    }
  }
}
View Full Code Here

            FuturePut fp = p2.put(locationKey).data(new Data("hallo")).requestP2PConfiguration(new RequestP2PConfiguration(2, 10, 0)).start();
            fp.awaitUninterruptibly();
            getReplicasCount(locationKey, p1, p2, p3);
            //
            p3.peer().announceShutdown().start().awaitUninterruptibly();
            p3.shutdown().awaitUninterruptibly();
            Thread.sleep(500);
            p3 = new PeerBuilderDHT(new PeerBuilder(locationKey).ports(PORT+3).start()).start();
            i3 = new IndirectReplication(p3);
            i3.start();
           
View Full Code Here

            }
            if (p2 != null && !p2.peer().isShutdown()) {
                p2.shutdown().awaitUninterruptibly();
            }
            if (p3 != null && !p3.peer().isShutdown()) {
                p3.shutdown().awaitUninterruptibly();
            }
        }
    }
   
    @Test
View Full Code Here

            FuturePut fp = p2.put(locationKey).data(new Data("hallo")).requestP2PConfiguration(new RequestP2PConfiguration(2, 10, 0)).start();
            fp.awaitUninterruptibly();
            getReplicasCount(locationKey, p1, p2, p3);
           
            p3.peer().announceShutdown().start().awaitUninterruptibly();
            p3.shutdown().awaitUninterruptibly();
            p1.peer().announceShutdown().start().awaitUninterruptibly();
            p1.shutdown().awaitUninterruptibly();
            Thread.sleep(500);
            getReplicasCount(locationKey, p1, p2, p3);
           
View Full Code Here

            }
            if (p2 != null && !p2.peer().isShutdown()) {
                p2.shutdown().awaitUninterruptibly();
            }
            if (p3 != null && !p3.peer().isShutdown()) {
                p3.shutdown().awaitUninterruptibly();
            }
        }
    }
   
    private static int getReplicasCount(Number160 key, PeerDHT... peers) {
View Full Code Here

            //test it
            Assert.assertEquals(true, peers[1].storageLayer().contains(new Number640(Number160.createHash("2"), Number160.ZERO, Number160.ZERO, Number160.ZERO)));
           
        } finally {
            if (master != null) {
                master.shutdown().awaitUninterruptibly();
            }
        }
    }

    /**
 
View Full Code Here

    } finally {
      if (master != null) {
        master.shutdown().await();
      }
      if (slave != null) {
        slave.shutdown().await();
      }
    }
  }

  private void printMapStatus(PeerDHT slave, PeerDHT[] peers) {
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.