class SysTableDefinitions {

    private final Map<RelationName, StaticTableDefinition<?>> tableDefinitions = new HashMap<>();

    @Inject
    public SysTableDefinitions(ClusterService clusterService,
                               Roles roles,
                               JobsLogs jobsLogs,
                               SysSchemaInfo sysSchemaInfo,
                               Set<SysCheck> sysChecks,
                               SysNodeChecks sysNodeChecks,
                               RepositoriesService repositoriesService,
                               SysSnapshots sysSnapshots,
                               SysAllocations sysAllocations,
                               ShardSegments shardSegmentInfos) {
        Supplier<DiscoveryNode> localNode = clusterService::localNode;
        var sysClusterTableInfo = (SystemTable<Void>) sysSchemaInfo.getTableInfo(SysClusterTableInfo.IDENT.name());
        assert sysClusterTableInfo != null : "sys.cluster table must exist in sys schema";
        tableDefinitions.put(SysClusterTableInfo.IDENT, new StaticTableDefinition<>(
            () -> completedFuture(Collections.singletonList(null)),
            sysClusterTableInfo.expressions(),
            false
        ));
        var sysJobsTable = SysJobsTableInfo.create(localNode);
        tableDefinitions.put(SysJobsTableInfo.IDENT, new StaticTableDefinition<>(
            (txnCtx, user) -> completedFuture(
                () -> StreamSupport.stream(jobsLogs.activeJobs().spliterator(), false)
                    .filter(x ->
                        user.isSuperUser()
                        || user.name().equals(x.username())
                        || roles.hasPrivilege(user, Permission.AL, Securable.CLUSTER, null))
                    .iterator()
            ),
            sysJobsTable.expressions(),
            false));
        var sysJobsLogTable = SysJobsLogTableInfo.create(localNode);
        tableDefinitions.put(SysJobsLogTableInfo.IDENT, new StaticTableDefinition<>(
            (txnCtx, user) -> completedFuture(
                () -> StreamSupport.stream(jobsLogs.jobsLog().spliterator(), false)
                    .filter(x ->
                        user.isSuperUser()
                        || user.name().equals(x.username())
                        || roles.hasPrivilege(user, Permission.AL, Securable.CLUSTER, null))
                    .iterator()
            ),
            sysJobsLogTable.expressions(),
            false));
        tableDefinitions.put(SysOperationsTableInfo.IDENT, new StaticTableDefinition<>(
            () -> completedFuture(jobsLogs.activeOperations()),
            SysOperationsTableInfo.create(localNode).expressions(),
            false));
        tableDefinitions.put(SysOperationsLogTableInfo.IDENT, new StaticTableDefinition<>(
            () -> completedFuture(jobsLogs.operationsLog()),
            SysOperationsLogTableInfo.create().expressions(),
            false));

        SysChecker<SysCheck> sysChecker = new SysChecker<>(sysChecks);
        tableDefinitions.put(SysChecksTableInfo.IDENT, new StaticTableDefinition<>(
            sysChecker::computeResultAndGet,
            SysChecksTableInfo.create().expressions(),
            true));

        tableDefinitions.put(SysNodeChecksTableInfo.IDENT, new StaticTableDefinition<>(
            () -> completedFuture(sysNodeChecks),
            SysNodeChecksTableInfo.create().expressions(),
            true));
        tableDefinitions.put(SysRepositoriesTableInfo.IDENT, new StaticTableDefinition<>(
            () -> completedFuture(repositoriesService.getRepositoriesList()),
            SysRepositoriesTableInfo.create(clusterService.getClusterSettings().maskedSettings()).expressions(),
            false));
        tableDefinitions.put(SysSnapshotsTableInfo.IDENT, new StaticTableDefinition<>(
            sysSnapshots::currentSnapshots,
            SysSnapshotsTableInfo.create().expressions(),
            true));
        tableDefinitions.put(SysSnapshotRestoreTableInfo.IDENT, new StaticTableDefinition<>(
            () -> completedFuture(SysSnapshotRestoreTableInfo.snapshotsRestoreInProgress(
                    clusterService.state().custom(RestoreInProgress.TYPE))
            ),
            SysSnapshotRestoreTableInfo.create().expressions(),
            true));

        tableDefinitions.put(SysAllocationsTableInfo.IDENT, new StaticTableDefinition<>(
            () -> sysAllocations,
            (user, allocation) -> roles.hasAnyPrivilege(user, Securable.TABLE, allocation.fqn()),
            SysAllocationsTableInfo.create().expressions()
        ));

        SummitsIterable summits = new SummitsIterable();
        tableDefinitions.put(SysSummitsTableInfo.IDENT, new StaticTableDefinition<>(
            () -> completedFuture(summits),
            SysSummitsTableInfo.create().expressions(),
            false));

        SystemTable<TableHealth> sysHealth = SysHealth.create();
        tableDefinitions.put(SysHealth.IDENT, new StaticTableDefinition<>(
            () -> TableHealth.compute(clusterService.state()),
            sysHealth.expressions(),
            (user, tableHealth) -> roles.hasAnyPrivilege(user, Securable.TABLE, tableHealth.fqn()),
            true)
        );
        tableDefinitions.put(SysMetricsTableInfo.NAME, new StaticTableDefinition<>(
            () -> completedFuture(jobsLogs.metrics()),
            SysMetricsTableInfo.create(localNode).expressions(),
            false));
        tableDefinitions.put(SysSegmentsTableInfo.IDENT, new StaticTableDefinition<>(
            () -> completedFuture(shardSegmentInfos),
            SysSegmentsTableInfo.create(clusterService::localNode).expressions(),
            true));
    }

    public StaticTableDefinition<?> get(RelationName relationName) {
        return tableDefinitions.get(relationName);
    }

    public <R> void registerTableDefinition(RelationName relationName, StaticTableDefinition<R> definition) {<FILL_FUNCTION_BODY>}
}

        StaticTableDefinition<?> existingDefinition = tableDefinitions.putIfAbsent(relationName, definition);
        assert existingDefinition == null : "A static table definition is already registered for ident=" + relationName.toString();
    
<no_super_class>