瀏覽代碼

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

Anu Engineer 7 年之前
父節點
當前提交
3cf07b43bc

+ 1 - 3
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/ozone/client/rest/RestClient.java

@@ -89,9 +89,7 @@ import static java.net.HttpURLConnection.HTTP_OK;
 
 /**
  * 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 {
 

+ 1 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerStateManager.java

@@ -415,8 +415,7 @@ public class ContainerStateManager implements Closeable {
     // 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,

+ 0 - 19
hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml

@@ -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>

+ 3 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/container/TestContainerStateManager.java

@@ -159,11 +159,13 @@ public class TestContainerStateManager {
     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