Search in sources :

Example 1 with AllNodes

use of io.prestosql.metadata.AllNodes in project hetu-core by openlookeng.

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.getIsolatingNodes(), ISOLATING);
    addRows(table, allNodes.getIsolatedNodes(), ISOLATED);
    addRows(table, allNodes.getShuttingDownNodes(), SHUTTING_DOWN);
    return table.build().cursor();
}
Also used : Builder(io.prestosql.spi.connector.InMemoryRecordSet.Builder) TableMetadataBuilder.tableMetadataBuilder(io.prestosql.metadata.MetadataUtil.TableMetadataBuilder.tableMetadataBuilder) AllNodes(io.prestosql.metadata.AllNodes)

Aggregations

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