欢迎投稿

今日深度:

简单的hbase监控程序,用于监测hbase集群是否正常运行--66,hbase--66

简单的hbase监控程序,用于监测hbase集群是否正常运行--66,hbase--66


package moniter;

import java.io.IOException;

public class hbasemoniter_new {
	public final static String url = "tcp://dsdfsd/sdfs";
	// public static String config = null;
	// public static String service_name = null;

	public static String config = "C:\\Users\\dgffg.xml";
	public static String service_name = "drgrei";

	public static void main(String[] args) throws Exception {
		if (config == null || config.equals("") || service_name == null
				|| service_name.equals("")) {
			return;
		}
		asdnit.init(config);
		get("test", "04213fr21r312123fe50");
	}

	public static void get(String tablename, String rowkey) throws IOException {
		IHbaseApi service = null;
		service = tableaaa.create(IHbaseApi.class, url);
		String table = tablename;
		String rowk = rowkey;
		int retry = 10;
		for (int i = 0; i < retry; i++) {
			try {
				service.tableaa(table, rowk);
			} catch (Exception e) {
				System.out.println("Moniter:false");
				System.exit(1);
			}
		}
		System.out.println("Moniter:true");
		System.exit(0);
	}
}


www.htsjk.Com true http://www.htsjk.com/hbase/26788.html NewsArticle 简单的hbase监控程序,用于监测hbase集群是否正常运行--66,hbase--66 package moniter;import java.io.IOException;public class hbasemoniter_new {public final static String url = "tcp://dsdfsd/sdfs";// public static String co...
相关文章
    暂无相关文章
评论暂时关闭