Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ public synchronized void updateCachedLast(
}
}

public String getFullPath() {
return concatFullPath();
}

public void resetCache() {
cachedLastValuePair = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public abstract class MNode implements Serializable {
/**
* Name of the MNode
*/
private String name;
protected String name;

protected MNode parent;

/**
* from root to this node, only be set when used once
* from root to this node, only be set when used once for InternalMNode
*/
protected String fullPath;

Expand Down Expand Up @@ -95,14 +95,18 @@ public String getFullPath() {
if (fullPath != null) {
return fullPath;
}
fullPath = concatFullPath();
return fullPath;
}

String concatFullPath() {
StringBuilder builder = new StringBuilder(name);
MNode curr = this;
while (curr.getParent() != null) {
curr = curr.getParent();
builder.insert(0, IoTDBConstant.PATH_SEPARATOR).insert(0, curr.name);
}
fullPath = builder.toString();
return fullPath;
return builder.toString();
}

@Override
Expand Down