org.elasticsearch.transport.TransportService.boundAddress()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.elasticsearch.transport.TransportService.boundAddress()方法的一些代码示例,展示了TransportService.boundAddress()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TransportService.boundAddress()方法的具体详情如下:
包路径:org.elasticsearch.transport.TransportService
类名称:TransportService
方法名:boundAddress

TransportService.boundAddress介绍

暂无

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

public TransportInfo info() {
  BoundTransportAddress boundTransportAddress = boundAddress();
  if (boundTransportAddress == null) {
    return null;
  }
  return new TransportInfo(boundTransportAddress, transport.profileBoundAddresses());
}

代码示例来源:origin: org.elasticsearch/elasticsearch

localAddresses.add(transportService.boundAddress().publishAddress());
localAddresses.addAll(Arrays.asList(transportService.boundAddress().boundAddresses()));

代码示例来源:origin: org.elasticsearch/elasticsearch

throw new UncheckedIOException(e);
validateNodeBeforeAcceptingRequests(new BootstrapContext(environment, onDiskMetadata), transportService.boundAddress(), pluginsService
  .filterPlugins(Plugin
  .class)
  writePortsFile("transport", transport.boundAddress());

代码示例来源:origin: com.strapdata.elasticsearch.test/framework

public static TransportAddress[] extractTransportAddresses(TransportService transportService) {
  HashSet<TransportAddress> transportAddresses = new HashSet<>();
  BoundTransportAddress boundTransportAddress = transportService.boundAddress();
  transportAddresses.addAll(Arrays.asList(boundTransportAddress.boundAddresses()));
  transportAddresses.add(boundTransportAddress.publishAddress());
  return transportAddresses.toArray(new TransportAddress[transportAddresses.size()]);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public TransportInfo info() {
  BoundTransportAddress boundTransportAddress = boundAddress();
  if (boundTransportAddress == null) {
    return null;
  }
  return new TransportInfo(boundTransportAddress, transport.profileBoundAddresses());
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

public TransportInfo info() {
  BoundTransportAddress boundTransportAddress = boundAddress();
  if (boundTransportAddress == null) {
    return null;
  }
  return new TransportInfo(boundTransportAddress, transport.profileBoundAddresses());
}

代码示例来源:origin: harbby/presto-connectors

public TransportInfo info() {
  BoundTransportAddress boundTransportAddress = boundAddress();
  if (boundTransportAddress == null) {
    return null;
  }
  return new TransportInfo(boundTransportAddress, transport.profileBoundAddresses());
}

代码示例来源:origin: apache/servicemix-bundles

localAddresses.add(transportService.boundAddress().publishAddress());
localAddresses.addAll(Arrays.asList(transportService.boundAddress().boundAddresses()));

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

localAddresses.add(transportService.boundAddress().publishAddress());
localAddresses.addAll(Arrays.asList(transportService.boundAddress().boundAddresses()));

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

final List<DiscoveryNode> discoveryNodes = new ArrayList<>();
final Set<TransportAddress> localAddresses = new HashSet<>();
localAddresses.add(transportService.boundAddress().publishAddress());
localAddresses.addAll(Arrays.asList(transportService.boundAddress().boundAddresses()));

代码示例来源:origin: org.fusesource.insight/insight-elasticsearch

@Override
protected void doStart() throws ElasticSearchException {
  Map<String, String> nodeAttributes = discoveryNodeService.buildAttributes();
  // note, we rely on the fact that its a new id each time we start, see FD and "kill -9" handling
  String nodeId = UUID.randomBase64UUID();
  localNode = new DiscoveryNode(settings.get("name"), nodeId, transportService.boundAddress().publishAddress(), nodeAttributes);
  tracker.open();
}

代码示例来源:origin: io.fabric8.insight/insight-elasticsearch-discovery

@Override
protected void doStart() throws ElasticsearchException {
  logger.debug("Starting FabricDiscovery");
  Map<String, String> nodeAttributes = discoveryNodeService.buildAttributes();
  // note, we rely on the fact that its a new id each time we start, see FD and "kill -9" handling
  String nodeId = UUID.randomUUID().toString();
  String host = settings.get("discovery.publish.host");
  String port = settings.get("discovery.publish.port");
  if (host != null && port != null) {
    TransportAddress address = new InetSocketTransportAddress(host, Integer.parseInt(port));
    localNode = new DiscoveryNode(settings.get("name"), nodeId, address, nodeAttributes, Version.CURRENT);
  } else {
    localNode = new DiscoveryNode(settings.get("name"), nodeId, transportService.boundAddress().publishAddress(), nodeAttributes, Version.CURRENT);
  }
  tracker.open();
  logger.debug("FabricDiscovery started");
}

代码示例来源:origin: io.fabric8.insight/insight-elasticsearch

@Override
protected void doStart() throws ElasticsearchException {
  logger.debug("Starting FabricDiscovery");
  Map<String, String> nodeAttributes = discoveryNodeService.buildAttributes();
  // note, we rely on the fact that its a new id each time we start, see FD and "kill -9" handling
  String nodeId = UUID.randomUUID().toString();
  String host = settings.get("discovery.publish.host");
  String port = settings.get("discovery.publish.port");
  if (host != null && port != null) {
    TransportAddress address = new InetSocketTransportAddress(host, Integer.parseInt(port));
    localNode = new DiscoveryNode(settings.get("name"), nodeId, address, nodeAttributes, Version.CURRENT);
  } else {
    localNode = new DiscoveryNode(settings.get("name"), nodeId, transportService.boundAddress().publishAddress(), nodeAttributes, Version.CURRENT);
  }
  tracker.open();
  logger.debug("FabricDiscovery started");
}

代码示例来源:origin: com.strapdata.elasticsearch.test/framework

public Client client(Node node, String clusterName) {
    TransportAddress addr = node.injector().getInstance(TransportService.class).boundAddress().publishAddress();
    Settings nodeSettings = node.settings();
    Builder builder = Settings.builder()
      .put("client.transport.nodes_sampler_interval", "1s")
      .put(Environment.PATH_HOME_SETTING.getKey(), baseDir)
      .put("node.name", TRANSPORT_CLIENT_PREFIX + node.settings().get("node.name"))
      .put(ClusterName.CLUSTER_NAME_SETTING.getKey(), clusterName).put("client.transport.sniff", sniff)
      .put("logger.prefix", nodeSettings.get("logger.prefix", ""))
      .put("logger.level", nodeSettings.get("logger.level", "INFO"))
      .put(settings);
    if (NetworkModule.TRANSPORT_TYPE_SETTING.exists(settings)) {
      builder.put(NetworkModule.TRANSPORT_TYPE_SETTING.getKey(), NetworkModule.TRANSPORT_TYPE_SETTING.get(settings));
    } else {
      builder.put(NetworkModule.TRANSPORT_TYPE_SETTING.getKey(), getTestTransportType());
    }
    TransportClient client = new MockTransportClient(builder.build(), plugins);
    client.addTransportAddress(addr);
    return client;
  }
}

代码示例来源:origin: jboss-fuse/fabric8

@Override
protected void doStart() throws ElasticsearchException {
  logger.debug("Starting FabricDiscovery");
  Map<String, String> nodeAttributes = discoveryNodeService.buildAttributes();
  // note, we rely on the fact that its a new id each time we start, see FD and "kill -9" handling
  String nodeId = UUID.randomUUID().toString();
  String host = settings.get("discovery.publish.host");
  String port = settings.get("discovery.publish.port");
  if (host != null && port != null) {
    TransportAddress address = new InetSocketTransportAddress(host, Integer.parseInt(port));
    localNode = new DiscoveryNode(settings.get("name"), nodeId, address, nodeAttributes, Version.CURRENT);
  } else {
    localNode = new DiscoveryNode(settings.get("name"), nodeId, transportService.boundAddress().publishAddress(), nodeAttributes, Version.CURRENT);
  }
  tracker.open();
  logger.debug("FabricDiscovery started");
}

代码示例来源:origin: com.strapdata.elasticsearch.test/framework

new DiscoveryNode("TS_TPC", "TS_TPC", service.boundAddress().publishAddress(), emptyMap(), emptySet(), version0),
  null
)) {

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

validateNodeBeforeAcceptingRequests(settings, transportService.boundAddress(), pluginsService.filterPlugins(Plugin.class).stream()
  .flatMap(p -> p.getBootstrapChecks().stream()).collect(Collectors.toList()));
  writePortsFile("transport", transport.boundAddress());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

throw new UncheckedIOException(e);
validateNodeBeforeAcceptingRequests(new BootstrapContext(settings, onDiskMetadata), transportService.boundAddress(), pluginsService
  .filterPlugins(Plugin
  .class)
  writePortsFile("transport", transport.boundAddress());

代码示例来源:origin: harbby/presto-connectors

@Override
protected void doStart() {
  add(localNodeMasterListeners);
  add(taskManager);
  this.clusterState = ClusterState.builder(clusterState).blocks(initialBlocks).build();
  this.updateTasksExecutor = EsExecutors.newSinglePrioritizing(UPDATE_THREAD_NAME, daemonThreadFactory(settings, UPDATE_THREAD_NAME));
  this.reconnectToNodes = threadPool.schedule(reconnectInterval, ThreadPool.Names.GENERIC, new ReconnectToNodes());
  Map<String, String> nodeAttributes = discoveryNodeService.buildAttributes();
  // note, we rely on the fact that its a new id each time we start, see FD and "kill -9" handling
  final String nodeId = DiscoveryService.generateNodeId(settings);
  final TransportAddress publishAddress = transportService.boundAddress().publishAddress();
  DiscoveryNode localNode = new DiscoveryNode(settings.get("name"), nodeId, publishAddress, nodeAttributes, version);
  DiscoveryNodes.Builder nodeBuilder = DiscoveryNodes.builder().put(localNode).localNodeId(localNode.id());
  this.clusterState = ClusterState.builder(clusterState).nodes(nodeBuilder).blocks(initialBlocks).build();
  this.transportService.setLocalNode(localNode);
}

代码示例来源:origin: harbby/presto-connectors

writePortsFile("transport", transport.boundAddress());

相关文章

微信公众号

最新文章

更多

TransportService类方法