// HDFS�S�̂̋e�ʁA�g�p�ʂ��擾����
Number dfsRemaining = HadoopMeasurementInfo.getInstance().getCapacityRemaining();
if (dfsRemaining != null)
{
ResourceItem dfsRemainingItem =
createResourceItem(nameNodeInfoObjectName, PREFIX_HDFS
+ HDFS_ALL
+ SUFFIX_DFSREMAINING,
dfsRemaining,
ItemType.ITEMTYPE_LONG);
returnList.add(dfsRemainingItem);
}
Number dfsUsed = HadoopMeasurementInfo.getInstance().getCapacityUsed();
if (dfsUsed != null)
{
ResourceItem dfsUsedItem =
createResourceItem(nameNodeInfoObjectName, PREFIX_HDFS
+ HDFS_ALL + SUFFIX_DFSUSED,
dfsUsed,
ItemType.ITEMTYPE_LONG);
returnList.add(dfsUsedItem);
}
Map<String, DfsNodeInfo> liveNodes = HadoopMeasurementInfo.getInstance().getDfsNodeInfo();
List<String> inputNames = new ArrayList<String>();
inputNames.addAll(liveNodes.keySet());
List<String> resolvedNames = HadoopMeasurementInfo.getInstance().resolve(inputNames);
for (int index = 0; index < inputNames.size(); index++)
{
String serverName = inputNames.get(index);
String rackName = resolvedNames.get(index);
StringBuilder builder = new StringBuilder();
builder.append(PREFIX_HDFS);
builder.append("/");
builder.append(serverName);
builder.append(SUFFIX_NODEINFO);
String nodeInfoItemName = builder.toString();
String nodeInfoValue = "{\"rack-name\":\"" + rackName + "\"}";
ResourceItem datanodeDfsUsedItem =
createResourceItem(nameNodeInfoObjectName,
nodeInfoItemName,
nodeInfoValue,
ItemType.ITEMTYPE_LONG);
returnList.add(datanodeDfsUsedItem);
}
for (Entry<String, DfsNodeInfo> liveNode : liveNodes.entrySet())
{
String hostname = liveNode.getKey();
long datanodeDfsUsed = liveNode.getValue().getDfsUsed();
long datanodeDfsTotal = liveNode.getValue().getCapacity();
// ItemName �ƂȂ镶����
StringBuilder builder = new StringBuilder();
builder.append(PREFIX_HDFS);
builder.append("/");
builder.append(hostname);
String dfsRemainingItemName = builder.toString() + SUFFIX_DFSREMAINING;
String dfsUsedItemName = builder.toString() + SUFFIX_DFSUSED;
ResourceItem datanodeDfsRemainingItem =
createResourceItem(nameNodeInfoObjectName,
dfsRemainingItemName,
(datanodeDfsTotal - datanodeDfsUsed),
ItemType.ITEMTYPE_LONG);
ResourceItem datanodeDfsUsedItem =
createResourceItem(nameNodeInfoObjectName,
dfsUsedItemName,
datanodeDfsUsed,
ItemType.ITEMTYPE_LONG);
returnList.add(datanodeDfsRemainingItem);