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

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

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

Node.isCoordinator介绍

暂无

代码示例

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

  1. @Inject
  2. public TaskCountEstimator(NodeSchedulerConfig nodeSchedulerConfig, InternalNodeManager nodeManager)
  3. {
  4. requireNonNull(nodeSchedulerConfig, "nodeSchedulerConfig is null");
  5. requireNonNull(nodeManager, "nodeManager is null");
  6. this.numberOfNodes = () -> {
  7. Set<Node> activeNodes = nodeManager.getAllNodes().getActiveNodes();
  8. if (nodeSchedulerConfig.isIncludeCoordinator()) {
  9. return activeNodes.size();
  10. }
  11. return toIntExact(activeNodes.stream()
  12. .filter(node -> !node.isCoordinator())
  13. .count());
  14. };
  15. }

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

  1. @Inject
  2. public TaskCountEstimator(NodeSchedulerConfig nodeSchedulerConfig, InternalNodeManager nodeManager)
  3. {
  4. requireNonNull(nodeSchedulerConfig, "nodeSchedulerConfig is null");
  5. requireNonNull(nodeManager, "nodeManager is null");
  6. this.numberOfNodes = () -> {
  7. Set<Node> activeNodes = nodeManager.getAllNodes().getActiveNodes();
  8. if (nodeSchedulerConfig.isIncludeCoordinator()) {
  9. return activeNodes.size();
  10. }
  11. return toIntExact(activeNodes.stream()
  12. .filter(node -> !node.isCoordinator())
  13. .count());
  14. };
  15. }

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

  1. @Inject
  2. public RaptorConnector(
  3. LifeCycleManager lifeCycleManager,
  4. NodeManager nodeManager,
  5. RaptorMetadataFactory metadataFactory,
  6. RaptorSplitManager splitManager,
  7. RaptorPageSourceProvider pageSourceProvider,
  8. RaptorPageSinkProvider pageSinkProvider,
  9. RaptorNodePartitioningProvider nodePartitioningProvider,
  10. RaptorSessionProperties sessionProperties,
  11. RaptorTableProperties tableProperties,
  12. Set<SystemTable> systemTables,
  13. ConnectorAccessControl accessControl,
  14. @ForMetadata IDBI dbi)
  15. {
  16. this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null");
  17. this.metadataFactory = requireNonNull(metadataFactory, "metadataFactory is null");
  18. this.splitManager = requireNonNull(splitManager, "splitManager is null");
  19. this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null");
  20. this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null");
  21. this.nodePartitioningProvider = requireNonNull(nodePartitioningProvider, "nodePartitioningProvider is null");
  22. this.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null").getSessionProperties();
  23. this.tableProperties = requireNonNull(tableProperties, "tableProperties is null").getTableProperties();
  24. this.systemTables = requireNonNull(systemTables, "systemTables is null");
  25. this.accessControl = requireNonNull(accessControl, "accessControl is null");
  26. this.dao = onDemandDao(dbi, MetadataDao.class);
  27. this.coordinator = nodeManager.getCurrentNode().isCoordinator();
  28. }

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

  1. @Inject
  2. public BucketBalancer(
  3. NodeManager nodeManager,
  4. NodeSupplier nodeSupplier,
  5. ShardManager shardManager,
  6. BucketBalancerConfig config,
  7. BackupService backupService,
  8. RaptorConnectorId connectorId)
  9. {
  10. this(nodeSupplier,
  11. shardManager,
  12. config.isBalancerEnabled(),
  13. config.getBalancerInterval(),
  14. backupService.isBackupAvailable(),
  15. nodeManager.getCurrentNode().isCoordinator(),
  16. connectorId.toString());
  17. }

代码示例来源: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. }

代码示例来源: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. @Inject
  2. public ShardCleaner(
  3. DaoSupplier<ShardDao> shardDaoSupplier,
  4. Ticker ticker,
  5. NodeManager nodeManager,
  6. StorageService storageService,
  7. Optional<BackupStore> backupStore,
  8. ShardCleanerConfig config)
  9. {
  10. this(
  11. shardDaoSupplier,
  12. nodeManager.getCurrentNode().getNodeIdentifier(),
  13. nodeManager.getCurrentNode().isCoordinator(),
  14. ticker,
  15. storageService,
  16. backupStore,
  17. config.getMaxTransactionAge(),
  18. config.getTransactionCleanerInterval(),
  19. config.getLocalCleanerInterval(),
  20. config.getLocalCleanTime(),
  21. config.getBackupCleanerInterval(),
  22. config.getBackupCleanTime(),
  23. config.getBackupDeletionThreads(),
  24. config.getMaxCompletedTransactionAge());
  25. }

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

  1. SystemTablesProvider systemTablesProvider;
  2. if (nodeManager.getCurrentNode().isCoordinator()) {
  3. systemTablesProvider = new DelegatingSystemTablesProvider(
  4. new StaticSystemTablesProvider(connector.getSystemTables()),

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

  1. SystemTablesProvider systemTablesProvider;
  2. if (nodeManager.getCurrentNode().isCoordinator()) {
  3. systemTablesProvider = new DelegatingSystemTablesProvider(
  4. new StaticSystemTablesProvider(connector.getSystemTables()),

相关文章