/*
* 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
*/