Class ReplaceDatanodeOnFailure
java.lang.Object
org.apache.hadoop.hdfs.protocol.datatransfer.ReplaceDatanodeOnFailure
The setting of replace-datanode-on-failure feature.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe replacement policies -
Constructor Summary
ConstructorsConstructorDescriptionReplaceDatanodeOnFailure(ReplaceDatanodeOnFailure.Policy policy, boolean bestEffort) -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck if the feature is enabled.static ReplaceDatanodeOnFailureget(org.apache.hadoop.conf.Configuration conf) Get the setting from configuration.booleanBest 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.booleansatisfy(short replication, DatanodeInfo[] existings, boolean isAppend, boolean isHflushed) Does it need a replacement according to the policy?toString()static voidwrite(ReplaceDatanodeOnFailure.Policy policy, boolean bestEffort, org.apache.hadoop.conf.Configuration conf) Write the setting to configuration.
-
Constructor Details
-
ReplaceDatanodeOnFailure
-
-
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
-
get
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.
-