protected void addNode(NodeEvent event) {
        String nodeName = event.getNodeName();
        String url = event.getUrl();
        String username = event.getUsername();
        String password = event.getPassword();

        Map<String, DataSource> map = highAvailableDataSource.getDataSourceMap();
        if (nodeName == null || nodeName.isEmpty()) {
            return;
        }
        LOG.info("Adding Node " + nodeName + "[url: " + url + ", username: " + username + "].");
        if (map.containsKey(nodeName)) {
            cancelBlacklistNode(nodeName);
            return;
        }
        DruidDataSource dataSource = null;
        try {
            dataSource = DataSourceCreator.create(nodeName, url, username,
                    password, this.highAvailableDataSource);
            map.put(nodeName, dataSource);
            LOG.info("Creating Node " + nodeName + "[url: " + url + ", username: " + username + "].");
        } catch (Exception e) {
            LOG.error("Can NOT create DataSource " + nodeName + ". IGNORE IT.", e);
            JdbcUtils.close(dataSource);
        }
    }
@Test
    public void testAddNode() {
        String url = "jdbc:derby:memory:foo;create=true";
        String name = "foo";
        addNode(url, name);
        String targetUrl = ((DruidDataSource) haDataSource.getDataSourceMap().get(name)).getUrl();
        assertEquals(1, haDataSource.getDataSourceMap().size());
        assertEquals(url, targetUrl);
    }