Package org.apache.hadoop.hdfs.util
Class CombinedHostsFileWriter
java.lang.Object
org.apache.hadoop.hdfs.util.CombinedHostsFileWriter
Writer support for JSON-based datanode configuration, an alternative format
to the exclude/include files configuration.
The JSON file format defines the array of elements where each element
in the array describes the properties of a datanode. The properties of
a datanode is defined by
DatanodeAdminProperties. For example,
[
{"hostName": "host1"},
{"hostName": "host2", "port": 50, "upgradeDomain": "ud0"},
{"hostName": "host3", "port": 0, "adminState": "DECOMMISSIONED"}
]-
Method Summary
Modifier and TypeMethodDescriptionstatic voidwriteFile(String hostsFile, Set<DatanodeAdminProperties> allDNs) Serialize a set of DatanodeAdminProperties to a json file.
-
Method Details
-
writeFile
public static void writeFile(String hostsFile, Set<DatanodeAdminProperties> allDNs) throws IOException Serialize a set of DatanodeAdminProperties to a json file.- Parameters:
hostsFile- the json file name.allDNs- the set of DatanodeAdminProperties- Throws:
IOException
-