Skip to content

Commit

Permalink
last one
Browse files Browse the repository at this point in the history
  • Loading branch information
takutosato committed Aug 1, 2024
1 parent 9f2b757 commit 5fcc7ce
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/main/java/picard/nio/PicardBucketUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class PicardBucketUtils {
public static final String HDFS_SCHEME = "hdfs";
public static final String FILE_SCHEME = "file";

// This Picard test staging bucket has a TTL of 180 days (DeleteAction with Age = 180)
public static final String GCLOUD_PICARD_STAGING_DIRECTORY = "gs://hellbender-test-logs/staging/picard/";

// slashes omitted since hdfs paths seem to only have 1 slash which would be weirder to include than no slashes
private PicardBucketUtils(){} //private so that no one will instantiate this class

Expand Down Expand Up @@ -85,8 +88,7 @@ public static PicardHtsPath getTempFilePath(String directory, String extension){
}

/**
*
* Creates a temporary file on the local temporary file.
* Creates a temporary file in a local directory.
*
* @see #getTempFilePath(String, String, String)
*/
Expand All @@ -101,18 +103,17 @@ public static PicardHtsPath getLocalTempFilePath(final String prefix, final Stri
* we mean a path object with a randomly generated URI ending in "/", which
* the caller can use as a root URI/path for other files to be created e.g. via PicardHtsPath::resolve.
*
* Note that this method does *not* create an actual directory/file on GCS that one can write to, delete, or manipulate otherwise.
* Note that this method does *not* create an actual directory/file on GCS that one can write to, delete, or otherwise manipulate.
*
* See: https://stackoverflow.com/questions/51892343/google-gsutil-create-folder
*
* @param relativePath The relative location for the new "directory" under the harcoded staging bucket with a TTL set e.g. "test/RevertSam/".
* @return A PicardHtsPath object to a randomly generated "directory" e.g. "gs://hellbender-test-logs/staging/picard/test/RevertSam/{randomly-generated-string}/"
*/
public static PicardHtsPath getRandomGCSDirectory(final String relativePath){
ValidationUtils.validateArg(relativePath.endsWith("/"), "relativePath must end in backslash '/': " + relativePath);
// This Picard test staging bucket has a TTL of 180 days (DeleteAction with Age = 180)
final String stagingDirectory = "gs://hellbender-test-logs/staging/picard/";
return PicardHtsPath.fromPath(PicardBucketUtils.randomRemotePath(stagingDirectory + relativePath, "", "/"));
ValidationUtils.validateArg(relativePath.endsWith("/"), "relativePath must end in backslash '/': " + relativePath)

return PicardHtsPath.fromPath(PicardBucketUtils.randomRemotePath(GCLOUD_PICARD_STAGING_DIRECTORY + relativePath, "", "/"));
}

/**
Expand Down

0 comments on commit 5fcc7ce

Please sign in to comment.