Skip to content

Commit

Permalink
Replaced PnfsId.getId by PnfsId.toString in URI construction
Browse files Browse the repository at this point in the history
  • Loading branch information
vingar committed Sep 13, 2018
1 parent 56af6d8 commit fc96996
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.ndgf</groupId>
<artifactId>dcache-endit-provider</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
<packaging>jar</packaging>

<name>dCache Endit provider</name>
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/org/ndgf/endit/FlushTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
import java.util.List;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.dcache.pool.nearline.spi.FlushRequest;

import static java.util.Arrays.asList;
Expand All @@ -42,6 +45,8 @@ class FlushTask implements PollingTask<Set<URI>>
private final String type;
private final String name;

private final static Logger LOGGER = LoggerFactory.getLogger(FlushTask.class);

public FlushTask(FlushRequest request, Path outDir, String type, String name)
{
this.type = type;
Expand Down Expand Up @@ -70,7 +75,15 @@ public Set<URI> start() throws IOException
public Set<URI> poll() throws URISyntaxException
{
if (!Files.exists(outFile)) {
return Collections.singleton(new URI(type, name, null, "bfid=" + pnfsId.getId(), null));
LOGGER.debug("File " + name + " deleted");
URI uri = new URI(type, name, null, "bfid=" + pnfsId.toString(), null);
// URI format: hsmType://hsmInstance/?store=storename&group=groupname&bfid=bfid
// <hsmType>: The type of the Tertiary Storage System
// <hsmInstance>: The name of the instance
// <storename> and <groupname> : The store and group name of the file as provided by the arguments to this executable.
// <bfid>: The unique identifier needed to restore or remove the file if necessary.
LOGGER.debug("Send back uri: " + uri.toString());
return Collections.singleton(uri);
}
return null;
}
Expand Down

0 comments on commit fc96996

Please sign in to comment.