Package lupos.distributed.p2p.gui

Examples of lupos.distributed.p2p.gui.PeerCreator


      /*
       * sets the distribution
       */
      distribution = (IDistributionKeyContainer<?>) Class.forName(
          this.distributionStrategyClass).newInstance();
      final PeerCreator pc = new PeerCreator().setP2PNetwork(
          this.networkImplementation, arguments).setDistributionStrategy(
          distribution);
      pc.setUseSubgraphSubmission(!this.useNoSGSubmission);


      if (this.storageBlockSize != 0) {
        final int bSize = this.storageBlockSize;
        this.storageClassConfiguration = new IConfigurator<BlockStorageWithDistributionStrategy>() {
          @Override
          public String toString() {
            return "blockSize = " + bSize;
          }
          @Override
          public void doConfiguration(
              final BlockStorageWithDistributionStrategy storage) {
            storage.setBlockSize(bSize);

          }
        };
      }
      if (this.storageClass != null) {
        try {
          final Class<? extends StorageWithDistributionStrategy> c = (Class<? extends StorageWithDistributionStrategy>) Class.forName(this.storageClass);
          pc.setStorage(c,this.storageClassConfiguration);
        } catch (ClassCastException | ClassNotFoundException e) {
          System.err.println(String.format("Storage-implementation %s not found or not valid.",this.storageClass));
        }
      }


      pc.start();
      System.out.println("Started.");

      /*
       * start the node, activates input mode on console
       */
 
View Full Code Here

TOP

Related Classes of lupos.distributed.p2p.gui.PeerCreator

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.