本文整理汇总了Java中org.elasticsearch.common.transport.TransportAddress.getPort方法的典型用法代码示例。如果您正苦于以下问题:Java TransportAddress.getPort方法的具体用法?Java TransportAddress.getPort怎么用?Java TransportAddress.getPort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.common.transport.TransportAddress
的用法示例。
在下文中一共展示了TransportAddress.getPort方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
示例2: formatIntoIpPort
import org.elasticsearch.common.transport.TransportAddress; //导入方法依赖的package包/类
public static String formatIntoIpPort(TransportAddress address) {
return address.getAddress() + ":" + address.getPort();
}