当前位置: 首页>>代码示例>>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;未经允许,请勿转载。