From 395d1cb03c682d27ef1d88e9093ae3abc2be5aa4 Mon Sep 17 00:00:00 2001 From: MishaDemianenko Date: Tue, 27 Mar 2018 18:07:56 +0200 Subject: [PATCH] Move page cache profiles to separate folder Move profile to separate folder, also avoid making profiles dotfiles. We have nothing to hide! --- .../org/neo4j/kernel/impl/pagecache/PageCacheWarmer.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/enterprise/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/PageCacheWarmer.java b/enterprise/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/PageCacheWarmer.java index be27a6f5657b8..4b9b02f8cfd29 100644 --- a/enterprise/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/PageCacheWarmer.java +++ b/enterprise/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/PageCacheWarmer.java @@ -67,6 +67,7 @@ public class PageCacheWarmer implements NeoStoreFileListing.StoreFileProvider { public static final String SUFFIX_CACHEPROF = ".cacheprof"; + private static final String PROFILE_FOLDER = "profile"; private static final int IO_PARALLELISM = Runtime.getRuntime().availableProcessors(); @@ -290,6 +291,7 @@ private InputStream compressedInputStream( File input ) throws IOException private OutputStream compressedOutputStream( File output ) throws IOException { + fs.mkdirs( output.getParentFile() ); StoreChannel channel = fs.open( output, OpenMode.READ_WRITE ); ByteBuffer buf = ByteBuffer.allocate( 1 ); OutputStream sink = new OutputStream() @@ -326,8 +328,8 @@ public void close() throws IOException private File profileOutputFileName( PagedFile file ) { File mappedFile = file.file(); - String profileOutputName = "." + mappedFile.getName() + SUFFIX_CACHEPROF; - File parent = mappedFile.getParentFile(); - return new File( parent, profileOutputName ); + String profileOutputName = mappedFile.getName() + SUFFIX_CACHEPROF; + File profileFolder = new File( mappedFile.getParentFile(), PROFILE_FOLDER ); + return new File( profileFolder, profileOutputName ); } }