if (baseDir == null) {
baseDir = SysProperties.getBaseDir();
}
dbName = server.checkKeyAndGetDatabaseName(dbName);
ConnectionInfo ci = new HBaseConnectionInfo(originalURL, dbName);
if (baseDir != null) {
ci.setBaseDir(baseDir);
}
if (server.getIfExists()) {
ci.setProperty("IFEXISTS", "TRUE");
}
ci.setUserName(userName);
ci.setUserPasswordHash(userPasswordHash);
ci.setFilePasswordHash(filePasswordHash);
ci.readProperties(originalProperties);
originalProperties.setProperty("user", userName);
if (userPasswordHash != null)
originalProperties.put("_userPasswordHash_", userPasswordHash);
if (filePasswordHash != null)
originalProperties.put("_filePasswordHash_", filePasswordHash);
if (server.getMaster() != null)
ci.setProperty("SERVER_TYPE", "M");
else if (server.getRegionServer() != null)
ci.setProperty("SERVER_TYPE", "RS");
HBaseSession session = (HBaseSession) HBaseDatabaseEngine.getInstance().createSession(ci);
session.setMaster(server.getMaster());
session.setRegionServer(server.getRegionServer());
session.setOriginalProperties(originalProperties);