// Path: src/main/java/hrider/config/ConnectionDetails.java
// public class ConnectionDetails implements Serializable {
// 
//     //region Constants
//     private static final long serialVersionUID = -5808921673890223877L;
//     //endregion
// 
//     //region Variables
//     private ServerDetails zookeeper;
//     //endregion
// 
//     //region Public Properties
//     public ServerDetails getZookeeper() {
//         return this.zookeeper;
//     }
// 
//     public void setZookeeper(ServerDetails zookeeper) {
//         this.zookeeper = zookeeper;
//     }
//     //endregion
// 
//     //region Public Methods
//     public boolean canConnect() {
//         Boolean result = RunnableAction.runAndWait(
//             this.zookeeper.getHost(), new Action<Boolean>() {
// 
//             @Override
//             public Boolean run() throws IOException {
//                 ConnectionManager.create(ConnectionDetails.this);
//                 return true;
//             }
//         }, GlobalConfig.instance().getConnectionCheckTimeout());
// 
//         return result != null ? result : false;
//     }
// 
//     public Configuration createConfig() {
//         Configuration config = HBaseConfiguration.create();
//         config.set("hbase.zookeeper.quorum", this.zookeeper.getHost());
//         config.set("hbase.zookeeper.property.clientPort", this.zookeeper.getPort());
//         config.set("hbase.client.retries.number", "3");
//         config.set("hbase.rpc.timeout","900000");
//         //config.set("zookeeper.znode.parent","/hbase-unsecure");
// 
// //        config.set("hbase.security.authentication", "kerberos");
// //        config.set("hbase.rpc.engine", "org.apache.hadoop.hbase.ipc.SecureRpcEngine");
// 
//         return config;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (obj instanceof ConnectionDetails) {
//             ConnectionDetails details = (ConnectionDetails)obj;
//             return this.zookeeper.equals(details.zookeeper);
//         }
//         return false;
//     }
// 
//     @Override
//     public int hashCode() {
//         return this.zookeeper.hashCode();
//     }
//     //endregion
// }


import hrider.config.ConnectionDetails;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
package hrider.hbase;



public class ConnectionManager {

    private static Map<ConnectionDetails, Connection> connections;

    private ConnectionManager() {
    }

    static {
        connections = new HashMap<ConnectionDetails, Connection>();
    }

// Path: src/main/java/hrider/config/ConnectionDetails.java
// public class ConnectionDetails implements Serializable {
// 
//     //region Constants
//     private static final long serialVersionUID = -5808921673890223877L;
//     //endregion
// 
//     //region Variables
//     private ServerDetails zookeeper;
//     //endregion
// 
//     //region Public Properties
//     public ServerDetails getZookeeper() {
//         return this.zookeeper;
//     }
// 
//     public void setZookeeper(ServerDetails zookeeper) {
//         this.zookeeper = zookeeper;
//     }
//     //endregion
// 
//     //region Public Methods
//     public boolean canConnect() {
//         Boolean result = RunnableAction.runAndWait(
//             this.zookeeper.getHost(), new Action<Boolean>() {
// 
//             @Override
//             public Boolean run() throws IOException {
//                 ConnectionManager.create(ConnectionDetails.this);
//                 return true;
//             }
//         }, GlobalConfig.instance().getConnectionCheckTimeout());
// 
//         return result != null ? result : false;
//     }
// 
//     public Configuration createConfig() {
//         Configuration config = HBaseConfiguration.create();
//         config.set("hbase.zookeeper.quorum", this.zookeeper.getHost());
//         config.set("hbase.zookeeper.property.clientPort", this.zookeeper.getPort());
//         config.set("hbase.client.retries.number", "3");
//         config.set("hbase.rpc.timeout","900000");
//         //config.set("zookeeper.znode.parent","/hbase-unsecure");
// 
// //        config.set("hbase.security.authentication", "kerberos");
// //        config.set("hbase.rpc.engine", "org.apache.hadoop.hbase.ipc.SecureRpcEngine");
// 
//         return config;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (obj instanceof ConnectionDetails) {
//             ConnectionDetails details = (ConnectionDetails)obj;
//             return this.zookeeper.equals(details.zookeeper);
//         }
//         return false;
//     }
// 
//     @Override
//     public int hashCode() {
//         return this.zookeeper.hashCode();
//     }
//     //endregion
// }


// Path: src/main/java/hrider/hbase/ConnectionManager.java
import hrider.config.ConnectionDetails;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

package hrider.hbase;



public class ConnectionManager {

    private static Map<ConnectionDetails, Connection> connections;

    private ConnectionManager() {
    }

    static {
        connections = new HashMap<ConnectionDetails, Connection>();
    }

    public static Connection create(ConnectionDetails details) throws IOException {