Skip to content

Commit

Permalink
Move getLink() to Inode class
Browse files Browse the repository at this point in the history
  • Loading branch information
li-leyang committed May 11, 2022
1 parent be9f9d9 commit 75ede1a
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ public INode(String pathToNode, UserGroupInformation aUgi) {
boolean isLink() {
return !isInternalDir();
}

/**
* Return the link if isLink.
* @return will return null, for non links.
*/
INodeLink<T> getLink() {
return null;
}
}

/**
Expand Down Expand Up @@ -243,6 +251,7 @@ static class INodeDirLink<T> extends INodeDir<T> {
this.link = link;
}

@Override
INodeLink<T> getLink() {
return link;
}
Expand Down Expand Up @@ -370,6 +379,11 @@ boolean isInternalDir() {
return false;
}

@Override
INodeLink<T> getLink() {
return this;
}

/**
* Get the instance of FileSystem to use, creating one if needed.
* @return An Initialized instance of T
Expand Down
Loading

0 comments on commit 75ede1a

Please sign in to comment.