⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dispatchersurveillant.java

📁 分布式计算平台P2HP-1的源代码;P2HP-1是基于P2P的高性能计算平台
💻 JAVA
字号:
/*
 * Created on 2004-10-12
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package cn.edu.hust.cgcl.biogrid.dispatcher;

/**
 * @author Administrator
 *This class is to show the detail information in the dispatcher node
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class DispatcherSurveillant extends Thread{
	DispatcherInfo d_info=null;
	private boolean isActive=true;
public DispatcherSurveillant(DispatcherInfo dinfo){
	d_info=dinfo;
}
public void run(){
	System.out.println("\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
	System.out.println("ID\tIp\t\tfirstMonitorID\tfirstMonitorIp\tsecondMonitorID\tsecondMonitorIp\tjobCount\tpcLoad\tworkerCount\tidleWorkerCount\tcanAcceptJob");
	//while(isActive){
		//d_info.dispatcherUpdate();
		System.out.print(d_info.getDispatcherId()+"\t");
		System.out.print(d_info.getDispatcherIp()+"\t");
		System.out.print(d_info.getFirstMonitorId()+"\t\t");
		System.out.print(d_info.getFirstMonitorIp()+"\t");
		System.out.print(d_info.getSecondMonitorId()+"\t\t");
		System.out.print(d_info.getSecondMonitorIp()+"\t");
		System.out.print(d_info.getJobCount()+"\t");
		System.out.print(d_info.getDispatcherLoad()+"\t");
		System.out.print(d_info.getWorkerCount()+"\t");
		System.out.print(d_info.getIdleWorkerCount()+"\t");
		System.out.println(d_info.getCanAcceptJob()+"\t");
		try
        {
            Thread.sleep(2000);
            
        }
        catch (InterruptedException e)
        {
        	if(!isActive) return;
        //get back to work
        }
	//}
}
public void terminated(){
	isActive=false;
	System.out.println("\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
	
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -