HDFS-13127. Fix TestContainerStateManager and TestOzoneConfigurationFields. Contributed by Mukul Kumar Singh.
This commit is contained in:
parent
443425a5d9
commit
3cf07b43bc
|
@ -89,9 +89,7 @@ import static java.net.HttpURLConnection.HTTP_OK;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ozone Client REST protocol implementation. It uses REST protocol to
|
* Ozone Client REST protocol implementation. It uses REST protocol to
|
||||||
* connect to Ozone Handler that executes client calls. RestClient uses
|
* connect to Ozone Handler that executes client calls.
|
||||||
* <code>ozone.rest.servers</code> and <code>ozone.rest.client.port</code>
|
|
||||||
* to discover Ozone Rest Server.
|
|
||||||
*/
|
*/
|
||||||
public class RestClient implements ClientProtocol {
|
public class RestClient implements ClientProtocol {
|
||||||
|
|
||||||
|
|
|
@ -415,8 +415,7 @@ public class ContainerStateManager implements Closeable {
|
||||||
// Get the container with space to meet our request.
|
// Get the container with space to meet our request.
|
||||||
for (ContainerID id : searchSet) {
|
for (ContainerID id : searchSet) {
|
||||||
ContainerInfo containerInfo = containers.getContainerInfo(id.getId());
|
ContainerInfo containerInfo = containers.getContainerInfo(id.getId());
|
||||||
if ((containerInfo.getAllocatedBytes() <= this.containerSize) &&
|
if (containerInfo.getAllocatedBytes() + size <= this.containerSize) {
|
||||||
(containerInfo.getAllocatedBytes() <= size)) {
|
|
||||||
containerInfo.updateLastUsedTime();
|
containerInfo.updateLastUsedTime();
|
||||||
|
|
||||||
ContainerState key = new ContainerState(owner,
|
ContainerState key = new ContainerState(owner,
|
||||||
|
|
|
@ -1204,25 +1204,6 @@
|
||||||
percentage in float notation (X.Yf), with 1.0f meaning 100%.
|
percentage in float notation (X.Yf), with 1.0f meaning 100%.
|
||||||
</description>
|
</description>
|
||||||
</property>
|
</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>
|
<property>
|
||||||
<name>ozone.rest.client.http.connection.max</name>
|
<name>ozone.rest.client.http.connection.max</name>
|
||||||
<value>100</value>
|
<value>100</value>
|
||||||
|
|
|
@ -159,11 +159,13 @@ public class TestContainerStateManager {
|
||||||
scmContainerMapping.updateContainerState(container2,
|
scmContainerMapping.updateContainerState(container2,
|
||||||
OzoneProtos.LifeCycleEvent.CREATED);
|
OzoneProtos.LifeCycleEvent.CREATED);
|
||||||
|
|
||||||
|
// space has already been allocated in container1, now container 2 should
|
||||||
|
// be chosen.
|
||||||
info = stateManager
|
info = stateManager
|
||||||
.getMatchingContainer(OzoneConsts.GB * 3, containerOwner,
|
.getMatchingContainer(OzoneConsts.GB * 3, containerOwner,
|
||||||
xceiverClientManager.getType(), xceiverClientManager.getFactor(),
|
xceiverClientManager.getType(), xceiverClientManager.getFactor(),
|
||||||
OzoneProtos.LifeCycleState.OPEN);
|
OzoneProtos.LifeCycleState.OPEN);
|
||||||
Assert.assertEquals(container1, info.getContainerName());
|
Assert.assertEquals(container2, info.getContainerName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue