HDFS-13127. Fix TestContainerStateManager and TestOzoneConfigurationFields. Contributed by Mukul Kumar Singh.

This commit is contained in:
Anu Engineer 2018-02-09 15:23:13 -08:00 committed by Owen O'Malley
parent 443425a5d9
commit 3cf07b43bc
4 changed files with 5 additions and 25 deletions

View File

@ -89,9 +89,7 @@
/**
* Ozone Client REST protocol implementation. It uses REST protocol to
* connect to Ozone Handler that executes client calls. RestClient uses
* <code>ozone.rest.servers</code> and <code>ozone.rest.client.port</code>
* to discover Ozone Rest Server.
* connect to Ozone Handler that executes client calls.
*/
public class RestClient implements ClientProtocol {

View File

@ -415,8 +415,7 @@ private ContainerInfo findContainerWithSpace(long size,
// Get the container with space to meet our request.
for (ContainerID id : searchSet) {
ContainerInfo containerInfo = containers.getContainerInfo(id.getId());
if ((containerInfo.getAllocatedBytes() <= this.containerSize) &&
(containerInfo.getAllocatedBytes() <= size)) {
if (containerInfo.getAllocatedBytes() + size <= this.containerSize) {
containerInfo.updateLastUsedTime();
ContainerState key = new ContainerState(owner,

View File

@ -1204,25 +1204,6 @@
percentage in float notation (X.Yf), with 1.0f meaning 100%.
</description>
</property>
<property>
<name>ozone.rest.servers</name>
<value></value>
<tag>OZONE, CLIENT</tag>
<description>
The REST server hostnames to connect, comma separated list of host
(typically datanodes) where Ozone REST handler are running.
</description>
</property>
<property>
<name>ozone.rest.client.port</name>
<value>9864</value>
<tag>OZONE, CLIENT</tag>
<description>
Port used by client to connect to Ozone REST server. When a datanode
is configured to run Ozone REST handler, this port typically points to
datanode info port.
</description>
</property>
<property>
<name>ozone.rest.client.http.connection.max</name>
<value>100</value>

View File

@ -159,11 +159,13 @@ public void testGetMatchingContainer() throws IOException {
scmContainerMapping.updateContainerState(container2,
OzoneProtos.LifeCycleEvent.CREATED);
// space has already been allocated in container1, now container 2 should
// be chosen.
info = stateManager
.getMatchingContainer(OzoneConsts.GB * 3, containerOwner,
xceiverClientManager.getType(), xceiverClientManager.getFactor(),
OzoneProtos.LifeCycleState.OPEN);
Assert.assertEquals(container1, info.getContainerName());
Assert.assertEquals(container2, info.getContainerName());
}
@Test