Format
This commit is contained in:
@ -40,7 +40,8 @@ public class GossipRunner {
|
|||||||
System.err.println("Error while starting the gossip service: " + e.getMessage());
|
System.err.println("Error while starting the gossip service: " + e.getMessage());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println("The gossip.conf file is not found.\n\nEither specify the path to the startup settings file or place the gossip.json file in the same folder as the JAR file.");
|
System.out
|
||||||
|
.println("The gossip.conf file is not found.\n\nEither specify the path to the startup settings file or place the gossip.json file in the same folder as the JAR file.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,24 +17,32 @@ import com.google.code.gossip.manager.random.RandomGossipManager;
|
|||||||
public class GossipService {
|
public class GossipService {
|
||||||
|
|
||||||
public static final Logger LOGGER = Logger.getLogger(GossipService.class);
|
public static final Logger LOGGER = Logger.getLogger(GossipService.class);
|
||||||
|
|
||||||
private GossipManager _gossipManager;
|
private GossipManager _gossipManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor with the default settings.
|
* Constructor with the default settings.
|
||||||
|
*
|
||||||
* @throws InterruptedException
|
* @throws InterruptedException
|
||||||
* @throws UnknownHostException
|
* @throws UnknownHostException
|
||||||
*/
|
*/
|
||||||
public GossipService(StartupSettings startupSettings) throws InterruptedException, UnknownHostException {
|
public GossipService(StartupSettings startupSettings) throws InterruptedException,
|
||||||
this(InetAddress.getLocalHost().getHostAddress(), startupSettings.getPort(), "", startupSettings.getLogLevel(), startupSettings.getGossipMembers(), startupSettings.getGossipSettings());
|
UnknownHostException {
|
||||||
|
this(InetAddress.getLocalHost().getHostAddress(), startupSettings.getPort(), "",
|
||||||
|
startupSettings.getLogLevel(), startupSettings.getGossipMembers(), startupSettings
|
||||||
|
.getGossipSettings());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup the client's lists, gossiping parameters, and parse the startup config file.
|
* Setup the client's lists, gossiping parameters, and parse the startup config file.
|
||||||
|
*
|
||||||
* @throws SocketException
|
* @throws SocketException
|
||||||
* @throws InterruptedException
|
* @throws InterruptedException
|
||||||
* @throws UnknownHostException
|
* @throws UnknownHostException
|
||||||
*/
|
*/
|
||||||
public GossipService(String ipAddress, int port, String id, int logLevel, ArrayList<GossipMember> gossipMembers, GossipSettings settings) throws InterruptedException, UnknownHostException {
|
public GossipService(String ipAddress, int port, String id, int logLevel,
|
||||||
|
ArrayList<GossipMember> gossipMembers, GossipSettings settings)
|
||||||
|
throws InterruptedException, UnknownHostException {
|
||||||
_gossipManager = new RandomGossipManager(ipAddress, port, id, settings, gossipMembers);
|
_gossipManager = new RandomGossipManager(ipAddress, port, id, settings, gossipMembers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,5 +62,4 @@ public class GossipService {
|
|||||||
this._gossipManager = _gossipManager;
|
this._gossipManager = _gossipManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user