io.prestosql.spi.Node.getNodeIdentifier()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(234)

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

Node.getNodeIdentifier介绍

暂无

代码示例

代码示例来源:origin: io.prestosql/presto-main

  1. public int getQueuedSplitCountForStage(Node node)
  2. {
  3. return queuedSplitCountByNode.getOrDefault(node.getNodeIdentifier(), 0) + assignmentCount.getOrDefault(node, 0);
  4. }

代码示例来源:origin: prestosql/presto

  1. public int getQueuedSplitCountForStage(Node node)
  2. {
  3. return queuedSplitCountByNode.getOrDefault(node.getNodeIdentifier(), 0) + assignmentCount.getOrDefault(node, 0);
  4. }

代码示例来源:origin: prestosql/presto

  1. @Inject
  2. public JmxRecordSetProvider(MBeanServer mbeanServer, NodeManager nodeManager, JmxHistoricalData jmxHistoricalData)
  3. {
  4. this.mbeanServer = requireNonNull(mbeanServer, "mbeanServer is null");
  5. this.nodeId = requireNonNull(nodeManager, "nodeManager is null").getCurrentNode().getNodeIdentifier();
  6. this.jmxHistoricalData = requireNonNull(jmxHistoricalData, "jmxHistoryHolder is null");
  7. }

代码示例来源:origin: prestosql/presto

  1. @Override
  2. public URI createTaskLocation(Node node, TaskId taskId)
  3. {
  4. return URI.create("http://fake.invalid/task/" + node.getNodeIdentifier() + "/" + taskId);
  5. }

代码示例来源:origin: io.prestosql/presto-main

  1. @Override
  2. public URI createTaskLocation(Node node, TaskId taskId)
  3. {
  4. return URI.create("http://fake.invalid/task/" + node.getNodeIdentifier() + "/" + taskId);
  5. }

代码示例来源:origin: io.prestosql/presto-main

  1. @Override
  2. public URI createMemoryInfoLocation(Node node)
  3. {
  4. return URI.create("http://fake.invalid/" + node.getNodeIdentifier() + "/memory");
  5. }
  6. }

代码示例来源:origin: prestosql/presto

  1. @Override
  2. public URI createMemoryInfoLocation(Node node)
  3. {
  4. return URI.create("http://fake.invalid/" + node.getNodeIdentifier() + "/memory");
  5. }
  6. }

代码示例来源:origin: io.prestosql/presto-main

  1. public static ResettableRandomizedIterator<Node> randomizedNodes(NodeMap nodeMap, boolean includeCoordinator, Set<Node> excludedNodes)
  2. {
  3. ImmutableList<Node> nodes = nodeMap.getNodesByHostAndPort().values().stream()
  4. .filter(node -> includeCoordinator || !nodeMap.getCoordinatorNodeIds().contains(node.getNodeIdentifier()))
  5. .filter(node -> !excludedNodes.contains(node))
  6. .collect(toImmutableList());
  7. return new ResettableRandomizedIterator<>(nodes);
  8. }

代码示例来源:origin: prestosql/presto

  1. public static ResettableRandomizedIterator<Node> randomizedNodes(NodeMap nodeMap, boolean includeCoordinator, Set<Node> excludedNodes)
  2. {
  3. ImmutableList<Node> nodes = nodeMap.getNodesByHostAndPort().values().stream()
  4. .filter(node -> includeCoordinator || !nodeMap.getCoordinatorNodeIds().contains(node.getNodeIdentifier()))
  5. .filter(node -> !excludedNodes.contains(node))
  6. .collect(toImmutableList());
  7. return new ResettableRandomizedIterator<>(nodes);
  8. }

代码示例来源:origin: io.prestosql/presto-main

  1. private void addRows(Builder table, Set<Node> nodes, NodeState state)
  2. {
  3. for (Node node : nodes) {
  4. table.addRow(node.getNodeIdentifier(), node.getHttpUri().toString(), getNodeVersion(node), isCoordinator(node), state.toString().toLowerCase(Locale.ENGLISH));
  5. }
  6. }

代码示例来源:origin: prestosql/presto

  1. private void addRows(Builder table, Set<Node> nodes, NodeState state)
  2. {
  3. for (Node node : nodes) {
  4. table.addRow(node.getNodeIdentifier(), node.getHttpUri().toString(), getNodeVersion(node), isCoordinator(node), state.toString().toLowerCase(Locale.ENGLISH));
  5. }
  6. }

代码示例来源:origin: io.prestosql/presto-main

  1. private Response proxyJsonResponse(String nodeId, String workerPath)
  2. {
  3. Set<Node> nodes = nodeManager.getNodes(NodeState.ACTIVE);
  4. Node node = nodes.stream()
  5. .filter(n -> n.getNodeIdentifier().equals(nodeId))
  6. .findFirst()
  7. .orElseThrow(() -> new WebApplicationException(NOT_FOUND));
  8. Request request = prepareGet()
  9. .setUri(uriBuilderFrom(node.getHttpUri())
  10. .appendPath(workerPath)
  11. .build())
  12. .build();
  13. InputStream responseStream = httpClient.execute(request, new StreamingJsonResponseHandler());
  14. return Response.ok(responseStream, APPLICATION_JSON_TYPE).build();
  15. }

代码示例来源:origin: prestosql/presto

  1. private Response proxyJsonResponse(String nodeId, String workerPath)
  2. {
  3. Set<Node> nodes = nodeManager.getNodes(NodeState.ACTIVE);
  4. Node node = nodes.stream()
  5. .filter(n -> n.getNodeIdentifier().equals(nodeId))
  6. .findFirst()
  7. .orElseThrow(() -> new WebApplicationException(NOT_FOUND));
  8. Request request = prepareGet()
  9. .setUri(uriBuilderFrom(node.getHttpUri())
  10. .appendPath(workerPath)
  11. .build())
  12. .build();
  13. InputStream responseStream = httpClient.execute(request, new StreamingJsonResponseHandler());
  14. return Response.ok(responseStream, APPLICATION_JSON_TYPE).build();
  15. }

代码示例来源:origin: prestosql/presto

  1. public ShardRecoveryManager(
  2. StorageService storageService,
  3. Optional<BackupStore> backupStore,
  4. NodeManager nodeManager,
  5. ShardManager shardManager,
  6. Duration missingShardDiscoveryInterval,
  7. int recoveryThreads)
  8. {
  9. this.storageService = requireNonNull(storageService, "storageService is null");
  10. this.backupStore = requireNonNull(backupStore, "backupStore is null");
  11. this.nodeIdentifier = requireNonNull(nodeManager, "nodeManager is null").getCurrentNode().getNodeIdentifier();
  12. this.shardManager = requireNonNull(shardManager, "shardManager is null");
  13. this.missingShardDiscoveryInterval = requireNonNull(missingShardDiscoveryInterval, "missingShardDiscoveryInterval is null");
  14. this.shardQueue = new MissingShardsQueue(new PrioritizedFifoExecutor<>(executorService, recoveryThreads, new MissingShardComparator()));
  15. this.stats = new ShardRecoveryStats();
  16. }

代码示例来源:origin: prestosql/presto

  1. private SimpleConsumer createConsumer(HostAddress host)
  2. {
  3. log.info("Creating new Consumer for %s", host);
  4. return new SimpleConsumer(host.getHostText(),
  5. host.getPort(),
  6. connectTimeoutMillis,
  7. bufferSizeBytes,
  8. format("presto-kafka-%s-%s", connectorId, nodeManager.getCurrentNode().getNodeIdentifier()));
  9. }
  10. }

代码示例来源:origin: prestosql/presto

  1. @Inject
  2. public ShardOrganizationManager(
  3. @ForMetadata IDBI dbi,
  4. NodeManager nodeManager,
  5. ShardManager shardManager,
  6. ShardOrganizer organizer,
  7. TemporalFunction temporalFunction,
  8. StorageManagerConfig config)
  9. {
  10. this(dbi,
  11. nodeManager.getCurrentNode().getNodeIdentifier(),
  12. shardManager,
  13. organizer,
  14. temporalFunction,
  15. config.isOrganizationEnabled(),
  16. config.getOrganizationInterval(),
  17. config.getOrganizationDiscoveryInterval());
  18. }

代码示例来源:origin: prestosql/presto

  1. @Inject
  2. public ShardCompactionManager(@ForMetadata IDBI dbi,
  3. NodeManager nodeManager,
  4. ShardManager shardManager,
  5. ShardOrganizer organizer,
  6. TemporalFunction temporalFunction,
  7. StorageManagerConfig config)
  8. {
  9. this(dbi,
  10. nodeManager.getCurrentNode().getNodeIdentifier(),
  11. shardManager,
  12. organizer,
  13. temporalFunction,
  14. config.getCompactionInterval(),
  15. config.getMaxShardSize(),
  16. config.getMaxShardRows(),
  17. config.isCompactionEnabled());
  18. }

代码示例来源:origin: prestosql/presto

  1. @Test
  2. public void testPredicatePushdown()
  3. throws Exception
  4. {
  5. for (Node node : nodes) {
  6. String nodeIdentifier = node.getNodeIdentifier();
  7. TupleDomain<ColumnHandle> nodeTupleDomain = TupleDomain.fromFixedValues(ImmutableMap.of(columnHandle, NullableValue.of(createUnboundedVarcharType(), utf8Slice(nodeIdentifier))));
  8. ConnectorTableLayoutHandle layout = new JmxTableLayoutHandle(tableHandle, nodeTupleDomain);
  9. ConnectorSplitSource splitSource = splitManager.getSplits(JmxTransactionHandle.INSTANCE, SESSION, layout, UNGROUPED_SCHEDULING);
  10. List<ConnectorSplit> allSplits = getAllSplits(splitSource);
  11. assertEquals(allSplits.size(), 1);
  12. assertEquals(allSplits.get(0).getAddresses().size(), 1);
  13. assertEquals(allSplits.get(0).getAddresses().get(0).getHostText(), nodeIdentifier);
  14. }
  15. }

代码示例来源:origin: io.prestosql/presto-main

  1. private synchronized void announceNodes(Set<Node> activeNodes, Set<Node> inactiveNodes)
  2. {
  3. ImmutableList.Builder<ServiceDescriptor> descriptors = ImmutableList.builder();
  4. for (Node node : Iterables.concat(activeNodes, inactiveNodes)) {
  5. descriptors.add(serviceDescriptor("presto")
  6. .setNodeId(node.getNodeIdentifier())
  7. .addProperty("http", node.getHttpUri().toString())
  8. .addProperty("node_version", ((PrestoNode) node).getNodeVersion().toString())
  9. .addProperty("coordinator", String.valueOf(node.isCoordinator()))
  10. .build());
  11. }
  12. this.descriptors = descriptors.build();
  13. }

代码示例来源:origin: prestosql/presto

  1. private synchronized void announceNodes(Set<Node> activeNodes, Set<Node> inactiveNodes)
  2. {
  3. ImmutableList.Builder<ServiceDescriptor> descriptors = ImmutableList.builder();
  4. for (Node node : Iterables.concat(activeNodes, inactiveNodes)) {
  5. descriptors.add(serviceDescriptor("presto")
  6. .setNodeId(node.getNodeIdentifier())
  7. .addProperty("http", node.getHttpUri().toString())
  8. .addProperty("node_version", ((PrestoNode) node).getNodeVersion().toString())
  9. .addProperty("coordinator", String.valueOf(node.isCoordinator()))
  10. .build());
  11. }
  12. this.descriptors = descriptors.build();
  13. }

相关文章