Skip to content

Commit

Permalink
Rename stopOngoingWarming back to stopped because it applies both to …
Browse files Browse the repository at this point in the history
…heating and profiling.
  • Loading branch information
chrisvest committed Apr 4, 2018
1 parent 4d517e8 commit 489e9a4
Showing 1 changed file with 8 additions and 8 deletions.
Expand Up @@ -74,7 +74,7 @@ public class PageCacheWarmer implements NeoStoreFileListing.StoreFileProvider
private final PageCache pageCache;
private final JobScheduler scheduler;
private final ProfileRefCounts refCounts;
private volatile boolean stopOngoingWarming;
private volatile boolean stopped;
private ExecutorService executor;
private PageLoaderFactory pageLoaderFactory;

Expand All @@ -89,7 +89,7 @@ public class PageCacheWarmer implements NeoStoreFileListing.StoreFileProvider
@Override
public synchronized Resource addFilesTo( Collection<StoreFileMetadata> coll ) throws IOException
{
if ( stopOngoingWarming )
if ( stopped )
{
return Resource.EMPTY;
}
Expand All @@ -105,14 +105,14 @@ public synchronized Resource addFilesTo( Collection<StoreFileMetadata> coll ) th

public synchronized void start()
{
stopOngoingWarming = false;
stopped = false;
executor = buildExecutorService( scheduler );
pageLoaderFactory = new PageLoaderFactory( executor, pageCache );
}

public void stop()
{
stopOngoingWarming = true;
stopped = true;
stopWarmer();
}

Expand All @@ -136,7 +136,7 @@ private synchronized void stopWarmer()
*/
synchronized OptionalLong reheat() throws IOException
{
if ( stopOngoingWarming )
if ( stopped )
{
return OptionalLong.empty();
}
Expand Down Expand Up @@ -166,7 +166,7 @@ synchronized OptionalLong reheat() throws IOException
*/
public synchronized OptionalLong profile() throws IOException
{
if ( stopOngoingWarming )
if ( stopped )
{
return OptionalLong.empty();
}
Expand All @@ -186,7 +186,7 @@ public synchronized OptionalLong profile() throws IOException
{
// The database is allowed to map and unmap files while we are profiling the page cache.
}
if ( stopOngoingWarming )
if ( stopped )
{
pageCache.reportEvents();
return OptionalLong.empty();
Expand Down Expand Up @@ -219,7 +219,7 @@ private long reheat( PagedFile file, Profile[] existingProfiles ) throws IOExcep
{
for ( int i = 0; i < 8; i++ )
{
if ( stopOngoingWarming )
if ( stopped )
{
pageCache.reportEvents();
return pagesLoaded;
Expand Down

0 comments on commit 489e9a4

Please sign in to comment.