private void registerPolarisService(ProviderConfig config, InstanceRegisterRequest service) {
        providerAPI.register(service);
        if (service.getTtl() != null) {
            ScheduledFuture<?> scheduledFuture = heartbeatExecutor.scheduleAtFixedRate(() -> heartbeatPolaris(service), 0, properties.getHeartbeatInterval(), TimeUnit.MILLISECONDS);
            ScheduledFuture oldFuture = heartbeatFutures.put(buildUniqueName(config, service.getProtocol()), scheduledFuture);
            if (oldFuture != null) {
                oldFuture.cancel(true);
            }
        }
    }
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