public QueryResult<FileIndex> updateFileIndexStatus(File file, String newStatus, String message, String sessionId) throws CatalogException { return updateFileIndexStatus(file, newStatus, message, null, sessionId); }
FileIndex.IndexStatus.READY, newStatus); catalogManager.getFileManager() .updateFileIndexStatus(file, newStatus, "Not indexed, regarding StudyConfiguration", sessionId); catalogManager.getFileManager().updateFileIndexStatus(file, newStatus, "Error loading. Reset status to " + newStatus, sessionId); newStatus = FileIndex.IndexStatus.INDEXING; catalogManager.getFileManager().updateFileIndexStatus(file, newStatus, "File is being loaded regarding Storage", sessionId);
@Test public void testTransformTransformingFiles() throws Exception { QueryOptions queryOptions = new QueryOptions(VariantStorageEngine.Options.ANNOTATE.key(), false) .append(VariantStorageEngine.Options.CALCULATE_STATS.key(), false); List<File> files = Arrays.asList(getFile(0), getFile(1)); catalogManager.getFileManager().updateFileIndexStatus(getFile(1), FileIndex.IndexStatus.TRANSFORMING, "", sessionId); // Expect both files to be loaded indexFiles(files, Arrays.asList(getFile(0)), queryOptions, outputId); }
@Test public void testUpdateIndexStatus() throws CatalogException { QueryResult<File> fileResult = fileManager.create(studyFqn, File.Type.FILE, File.Format.VCF, File.Bioformat.VARIANT, "data/test.vcf", "", "description", new File.FileStatus(File.FileStatus.STAGE), 0, -1, Collections.emptyList(), -1, Collections.emptyMap(), Collections.emptyMap(), true, null, new QueryOptions(), sessionIdUser); fileManager.updateFileIndexStatus(fileResult.first(), FileIndex.IndexStatus.TRANSFORMED, null, sessionIdUser); QueryResult<File> read = fileManager.get(studyFqn, fileResult.first().getPath(), new QueryOptions(), sessionIdUser); assertEquals(FileIndex.IndexStatus.TRANSFORMED, read.first().getIndex().getStatus().getName()); }
fileManager.updateFileIndexStatus(indexedFile, indexStatusName, indexStatusMessage, release, sessionId);
QueryResult<FileIndex> fileIndexQueryResult = fileManager.updateFileIndexStatus(file, fileStatus, fileStatusMessage, release, sessionId); file.setIndex(fileIndexQueryResult.first());
public static File createFile(String path, boolean indexed) throws CatalogException { File file = catalog.getFileManager().create("s1", File.Type.FILE, File.Format.VCF, File.Bioformat.VARIANT, path, null, null, null, 10, -1, null, -1, null, null, true, "", null, sessionId).first(); if (indexed) { int release = catalog.getProjectManager().get("p1", null, sessionId).first().getCurrentRelease(); catalog.getFileManager().updateFileIndexStatus(file, Status.READY, "", release, sessionId); } return file; }
@Test public void testResumeTransformTransformingFiles() throws Exception { QueryOptions queryOptions = new QueryOptions(VariantStorageEngine.Options.ANNOTATE.key(), false) .append(VariantStorageEngine.Options.CALCULATE_STATS.key(), false) .append(VariantStorageEngine.Options.RESUME.key(), true); List<File> files = Arrays.asList(getFile(0), getFile(1)); catalogManager.getFileManager().updateFileIndexStatus(getFile(1), FileIndex.IndexStatus.TRANSFORMING, "", sessionId); // Expect only the first file to be loaded indexFiles(files, files, queryOptions, outputId); }