public synchronized <T> T getFailoverService(Class<T> clazz,
            MasterInfo masterInfo,
            RpcConfig config) {
        String serviceKey = getFailoverServiceKey(masterInfo, clazz.getName());
        ServiceHolder h = servicesCache.get(serviceKey);
        if (h != null) {
            return (T) h.getService();
        }
        RpcServiceFailoverInvoker invoker =
                new RpcServiceFailoverInvoker(clientFactory, clazz, config, masterInfo);
        Object service =
                Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz}, invoker);
        servicesCache.put(serviceKey, new ServiceHolder(service, invoker));
        return (T) service;
    }
check is service empty

@return whether is empty
inlong-tubemq/tubemq-core/src/main/java/org/apache/inlong/tubemq/corerpc/RpcServiceFactory.java