作者:rsidugjig | 来源:互联网 | 2023-08-26 18:37
本文整理了Java中com.facebook.presto.spi.NodeManager.getActiveDatasourceNodes()方法的一些代码示例,展示
本文整理了Java中com.facebook.presto.spi.NodeManager.getActiveDatasourceNodes()
方法的一些代码示例,展示了NodeManager.getActiveDatasourceNodes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NodeManager.getActiveDatasourceNodes()
方法的具体详情如下:
包路径:com.facebook.presto.spi.NodeManager
类名称:NodeManager
方法名:getActiveDatasourceNodes
NodeManager.getActiveDatasourceNodes介绍
暂无
代码示例
代码示例来源:origin: uk.co.nichesolutions.presto/presto-tpch
@Override
public Map getBucketToNode(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle)
{
Set nodes = nodeManager.getActiveDatasourceNodes(connectorId);
checkState(!nodes.isEmpty(), "No TPCH nodes available");
// Split the data using split and skew by the number of nodes available.
ImmutableMap.Builder bucketTOnode= ImmutableMap.builder();
int partNumber = 0;
for (Node node : nodes) {
for (int i = 0; i bucketToNode.put(partNumber, node);
partNumber++;
}
}
return bucketToNode.build();
}
代码示例来源:origin: uk.co.nichesolutions.presto/presto-blackhole
@Override
public Map getBucketToNode(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle)
{
Set nodes = nodeManager.getActiveDatasourceNodes(connectorId);
if (nodes.isEmpty()) {
throw new PrestoException(NO_NODES_AVAILABLE, "No black hole nodes available");
}
// create on part per node
ImmutableMap.Builder distribution = ImmutableMap.builder();
int partNumber = 0;
for (Node node : nodes) {
distribution.put(partNumber, node);
partNumber++;
}
return distribution.build();
}
代码示例来源:origin: uk.co.nichesolutions.presto/presto-tpch
@Override
public ConnectorSplitSource getSplits(ConnectorTransactionHandle transaction, ConnectorSession session, ConnectorTableLayoutHandle layout)
{
TpchTableHandle tableHandle = checkType(layout, TpchTableLayoutHandle.class, "layout").getTable();
Set nodes = nodeManager.getActiveDatasourceNodes(connectorId);
checkState(!nodes.isEmpty(), "No TPCH nodes available");
int totalParts = nodes.size() * splitsPerNode;
int partNumber = 0;
// Split the data using split and skew by the number of nodes available.
ImmutableList.Builder splits = ImmutableList.builder();
for (Node node : nodes) {
for (int i = 0; i splits.add(new TpchSplit(tableHandle, partNumber, totalParts, ImmutableList.of(node.getHostAndPort())));
partNumber++;
}
}
return new FixedSplitSource(connectorId, splits.build());
}
}
代码示例来源:origin: uk.co.nichesolutions.presto/presto-main
nodes = nodeManager.getActiveDatasourceNodes(dataSourceName);