|
21 | 21 |
|
22 | 22 | import org.jetbrains.annotations.TestOnly;
|
23 | 23 | import org.neo4j.common.DependencyResolver;
|
| 24 | +import org.neo4j.configuration.Config; |
24 | 25 | import org.neo4j.exceptions.KernelException;
|
25 | 26 | import org.neo4j.gds.annotation.ValueClass;
|
26 | 27 | import org.neo4j.graphdb.GraphDatabaseService;
|
|
29 | 30 | import org.neo4j.graphdb.Result;
|
30 | 31 | import org.neo4j.graphdb.Transaction;
|
31 | 32 | import org.neo4j.io.layout.DatabaseLayout;
|
| 33 | +import org.neo4j.io.layout.Neo4jLayout; |
32 | 34 | import org.neo4j.kernel.GraphDatabaseQueryService;
|
33 | 35 | import org.neo4j.kernel.api.KernelTransaction;
|
34 | 36 | import org.neo4j.kernel.api.procedure.GlobalProcedures;
|
@@ -105,10 +107,18 @@ public static NamedDatabaseId databaseId(GraphDatabaseService db) {
|
105 | 107 | return cast(db).databaseId();
|
106 | 108 | }
|
107 | 109 |
|
| 110 | + @TestOnly |
| 111 | + // DatabaseLayout switched from a class to an interface from 5.0 to 5.1 |
| 112 | + // It should not be used in code paths run in production. Tests are ok |
108 | 113 | public static DatabaseLayout databaseLayout(GraphDatabaseService db) {
|
109 | 114 | return cast(db).databaseLayout();
|
110 | 115 | }
|
111 | 116 |
|
| 117 | + public static Neo4jLayout neo4jLayout(GraphDatabaseService db) { |
| 118 | + Config configuration = resolveDependency(db, Config.class); |
| 119 | + return Neo4jLayout.of(configuration); |
| 120 | + } |
| 121 | + |
112 | 122 | public static DbmsInfo dbmsInfo(GraphDatabaseService db) {
|
113 | 123 | return cast(db).dbmsInfo();
|
114 | 124 | }
|
|
0 commit comments