remove unnecessary mapping to TagSpecificBaseDir
This commit is contained in:
@@ -27,26 +27,6 @@ public class TagsToFile implements AutoCloseable {
|
|||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TagsToFile.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(TagsToFile.class);
|
||||||
|
|
||||||
private static class TagSpecificBaseDir {
|
|
||||||
private final Path path;
|
|
||||||
|
|
||||||
private final Tags tags;
|
|
||||||
|
|
||||||
public TagSpecificBaseDir(final Path path, final Tags tags) {
|
|
||||||
super();
|
|
||||||
this.path = path;
|
|
||||||
this.tags = tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Path getPath() {
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Tags getTags() {
|
|
||||||
return tags;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class WriterCache {
|
private static class WriterCache {
|
||||||
final List<PdbWriter> writers = new ArrayList<>();
|
final List<PdbWriter> writers = new ArrayList<>();
|
||||||
|
|
||||||
@@ -98,23 +78,6 @@ public class TagsToFile implements AutoCloseable {
|
|||||||
|
|
||||||
public List<PdbFile> getFilesForQuery(final String query) {
|
public List<PdbFile> getFilesForQuery(final String query) {
|
||||||
final List<PdbFile> result = new ArrayList<>();
|
final List<PdbFile> result = new ArrayList<>();
|
||||||
final List<TagSpecificBaseDir> tagSpecificFolders = getTagSpecificFolders(query);
|
|
||||||
|
|
||||||
for (final TagSpecificBaseDir tagSpecific : tagSpecificFolders) {
|
|
||||||
|
|
||||||
final Tags fileSpecificTags = tagSpecific.getTags();
|
|
||||||
|
|
||||||
final Path storageFile = tagSpecific.getPath();
|
|
||||||
final PdbFile pdbFile = new PdbFile(storageFile, fileSpecificTags);
|
|
||||||
|
|
||||||
result.add(pdbFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<TagSpecificBaseDir> getTagSpecificFolders(final String query) {
|
|
||||||
final List<TagSpecificBaseDir> result = new ArrayList<>();
|
|
||||||
|
|
||||||
final List<Doc> searchResult = db.search(query);
|
final List<Doc> searchResult = db.search(query);
|
||||||
if (searchResult.size() > 100_000){
|
if (searchResult.size() > 100_000){
|
||||||
@@ -125,8 +88,9 @@ public class TagsToFile implements AutoCloseable {
|
|||||||
|
|
||||||
final Path path = document.getPath();
|
final Path path = document.getPath();
|
||||||
final Tags tags = document.getTags();
|
final Tags tags = document.getTags();
|
||||||
|
final PdbFile pdbFile = new PdbFile(path, tags);
|
||||||
|
|
||||||
result.add(new TagSpecificBaseDir(path, tags));
|
result.add(pdbFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user