MINOR: add DEFAULT_PORT for Trogdor Agent and Coordinator (#4674)

Add a DEFAULT_PORT constant for the Trogdor Agent and Coordinator.

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>
This commit is contained in:
Colin Patrick McCabe 2018-03-13 06:15:44 -07:00 committed by Rajini Sivaram
parent 0c00aa0983
commit ec9e8110e3
3 changed files with 9 additions and 2 deletions

View File

@ -44,6 +44,8 @@ import static net.sourceforge.argparse4j.impl.Arguments.store;
public final class Agent {
private static final Logger log = LoggerFactory.getLogger(Agent.class);
public static final int DEFAULT_PORT = 8888;
/**
* The time at which this server was started.
*/

View File

@ -17,6 +17,9 @@
package org.apache.kafka.trogdor.common;
import org.apache.kafka.trogdor.agent.Agent;
import org.apache.kafka.trogdor.coordinator.Coordinator;
import java.util.Set;
/**
@ -34,11 +37,11 @@ public interface Node {
}
public static int getTrogdorAgentPort(Node node) {
return getIntConfig(node, Platform.Config.TROGDOR_AGENT_PORT, 0);
return getIntConfig(node, Platform.Config.TROGDOR_AGENT_PORT, Agent.DEFAULT_PORT);
}
public static int getTrogdorCoordinatorPort(Node node) {
return getIntConfig(node, Platform.Config.TROGDOR_COORDINATOR_PORT, 0);
return getIntConfig(node, Platform.Config.TROGDOR_COORDINATOR_PORT, Coordinator.DEFAULT_PORT);
}
}

View File

@ -45,6 +45,8 @@ import static net.sourceforge.argparse4j.impl.Arguments.store;
public final class Coordinator {
private static final Logger log = LoggerFactory.getLogger(Coordinator.class);
public static final int DEFAULT_PORT = 8889;
/**
* The start time of the Coordinator in milliseconds.
*/