package com.sagacloud.utils;

import com.zillion.database.agent.ZillionAgent;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;


public class ZillionAgentProvider {
	private volatile static ZillionAgent agent;



	public static ZillionAgent GetAgent() {
		if (agent == null) {
			synchronized (ZillionAgentProvider.class) {
				if (agent == null) {
					try {
						 Configuration configuration = HBaseConfiguration.create();
//						Configuration configuration = new Configuration();
//						configuration.set("hbase.cluster.distributed", "true");
						//configuration.set("hbase.zookeeper.quorum", "zookeeper1,zookeeper2,zookeeper3");
//						configuration.set("hbase.zookeeper.quorum", OssUtils.getProperty("hbase.zookeeper.quorum"));
						agent = new ZillionAgent(configuration,"data-platform-3");
						agent.Start();
					} catch (Exception e) {
						e.printStackTrace();
					}
				}
			}
		}
		return agent;
	}
}
