return null;
if (!(node.hasHadoopInfo()))
return null;
HadoopCallTreeNode parent = node.getParent();
JavelinConfig config = new JavelinConfig();
StringBuffer jvnBuffer = new StringBuffer();
Invocation callee = node.getInvocation();
// RPC�Ȃ̂ŌĂяo�����͕K��NULL�ɂȂ�
if (parent != null)
{
return null;
}
if (callee == null)
{
return null;
}
// �������烁�b�Z�[�W�쐬�J�n
if (node.getHadoopInfo().hasActions() || node.getHadoopInfo().hasStatuses())
{
// heartbeat()��Call��Return���t�]�����ĕ\������
if (messageType == ID_CALL)
{
if (!node.getHadoopInfo().hasStatuses())
return null;
jvnBuffer.append(MESSAGE_TYPES[ID_RETURN]);
}
else
{
if (!node.getHadoopInfo().hasActions())
return null;
jvnBuffer.append(MESSAGE_TYPES[ID_CALL]);
}
SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_PATTERN);
jvnBuffer.append(",");
jvnBuffer.append(dateFormat.format(time));
// ��O�̏����o���͍l�����Ȃ�
// Phase
addToJvnBuffer(getType(node.getHadoopInfo(), messageType), jvnBuffer);
// �Ăяo�����z�X�g��
addToJvnBuffer(node.getHadoopInfo().getHost(), jvnBuffer);
// �Ăяo����I�u�W�F�N�gID
addToJvnBuffer("", jvnBuffer);
// �Ăяo����IP
addToJvnBuffer("", jvnBuffer);
// "JobTracker"
addToJvnBuffer("JobTracker", jvnBuffer);
// �Ăяo�����I�u�W�F�N�gID
addToJvnBuffer("", jvnBuffer);
// ���f�B�t�@�C�A
addToJvnBuffer("", jvnBuffer);
// TT->JT�̏ꍇ
if (messageType == ID_CALL)
{
// �X���b�hID�ɍŏ��Ɍ��������W���uID��ݒ�
for (HadoopTaskStatus stat : node.getHadoopInfo().getTaskStatuses())
{
addToJvnBuffer(stat.getJobID(), jvnBuffer);
jvnBuffer.append(NEW_LINE);
break;
}
// �߂�l�o�͂��ݒ肳��Ă���ꍇ
if (config.isLogReturn())
{
String retVal = makeTaskStatus(node.getHadoopInfo().getTaskStatuses());
// �o�͑Ώۂ̃��b�Z�[�W�������ꍇ��null��Ԃ�
if (null == retVal)
return null;
jvnBuffer.append(retVal);
}
}
if (messageType == ID_RETURN)
{
// �X���b�hID�ɍŏ��Ɍ��������W���uID��ݒ�
for (HadoopAction action : node.getHadoopInfo().getTaskTrackerActions())
{
addToJvnBuffer(action.getJobID(), jvnBuffer);
jvnBuffer.append(NEW_LINE);
break;
}
// �����o�͂��ݒ肳��Ă���ꍇ
if (config.isLogArgs())
{
String retVal = makeHeartbeatResponse(node.getHadoopInfo().getTaskTrackerActions());
// �o�͑Ώۂ̃��b�Z�[�W�������ꍇ��null��Ԃ�
if (null == retVal)
return null;
jvnBuffer.append(retVal);
}
}
}
// �W���u�����A�����A��~�̏ꍇ
else if (node.getHadoopInfo().hasSubmitInfo() ||
node.getHadoopInfo().hasCompleteInfo() ||
node.getHadoopInfo().hasKilledInfo())
{
String command = "";
// submitJob()�̃��^�[���͏o�͂��Ȃ�
if (node.getHadoopInfo().hasSubmitInfo())
{
if (messageType == ID_RETURN)
return null;
else
command = "SubmitJob";
}
// completedInfo�̃R�[���͏o�͂��Ȃ�
if (node.getHadoopInfo().hasCompleteInfo())
{
if (messageType == ID_CALL)
return null;
else
command = "JobCompleted";
}
// killedInfo�̃��^�[���͏o�͂��Ȃ�
if (node.getHadoopInfo().hasKilledInfo())
{
if (messageType == ID_RETURN)
return null;
else
command = "KillJob";
}
jvnBuffer.append(MESSAGE_TYPES[messageType]);
SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_PATTERN);
jvnBuffer.append(",");
jvnBuffer.append(dateFormat.format(time));
// ��O�̏����o���͍l�����Ȃ�
// �Ăяo����
addToJvnBuffer(command, jvnBuffer);
// "JobTracker"
addToJvnBuffer("JobTracker", jvnBuffer);
// �Ăяo����I�u�W�F�N�gID
addToJvnBuffer("", jvnBuffer);
// �Ăяo����IP?
addToJvnBuffer("", jvnBuffer);
// �Ăяo�����z�X�g��
addToJvnBuffer("root", jvnBuffer);
// �Ăяo�����I�u�W�F�N�gID
addToJvnBuffer("", jvnBuffer);
// ���f�B�t�@�C�A
addToJvnBuffer("", jvnBuffer);
// �W���uID
String jobID;
if (node.getHadoopInfo().hasSubmitInfo())
jobID = node.getHadoopInfo().getSubmitJobID();
else if (node.getHadoopInfo().hasCompleteInfo())
jobID = node.getHadoopInfo().getCompleteJobID();
else
jobID = node.getHadoopInfo().getKilledJobID();
addToJvnBuffer(jobID, jvnBuffer);
jvnBuffer.append(NEW_LINE);
// Hadoop�ŗL���������o��
if (messageType == ID_CALL)
{
// �����o�͂��ݒ肳��Ă�ꍇ
if (config.isLogArgs())
{
// �W���uID���o��
jvnBuffer.append(JAVELIN_ARGS_START);
jvnBuffer.append(NEW_LINE);
jvnBuffer.append("JobID : " + jobID);
jvnBuffer.append(NEW_LINE);
jvnBuffer.append(JAVELIN_ARGS_END);
jvnBuffer.append(NEW_LINE);
}
}
else if (messageType == ID_RETURN)
{
// �߂�l�o�͂��ݒ肳��Ă�ꍇ
if (config.isLogReturn())
{
// �W���uID���o��
jvnBuffer.append(JAVELIN_RETURN_START);
jvnBuffer.append(NEW_LINE);
jvnBuffer.append("JobID : " + jobID);
jvnBuffer.append(NEW_LINE);
jvnBuffer.append(JAVELIN_RETURN_END);
jvnBuffer.append(NEW_LINE);
}
}
}
if (config.isLogMBeanInfo() || config.isLogMBeanInfoRoot())
{
if (messageType == ID_CALL)
{
// VM���s���
VMStatus startStatus = node.getStartVmStatus();