@Override
    public TransportClient createClient(Map<String, String> clientConfig) {
        Settings settings = Settings.builder().put(clientConfig)
                //.put(NetworkModule.HTTP_TYPE_KEY, Netty3Plugin.NETTY_HTTP_TRANSPORT_NAME)
                //.put(NetworkModule.TRANSPORT_TYPE_KEY, Netty3Plugin.NETTY_TRANSPORT_NAME)
                .build();

        TransportClient transportClient;
        if (esTableInfo.isAuthMesh()) {
            transportClient = new PreBuiltXPackTransportClient(settings);
        }else {
            transportClient = new PreBuiltTransportClient(settings);
        }
        for (TransportAddress transport : ElasticsearchUtils.convertInetSocketAddresses(transportAddresses)) {
            transportClient.addTransportAddress(transport);
        }

        // verify that we actually are connected to a cluster
        if (transportClient.connectedNodes().isEmpty()) {

            // close the transportClient here
            IOUtils.closeQuietly(transportClient);

            throw new RuntimeException("Elasticsearch client is not connected to any Elasticsearch nodes!");
        }

        if (LOG.isInfoEnabled()) {
            LOG.info("Created Elasticsearch TransportClient with connected nodes {}", transportClient.connectedNodes());
        }

        return transportClient;
    }
@date 2019/11/16
@author xiuzhu
@Company: www.dtstack.com
elasticsearch5/elasticsearch5-sink/src/main/java/com/dtstack/flink/sql/sink/elasticsearch/ExtendES5ApiCallBridge.java