Skip to content

Commit

Permalink
sprit the result info off
Browse files Browse the repository at this point in the history
  • Loading branch information
vintmd committed Jan 8, 2021
1 parent 52a4d80 commit bee7f2c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
10 changes: 10 additions & 0 deletions src/main/java/org/apache/hadoop/fs/CosResultInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*/
public class CosResultInfo {
private String requestID;
private boolean isKeySameToPrefix;

CosResultInfo() {
requestID = "";
isKeySameToPrefix = false;
}

public void setRequestID(String requestID) {
Expand All @@ -16,4 +18,12 @@ public void setRequestID(String requestID) {
public String getRequestID() {
return this.requestID;
}

public boolean isKeySameToPrefix() {
return this.isKeySameToPrefix;
}

public void setKeySameToPrefix(boolean isKeySameToPrefix) {
this.isKeySameToPrefix = isKeySameToPrefix;
}
}
14 changes: 6 additions & 8 deletions src/main/java/org/apache/hadoop/fs/PartialListing.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,30 @@ public class PartialListing {
private final String priorLastKey;
private final FileMetadata[] files;
private final FileMetadata[] commonPrefixes;
private boolean isKeySamePrefix;
private String requestID;
private CosResultInfo resultInfo;

public PartialListing(String priorLastKey, FileMetadata[] files,
FileMetadata[] commonPrefixes) {
this.priorLastKey = priorLastKey;
this.files = files;
this.commonPrefixes = commonPrefixes;
this.isKeySamePrefix = false;
this.requestID = "";
this.resultInfo = new CosResultInfo();
}

public void setKeySamePrefix(boolean isKeySamePrefix) {
this.isKeySamePrefix = isKeySamePrefix;
this.resultInfo.setKeySameToPrefix(isKeySamePrefix);
}

public boolean isKeySamePrefix() {
return this.isKeySamePrefix;
return this.resultInfo.isKeySameToPrefix();
}

public void setRequestID(String requestID) {
this.requestID = requestID;
this.resultInfo.setRequestID(requestID);
}

public String getRequestID() {
return this.requestID;
return this.resultInfo.getRequestID();
}

public FileMetadata[] getFiles() {
Expand Down

0 comments on commit bee7f2c

Please sign in to comment.