當前位置: 首頁>>代碼示例>>Java>>正文


Java TransportAddress.getAddress方法代碼示例

本文整理匯總了Java中org.elasticsearch.common.transport.TransportAddress.getAddress方法的典型用法代碼示例。如果您正苦於以下問題:Java TransportAddress.getAddress方法的具體用法?Java TransportAddress.getAddress怎麽用?Java TransportAddress.getAddress使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.elasticsearch.common.transport.TransportAddress的用法示例。


在下文中一共展示了TransportAddress.getAddress方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testReindexFromRemote

import org.elasticsearch.common.transport.TransportAddress; //導入方法依賴的package包/類
public void testReindexFromRemote() throws Exception {
    NodeInfo nodeInfo = client().admin().cluster().prepareNodesInfo().get().getNodes().get(0);
    TransportAddress address = nodeInfo.getHttp().getAddress().publishAddress();
    RemoteInfo remote = new RemoteInfo("http", address.getAddress(), address.getPort(), new BytesArray("{\"match_all\":{}}"), null,
        null, emptyMap(), RemoteInfo.DEFAULT_SOCKET_TIMEOUT, RemoteInfo.DEFAULT_CONNECT_TIMEOUT);
    ReindexRequestBuilder request = ReindexAction.INSTANCE.newRequestBuilder(client()).source("source").destination("dest")
            .setRemoteInfo(remote);
    testCase(ReindexAction.NAME, request, matcher().created(DOC_COUNT));
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:10,代碼來源:RetryTests.java

示例2: formatIntoIpPort

import org.elasticsearch.common.transport.TransportAddress; //導入方法依賴的package包/類
public static String formatIntoIpPort(TransportAddress address) {
    return address.getAddress() + ":" + address.getPort();
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:4,代碼來源:DiscoveryNode.java

示例3: DiscoveryNode

import org.elasticsearch.common.transport.TransportAddress; //導入方法依賴的package包/類
/**
 * Creates a new {@link DiscoveryNode}
 * <p>
 * <b>Note:</b> if the version of the node is unknown {@link Version#minimumCompatibilityVersion()} should be used for the current
 * version. it corresponds to the minimum version this elasticsearch version can communicate with. If a higher version is used
 * the node might not be able to communicate with the remove node. After initial handshakes node versions will be discovered
 * and updated.
 * </p>
 *
 * @param nodeName         the nodes name
 * @param nodeId           the nodes unique persistent id. An ephemeral id will be auto generated.
 * @param address          the nodes transport address
 * @param attributes       node attributes
 * @param roles            node roles
 * @param version          the version of the node
 */
public DiscoveryNode(String nodeName, String nodeId, TransportAddress address,
                     Map<String, String> attributes, Set<Role> roles, Version version) {
    this(nodeName, nodeId, UUIDs.randomBase64UUID(), address.address().getHostString(), address.getAddress(), address, attributes,
        roles, version);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:22,代碼來源:DiscoveryNode.java

示例4: DiscoveryNode

import org.elasticsearch.common.transport.TransportAddress; //導入方法依賴的package包/類
/**
 * Creates a new {@link DiscoveryNode}
 * <p>
 * <b>Note:</b> if the version of the node is unknown {@link #MINIMUM_DISCOVERY_NODE_VERSION} should be used.
 * it corresponds to the minimum version this elasticsearch version can communicate with. If a higher version is used
 * the node might not be able to communicate with the remove node. After initial handshakes node versions will be discovered
 * and updated.
 * </p>
 *
 * @param nodeName   the nodes name
 * @param nodeId     the nodes unique id.
 * @param address    the nodes transport address
 * @param attributes node attributes
 * @param version    the version of the node.
 */
public DiscoveryNode(String nodeName, String nodeId, TransportAddress address, Map<String, String> attributes, Version version) {
    this(nodeName, nodeId, address.getHost(), address.getAddress(), address, attributes, version);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:19,代碼來源:DiscoveryNode.java


注:本文中的org.elasticsearch.common.transport.TransportAddress.getAddress方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。