Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@
<suppress checks="MagicNumberCheck" files=".*Test\.java"/>
<!-- Will not have a private constructor, because it is InterfaceAudience.Public -->
<suppress checks="HideUtilityClassConstructor" files="org.apache.hadoop.hbase.util.ByteRangeUtils"/>
<suppress checks="InnerAssignment" files="org.apache.hadoop.hbase.rest.PerformanceEvaluation"/>
<suppress checks="EmptyBlock" files="org.apache.hadoop.hbase.rest.PerformanceEvaluation"/>
</suppressions>
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import com.sun.jersey.spi.container.servlet.ServletContainer;

public class HBaseRESTTestingUtility {

private static final Log LOG = LogFactory.getLog(HBaseRESTTestingUtility.class);

private int testServletPort;
Expand Down Expand Up @@ -62,7 +61,7 @@ public void startServletContainer(Configuration conf) throws Exception {
"jetty");

LOG.info("configured " + ServletContainer.class.getName());

// set up Jetty and run the embedded server
server = new Server(0);
server.setSendServerVersion(false);
Expand All @@ -86,17 +85,19 @@ public void startServletContainer(Configuration conf) throws Exception {
// get the port
testServletPort = server.getConnectors()[0].getLocalPort();

LOG.info("started " + server.getClass().getName() + " on port " +
LOG.info("started " + server.getClass().getName() + " on port " +
testServletPort);
}

public void shutdownServletContainer() {
if (server != null) try {
server.stop();
server = null;
RESTServlet.stop();
} catch (Exception e) {
LOG.warn(StringUtils.stringifyException(e));
if (server != null) {
try {
server.stop();
server = null;
RESTServlet.stop();
} catch (Exception e) {
LOG.warn(StringUtils.stringifyException(e));
}
}
}
}
Loading