MCPcopy Create free account
hub / github.com/crate/crate / of

Method of

server/src/main/java/io/crate/metadata/NodeContext.java:51–78  ·  view source on GitHub ↗
(Environment environment,
                                 ClusterService clusterService,
                                 Functions functions,
                                 Roles roles,
                                 TableStats tableStats)

Source from the content-addressed store, hash-verified

49 private final TableStats tableStats;
50
51 public static NodeContext of(Environment environment,
52 ClusterService clusterService,
53 Functions functions,
54 Roles roles,
55 TableStats tableStats) {
56 return new NodeContext(functions, roles, nodeCtx -> {
57 var tableInfoFactory = new DocTableInfoFactory(nodeCtx);
58 BlobSchemaInfo blobSchemaInfo = new BlobSchemaInfo(
59 clusterService,
60 new BlobTableInfoFactory(environment));
61 Map<String, SchemaInfo> systemSchemas = Map.of(
62 SysSchemaInfo.NAME, new SysSchemaInfo(clusterService, nodeCtx.roles()),
63 InformationSchemaInfo.NAME, new InformationSchemaInfo(),
64 PgCatalogSchemaInfo.NAME, new PgCatalogSchemaInfo(tableStats, nodeCtx.roles()),
65 BlobSchemaInfo.NAME, blobSchemaInfo
66 );
67 var relationAnalyzer = new RelationAnalyzer(nodeCtx);
68 var viewInfoFactory = new ViewInfoFactory(relationAnalyzer);
69 Schemas schemas = new Schemas(
70 systemSchemas,
71 clusterService,
72 new DocSchemaInfoFactory(tableInfoFactory, viewInfoFactory),
73 nodeCtx.roles()
74 );
75 schemas.start();
76 return schemas;
77 }, tableStats);
78 }
79
80 public NodeContext(Functions functions,
81 Roles roles,

Callers 2

buildMethod · 0.95
NodeMethod · 0.95

Calls 3

ofMethod · 0.65
rolesMethod · 0.65
startMethod · 0.65

Tested by 1

buildMethod · 0.76