diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurableBase.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurableBase.java index 146c6d844f..a705279693 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurableBase.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurableBase.java @@ -19,7 +19,6 @@ package org.apache.hadoop.conf; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import org.apache.hadoop.util.Time; @@ -31,6 +30,7 @@ import java.util.Collection; import java.util.Collections; import java.util.Map; +import java.util.Optional; /** * Utility base class for implementing the Reconfigurable interface. @@ -148,7 +148,7 @@ public void run() { } catch (ReconfigurationException e) { errorMessage = e.getCause().getMessage(); } - results.put(change, Optional.fromNullable(errorMessage)); + results.put(change, Optional.ofNullable(errorMessage)); } synchronized (parent.reconfigLock) { diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurationTaskStatus.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurationTaskStatus.java index a3a11cd54d..05ec90758e 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurationTaskStatus.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurationTaskStatus.java @@ -18,15 +18,15 @@ package org.apache.hadoop.conf; -import com.google.common.base.Optional; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.ReconfigurationUtil.PropertyChange; import java.util.Map; +import java.util.Optional; -@InterfaceAudience.Public -@InterfaceStability.Stable +@InterfaceAudience.LimitedPrivate({"HDFS", "Management Tools"}) +@InterfaceStability.Unstable public class ReconfigurationTaskStatus { long startTime; long endTime; diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestReconfiguration.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestReconfiguration.java index 610c08a584..b4dcd54e27 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestReconfiguration.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestReconfiguration.java @@ -18,7 +18,6 @@ package org.apache.hadoop.conf; -import com.google.common.base.Optional; import com.google.common.base.Supplier; import com.google.common.collect.Lists; import org.apache.hadoop.test.GenericTestUtils; @@ -44,6 +43,7 @@ import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeoutException; diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/ReconfigurationProtocolUtils.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/ReconfigurationProtocolUtils.java index 71195c8582..a48c401927 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/ReconfigurationProtocolUtils.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/ReconfigurationProtocolUtils.java @@ -19,13 +19,13 @@ package org.apache.hadoop.hdfs.protocolPB; import java.util.Map; +import java.util.Optional; import org.apache.hadoop.conf.ReconfigurationTaskStatus; import org.apache.hadoop.conf.ReconfigurationUtil.PropertyChange; import org.apache.hadoop.hdfs.protocol.proto.ReconfigurationProtocolProtos.GetReconfigurationStatusConfigChangeProto; import org.apache.hadoop.hdfs.protocol.proto.ReconfigurationProtocolProtos.GetReconfigurationStatusResponseProto; -import com.google.common.base.Optional; import com.google.common.collect.Maps; /** @@ -56,7 +56,7 @@ public static ReconfigurationTaskStatus getReconfigurationStatus( if (change.hasErrorMessage()) { errorMessage = change.getErrorMessage(); } - statusMap.put(pc, Optional.fromNullable(errorMessage)); + statusMap.put(pc, Optional.ofNullable(errorMessage)); } } return new ReconfigurationTaskStatus(startTime, endTime, statusMap); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ReconfigurationProtocolServerSideUtils.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ReconfigurationProtocolServerSideUtils.java index 9e24204563..646e51cd13 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ReconfigurationProtocolServerSideUtils.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ReconfigurationProtocolServerSideUtils.java @@ -19,6 +19,7 @@ import java.util.List; import java.util.Map; +import java.util.Optional; import org.apache.hadoop.conf.ReconfigurationTaskStatus; import org.apache.hadoop.conf.ReconfigurationUtil.PropertyChange; @@ -26,8 +27,6 @@ import org.apache.hadoop.hdfs.protocol.proto.ReconfigurationProtocolProtos.GetReconfigurationStatusResponseProto; import org.apache.hadoop.hdfs.protocol.proto.ReconfigurationProtocolProtos.ListReconfigurablePropertiesResponseProto; -import com.google.common.base.Optional; - /** * This is a server side utility class that handles * common logic to to parameter reconfiguration. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java index 6b4edd54b9..f4985a6740 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java @@ -33,11 +33,11 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.TreeSet; import java.util.concurrent.TimeUnit; import com.google.common.base.Joiner; -import com.google.common.base.Optional; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;