Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation error in apoc.monitor.store() #2045

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions full/src/main/java/apoc/monitor/Store.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

import apoc.result.StoreInfoResult;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.util.stream.Stream;

import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.io.layout.DatabaseLayout;
import org.neo4j.io.layout.recordstorage.RecordDatabaseLayout;
import org.neo4j.kernel.database.Database;
import org.neo4j.kernel.internal.GraphDatabaseAPI;
import org.neo4j.procedure.Context;
import org.neo4j.procedure.Description;
import org.neo4j.procedure.Procedure;

import java.io.File;
import java.util.stream.Stream;

public class Store {

@Context
Expand All @@ -23,7 +24,8 @@ public class Store {
public Stream<StoreInfoResult> store() {

Database database = ((GraphDatabaseAPI) db).getDependencyResolver().resolveDependency(Database.class);
DatabaseLayout databaseLayout = database.getDatabaseLayout();
//This will work only on Record format databases. Has to be updated when any additional format is available
RecordDatabaseLayout databaseLayout = RecordDatabaseLayout.cast( database.getDatabaseLayout() );
return Stream.of(new StoreInfoResult(
getDirectorySize(databaseLayout.getTransactionLogsDirectory().toFile()),
databaseLayout.propertyStringStore().toFile().length(),
Expand Down