Skip to content

Commit

Permalink
dcache-frontend: include new QoS Policy attributes in -optional
Browse files Browse the repository at this point in the history
Motivation:

User should be able to request info on the QoS policy and state index
for a given file.

Modification:

Return these as part of the optional attributes.

Result:

New attributes included in optional.

Target: master
Patch: https://rb.dcache.org/r/14104/
Requires-book: no
Acked-by: Lea
  • Loading branch information
alrossi committed Sep 27, 2023
1 parent 805735f commit 34b4115
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ public class JsonFileAttributes {
@ApiModelProperty("File's labels.")
private Set<String> labels;

@ApiModelProperty("File's QoS policy.")
private String qosPolicy;

@ApiModelProperty("File's current QoS policy state index.")
private Integer qosState;


public ACL getAcl() {
return _acl;
}
Expand Down Expand Up @@ -407,4 +414,20 @@ public void setLabels(Set<String> labelnames) {
public Set<String> getLabels() {
return labels == null ? new HashSet() : labels;
}

public String getQosPolicy() {
return qosPolicy;
}

public void setQosPolicy(String qosPolicy) {
this.qosPolicy = qosPolicy;
}

public Integer getQosState() {
return qosState;
}

public void setQosState(Integer qosState) {
this.qosState = qosState;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ private static void addAllOptionalAttributes(JsonFileAttributes json,
json.setStorageInfo(info);
json.setSuris(info.locations());
}

if (attributes.isDefined(FileAttribute.QOS_POLICY)) {
json.setQosPolicy(attributes.getQosPolicy());
}

if (attributes.isDefined(FileAttribute.QOS_STATE)) {
json.setQosState(attributes.getQosState());
}
}

public static Set<FileAttribute> getRequestedAttributes(boolean locality,
Expand Down Expand Up @@ -287,6 +295,8 @@ public static Set<FileAttribute> getRequestedAttributes(boolean locality,
attributes.add(FileAttribute.OWNER_GROUP);
attributes.add(FileAttribute.OWNER);
attributes.add(FileAttribute.STORAGECLASS);
attributes.add(FileAttribute.QOS_POLICY);
attributes.add(FileAttribute.QOS_STATE);
}

return ImmutableSet.copyOf(attributes);
Expand Down

0 comments on commit 34b4115

Please sign in to comment.