Skip to content

Commit

Permalink
Move page cache profiles to separate folder
Browse files Browse the repository at this point in the history
Move profile to separate folder, also avoid making profiles dotfiles.
We have nothing to hide!
  • Loading branch information
MishaDemianenko committed Mar 27, 2018
1 parent a2f5d74 commit 395d1cb
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -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();

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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 );
}
}

0 comments on commit 395d1cb

Please sign in to comment.