Package net.tomp2p.replication

Examples of net.tomp2p.replication.IndirectReplication$DefaultReplicationSender


        final int nr3 = 4;
        PeerDHT peer1 = new PeerBuilderDHT(new PeerBuilder(new Number160(nr1)).ports(port1).start()).start();
        PeerDHT peer2 = new PeerBuilderDHT(new PeerBuilder(new Number160(nr2)).ports(port2).start()).start();
        PeerDHT peer3 = new PeerBuilderDHT(new PeerBuilder(new Number160(nr3)).ports(port3).start()).start();
       
        new IndirectReplication(peer1).start();
        new IndirectReplication(peer2).start();
        new IndirectReplication(peer3).start();
       
       
        PeerDHT[] peers = new PeerDHT[] {peer1, peer2, peer3};
        //
        FuturePut futurePut = peer1.put(new Number160(nr3)).data(new Data("store on peer1")).start();
View Full Code Here


        peers[0] = new PeerBuilderDHT(pm.start()).start();
        if(automaticFuture!=null) {
          peers[0].peer().addAutomaticFuture(automaticFuture);
        }
        if(replication) {
          IndirectReplication rep = new IndirectReplication(peers[0]);
          if(rsync) {
            rep.rsync().blockSize(32);
          }
          rep.nRoot().start();
        }

        for (int i = 1; i < nrOfPeers; i++) {
            pm = new PeerBuilder(new Number160(rnd)).enableMaintenance(maintenance)
                        .bindings(bindings).masterPeer(peers[0].peer());
            peers[i] = new PeerBuilderDHT(pm.start()).start();
           
            if(automaticFuture!=null) {
              peers[i].peer().addAutomaticFuture(automaticFuture);
            }
            if(replication) {
              IndirectReplication rep = new IndirectReplication(peers[i]);
              if(rsync) {
                rep.rsync().blockSize(32);
              }
              rep.nRoot().start();
            }
        }
        System.err.println("peers created.");
        return peers;
    }
View Full Code Here

TOP

Related Classes of net.tomp2p.replication.IndirectReplication$DefaultReplicationSender

Copyright © 2018 www.massapicom. 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.