Skip to content

Commit

Permalink
NeoStoreFileListing now list all existing count store files again
Browse files Browse the repository at this point in the history
  • Loading branch information
burqen committed Sep 12, 2016
1 parent d476b71 commit a6a0b73
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
Expand Up @@ -511,7 +511,7 @@ public Collection<StoreFileMetadata> listStorageFiles()
{
if ( type.equals( StoreType.COUNTS ) )
{
addCurrentCountStoreFile( files );
addCountStoreFiles( files );
}
else
{
Expand All @@ -525,12 +525,15 @@ public Collection<StoreFileMetadata> listStorageFiles()
return files;
}

private void addCurrentCountStoreFile( List<StoreFileMetadata> files )
private void addCountStoreFiles( List<StoreFileMetadata> files )
{
File countStoreFile = neoStores.getCounts().currentFile();
StoreFileMetadata countStoreFileMetadata = new StoreFileMetadata( countStoreFile,
Optional.of( StoreType.COUNTS ), RecordFormat.NO_RECORD_SIZE );
files.add( countStoreFileMetadata );
Iterable<File> countStoreFiles = neoStores.getCounts().allFiles();
for ( File countStoreFile : countStoreFiles )
{
StoreFileMetadata countStoreFileMetadata = new StoreFileMetadata( countStoreFile,
Optional.of( StoreType.COUNTS ), RecordFormat.NO_RECORD_SIZE );
files.add( countStoreFileMetadata );
}
}

/**
Expand Down
Expand Up @@ -21,6 +21,8 @@

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
Expand Down Expand Up @@ -243,6 +245,19 @@ private boolean transfer( EntryVisitor<WritableBuffer> producer, EntryVisitor<Re
return true;
}

public Iterable<File> allFiles()
{
List<File> existingFiles = new ArrayList<>();
for ( File candidateFile : rotationStrategy.candidateFiles() )
{
if ( candidateFile.exists() )
{
existingFiles.add( candidateFile );
}
}
return existingFiles;
}

private class RotationTask implements PreparedRotation, Runnable
{
private final RotationState<Key> rotation;
Expand Down

0 comments on commit a6a0b73

Please sign in to comment.