Class ReplaceDatanodeOnFailure

java.lang.Object
org.apache.hadoop.hdfs.protocol.datatransfer.ReplaceDatanodeOnFailure

@Private @Evolving public class ReplaceDatanodeOnFailure extends Object
The setting of replace-datanode-on-failure feature.
  • Constructor Details

  • Method Details

    • checkEnabled

      public void checkEnabled()
      Check if the feature is enabled.
    • isBestEffort

      public boolean isBestEffort()
      Best effort means that the client will try to replace the failed datanode (provided that the policy is satisfied), however, it will continue the write operation in case that the datanode replacement also fails.
      Returns:
      Suppose the datanode replacement fails. false: An exception should be thrown so that the write will fail. true : The write should be resumed with the remaining datandoes.
    • satisfy

      public boolean satisfy(short replication, DatanodeInfo[] existings, boolean isAppend, boolean isHflushed)
      Does it need a replacement according to the policy?
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • get

      public static ReplaceDatanodeOnFailure get(org.apache.hadoop.conf.Configuration conf)
      Get the setting from configuration.
    • write

      public static void write(ReplaceDatanodeOnFailure.Policy policy, boolean bestEffort, org.apache.hadoop.conf.Configuration conf)
      Write the setting to configuration.