}
private ClusterBlueprint generateBlueprint() {
//return SerialUtils.getObjectByJsonString(ClusterBlueprint.class, CommonUtil.readJsonFile("simple_blueprint.json"));
ClusterBlueprint blueprint = new ClusterBlueprint();
blueprint.setName("cluster01");
HadoopStack hadoopStack = new HadoopStack();
hadoopStack.setDistro("CDH-5.0.2");
blueprint.setHadoopStack(hadoopStack);
List<NodeGroupInfo> groups = new ArrayList<NodeGroupInfo>();
NodeGroupInfo group01 = new NodeGroupInfo();
group01.setName("master");
List<String> roles01 = new ArrayList<String>();
roles01.add("HDFS_NAMENODE");
roles01.add("HDFS_SECONDARY_NAMENODE");
roles01.add("YARN_RESOURCE_MANAGER");
roles01.add("YARN_JOB_HISTORY");
group01.setRoles(roles01);
group01.setInstanceNum(1);
Map<String, Object> configs = new HashMap<String, Object>();
Map<String, String> nnConfig = new HashMap<String, String>();
nnConfig.put("namenode_java_heapsize", "1024");
configs.put("HDFS_NAMENODE", nnConfig);
Map<String, String> snnConfig = new HashMap<String, String>();
snnConfig.put("secondary_namenode_java_heapsize", "1024");
configs.put("HDFS_SECONDARY_NAMENODE", snnConfig);
group01.setConfiguration(configs);
NodeInfo node01 = new NodeInfo();
node01.setRack("/rack01");
List<NodeInfo> nodes01 = new ArrayList<>();
nodes01.add(node01);
group01.setNodes(nodes01);
NodeGroupInfo group02 = new NodeGroupInfo();
group02.setName("worker");
List<String> roles02 = new ArrayList<>();
roles02.add("HDFS_DATANODE");
roles02.add("YARN_NODE_MANAGER");
group02.setRoles(roles02);
Map<String, Object> configs02 = new HashMap<String, Object>();
Map<String, String> dnConfig = new HashMap<String, String>();
dnConfig.put("dfs_datanode_failed_volumes_tolerated", "2");
configs02.put("HDFS_DATANODE", dnConfig);
group02.setConfiguration(configs02);
NodeInfo node02 = new NodeInfo();
node02.setRack("/rack02");
List<NodeInfo> nodes02 = new ArrayList<>();
nodes02.add(node02);
group02.setNodes(nodes02);
group02.setInstanceNum(3);
groups.add(group01);
groups.add(group02);
blueprint.setNodeGroups(groups);
Map<String, Object> clusterConfig = new HashMap<String, Object>();
Map<String, String> hdfsConfig = new HashMap<String, String>();
hdfsConfig.put("hdfs_namenode_health_enabled", "true");
clusterConfig.put("HDFS", hdfsConfig);
Map<String, String> snnConfig02 = new HashMap<String, String>();
snnConfig02.put("secondarynamenode_java_opts", "-XX:+UseParNewGC");
clusterConfig.put("HDFS_SECONDARY_NAMENODE", snnConfig02);
blueprint.setConfiguration(clusterConfig);
return blueprint;
}