Skip to content

Commit

Permalink
skip if hasNullBucket
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Jun 17, 2024
1 parent ab2fba5 commit c7399c9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
12 changes: 6 additions & 6 deletions plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ class QuiltPackage {
return parsed.options[QuiltParser.P_FORCE]
}

boolean is_null() {
return parsed.isNullBucket()
boolean isNull() {
return parsed.hasNullBucket()
}

boolean isInstalled() {
Expand All @@ -183,8 +183,8 @@ class QuiltPackage {
}

Path install() {
if (is_null()) {
log.debug("null bucket: no need to install")
if (isNull()) {
log.debug('null bucket: no need to install')
return null
}
Path dest = packageDest()
Expand Down Expand Up @@ -237,8 +237,8 @@ class QuiltPackage {
}
// https://docs.quiltdata.com/v/version-5.0.x/examples/gitlike#install-a-package
Manifest push(String msg = 'update', Map meta = [:]) {
if (is_null()) {
log.debug("null bucket: no need to push")
if (isNull()) {
log.debug('null bucket: no need to push')
return null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class QuiltParser {
return paths.size() > 0
}

boolean isNullBucket() {
boolean hasNullBucket() {
return NULL_BUCKET == getBucket()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ class QuiltFileSystemProvider extends FileSystemProvider implements FileSystemTr
@Override
def <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options)
throws IOException {
// log.debug '<A>BasicFileAttributes QuiltFileSystemProvider.readAttributes()'
log.debug '<A>BasicFileAttributes QuiltFileSystemProvider.readAttributes()'
def attr = attributesCache.get(path)
if (attr) {
return attr
Expand All @@ -486,8 +486,11 @@ class QuiltFileSystemProvider extends FileSystemProvider implements FileSystemTr
attributesCache[path] = result
return result
}
// log.debug("readAttributes: File ${qPath.localPath()} not found")
throw new NoSuchFileException(qPath.toUriString())
log.debug("readAttributes: File ${qPath.localPath()} not found")
if (!qPath.isNull()) {
throw new NoSuchFileException(qPath.toUriString())
}
log.warn("readAttributes: Ignore ${qPath} for null bucket")
}
throw new UnsupportedOperationException("Not a valid Quilt Storage file attribute type: $type")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ final class QuiltPath implements Path, Comparable {
QuiltParser source = isAbsolute() ? parsed : QuiltParser.forNullBucket()
return QuiltPackage.forParsed(source)
}

String file_key() {
return sub_paths()
}
Expand Down Expand Up @@ -105,6 +105,10 @@ final class QuiltPath implements Path, Comparable {
return !parsed.hasPath()
}

boolean isNull() {
return parsed.hasNullBucket()
}

QuiltPath getJustPackage() {
if (isJustPackage()) { return this }
QuiltParser packageParsed = QuiltParser.forBarePath(parsed.toPackageString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class QuiltPackageTest extends QuiltSpecification {
def qpath = factory.parseUri('quilt+s3://./')
def pkg = qpath.pkg()
expect:
pkg.is_null()
pkg.isNull()
!pkg.install()
!pkg.isInstalled()
Files.exists(qpath.localPath())
Expand Down

0 comments on commit c7399c9

Please sign in to comment.