Skip to content

Commit

Permalink
Rename method for clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
klaren committed Mar 14, 2018
1 parent 54494b7 commit 7863a10
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
Expand Up @@ -260,7 +260,7 @@ public static Optional<StoreType> typeOf( String fileName )
* @param storeFileName file name of the store file to check.
* @return Returns whether or not store file by given file name should be managed by the page cache.
*/
public static boolean shouldBeManagedByPageCache( String storeFileName )
public static boolean canBeManagedByPageCache( String storeFileName )
{
boolean isLabelScanStore = NativeLabelScanStore.FILE_NAME.equals( storeFileName );
return isLabelScanStore || StoreType.typeOf( storeFileName ).map( StoreType::isRecordStore ).orElse( false );
Expand Down
Expand Up @@ -23,7 +23,6 @@
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
Expand Down Expand Up @@ -147,7 +146,7 @@ private static class MappedFileCounter

public void addFile( File file )
{
if ( StoreType.shouldBeManagedByPageCache( file.getName() ) )
if ( StoreType.canBeManagedByPageCache( file.getName() ) )
{
size += file.length();
}
Expand Down
Expand Up @@ -64,7 +64,7 @@ public void write( String destination, int requiredAlignment, byte[] data ) thro

fileCopyMonitor.copyFile( fileName );

if ( !pageCache.fileSystemSupportsFileOperations() && StoreType.shouldBeManagedByPageCache( destination ) )
if ( !pageCache.fileSystemSupportsFileOperations() && StoreType.canBeManagedByPageCache( destination ) )
{
WritableByteChannel channel = channels.get( destination );
if ( channel == null )
Expand Down
Expand Up @@ -71,7 +71,7 @@ public long write( String path, ReadableByteChannel data, ByteBuffer temporaryBu
{
// Note that we don't bother checking if the page cache already has a mapping for the given file.
// The reason is that we are copying to a temporary store location, and then we'll move the files later.
if ( !pageCache.fileSystemSupportsFileOperations() && StoreType.shouldBeManagedByPageCache( filename ) )
if ( !pageCache.fileSystemSupportsFileOperations() && StoreType.canBeManagedByPageCache( filename ) )
{
int filePageSize = filePageSize( requiredElementAlignment );
try ( PagedFile pagedFile = pageCache.map( file, filePageSize, CREATE, WRITE ) )
Expand Down

0 comments on commit 7863a10

Please sign in to comment.