@Override
    public void init() {
        if (providerAPI != null) {
            return;
        }

        ConfigurationImpl configuration = new ConfigurationImpl();
        //init configuration
        configuration.setDefault();
        ServerConnectorConfigImpl serverConnector = configuration.getGlobal().getServerConnector();
        serverConnector.setAddresses(Arrays.asList(registryConfig.getAddress()));
        serverConnector.setConnectTimeout((long) registryConfig.getConnectTimeout());
        serverConnector.setProtocol(properties.getConnectorProtocol());

        providerAPI = DiscoveryAPIFactory.createProviderAPIByConfig(configuration);
        consumerAPI = DiscoveryAPIFactory.createConsumerAPIByConfig(configuration);

        int coreSize = properties.getHeartbeatCoreSize();
        heartbeatExecutor = Executors.newScheduledThreadPool(coreSize);

    }
the main logic of polaris registry, similar to consul

@author <a href=mailto:bner666@gmail.com>ZhangLibin</a>
registry/registry-polaris/src/main/java/com/alipay/sofa/rpc/registry/polaris/PolarisRegistry.java