Search in sources :

Example 1 with AllNodes

use of io.trino.metadata.AllNodes in project trino by trinodb.

the class NodeSystemTable method cursor.

@Override
public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint) {
    Builder table = InMemoryRecordSet.builder(NODES_TABLE);
    AllNodes allNodes = nodeManager.getAllNodes();
    addRows(table, allNodes.getActiveNodes(), ACTIVE);
    addRows(table, allNodes.getInactiveNodes(), INACTIVE);
    addRows(table, allNodes.getShuttingDownNodes(), SHUTTING_DOWN);
    return table.build().cursor();
}
Also used : TableMetadataBuilder.tableMetadataBuilder(io.trino.metadata.MetadataUtil.TableMetadataBuilder.tableMetadataBuilder) Builder(io.trino.spi.connector.InMemoryRecordSet.Builder) AllNodes(io.trino.metadata.AllNodes)

Aggregations

AllNodes (io.trino.metadata.AllNodes)1 TableMetadataBuilder.tableMetadataBuilder (io.trino.metadata.MetadataUtil.TableMetadataBuilder.tableMetadataBuilder)1 Builder (io.trino.spi.connector.InMemoryRecordSet.Builder)1