YARN-6027 addendum. Fixed the broken build for YARN-5355-branch-2. Contributed by Sangjin Lee.
This commit is contained in:
parent
d996afd585
commit
16c607ca2b
@ -86,19 +86,7 @@ protected static void initialize() throws Exception {
|
|||||||
"org.apache.hadoop.yarn.server.timelineservice.storage."
|
"org.apache.hadoop.yarn.server.timelineservice.storage."
|
||||||
+ "HBaseTimelineReaderImpl");
|
+ "HBaseTimelineReaderImpl");
|
||||||
config.setInt("hfile.format.version", 3);
|
config.setInt("hfile.format.version", 3);
|
||||||
server = new TimelineReaderServer() {
|
server = new TimelineReaderServer();
|
||||||
@Override
|
|
||||||
protected void setupOptions(Configuration conf) {
|
|
||||||
// The parent code tries to use HttpServer2 from this version of
|
|
||||||
// Hadoop, but the tests are loading in HttpServer2 from
|
|
||||||
// ${hbase-compatible-hadoop.version}. This version uses Jetty 9
|
|
||||||
// while ${hbase-compatible-hadoop.version} uses Jetty 6, and there
|
|
||||||
// are many differences, including classnames and packages.
|
|
||||||
// We do nothing here, so that we don't cause a NoSuchMethodError.
|
|
||||||
// Once ${hbase-compatible-hadoop.version} is changed to Hadoop 3,
|
|
||||||
// we should be able to remove this @Override.
|
|
||||||
}
|
|
||||||
};
|
|
||||||
server.init(config);
|
server.init(config);
|
||||||
server.start();
|
server.start();
|
||||||
serverPort = server.getWebServerPort();
|
serverPort = server.getWebServerPort();
|
||||||
@ -119,11 +107,11 @@ protected ClientResponse getResponse(Client client, URI uri)
|
|||||||
ClientResponse resp =
|
ClientResponse resp =
|
||||||
client.resource(uri).accept(MediaType.APPLICATION_JSON)
|
client.resource(uri).accept(MediaType.APPLICATION_JSON)
|
||||||
.type(MediaType.APPLICATION_JSON).get(ClientResponse.class);
|
.type(MediaType.APPLICATION_JSON).get(ClientResponse.class);
|
||||||
if (resp == null || resp.getStatusInfo()
|
if (resp == null ||
|
||||||
.getStatusCode() != ClientResponse.Status.OK.getStatusCode()) {
|
resp.getClientResponseStatus() != ClientResponse.Status.OK) {
|
||||||
String msg = "";
|
String msg = "";
|
||||||
if (resp != null) {
|
if (resp != null) {
|
||||||
msg = String.valueOf(resp.getStatusInfo().getStatusCode());
|
msg = String.valueOf(resp.getClientResponseStatus());
|
||||||
}
|
}
|
||||||
throw new IOException(
|
throw new IOException(
|
||||||
"Incorrect response from timeline reader. " + "Status=" + msg);
|
"Incorrect response from timeline reader. " + "Status=" + msg);
|
||||||
@ -137,7 +125,7 @@ protected void verifyHttpResponse(Client client, URI uri, Status status) {
|
|||||||
.type(MediaType.APPLICATION_JSON).get(ClientResponse.class);
|
.type(MediaType.APPLICATION_JSON).get(ClientResponse.class);
|
||||||
assertNotNull(resp);
|
assertNotNull(resp);
|
||||||
assertTrue("Response from server should have been " + status,
|
assertTrue("Response from server should have been " + status,
|
||||||
resp.getStatusInfo().getStatusCode() == status.getStatusCode());
|
resp.getClientResponseStatus() == status);
|
||||||
System.out.println("Response is: " + resp.getEntity(String.class));
|
System.out.println("Response is: " + resp.getEntity(String.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user