[ 
https://issues.apache.org/jira/browse/HADOOP-18129?focusedWorklogId=729765&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-729765
 ]

ASF GitHub Bot logged work on HADOOP-18129:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Feb/22 17:51
            Start Date: 18/Feb/22 17:51
    Worklog Time Spent: 10m 
      Work Description: ibuenros commented on a change in pull request #3996:
URL: https://github.com/apache/hadoop/pull/3996#discussion_r810219824



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java
##########
@@ -294,11 +294,11 @@ void addLink(final String pathComponent, final 
INodeLink<T> link)
      */
     INodeLink(final String pathToNode, final UserGroupInformation aUgi,
         Function<URI, T> createFileSystemMethod,
-        final URI aTargetDirLink) {
+        final String aTargetDirLink) throws URISyntaxException {
       super(pathToNode, aUgi);
       targetFileSystem = null;
-      targetDirLinkList = new URI[1];
-      targetDirLinkList[0] = aTargetDirLink;
+      targetDirLinkList = new String[1];
+      targetDirLinkList[0] = new URI(aTargetDirLink).toString();

Review comment:
       What is the purpose of creating a URI and converting back to string?

##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
##########
@@ -216,19 +216,19 @@ public boolean equals(Object obj) {
     /**
      * Array of target FileSystem URIs.
      */
-    private final URI[] targetFileSystemURIs;
+    private final String[] targetFileSystemPaths;
 
-    MountPoint(Path srcPath, URI[] targetFs) {
+    MountPoint(Path srcPath, String[] targetFs) {
       mountedOnPath = srcPath;
-      targetFileSystemURIs = targetFs;
+      targetFileSystemPaths = targetFs;
     }
 
     public Path getMountedOnPath() {
       return mountedOnPath;
     }
 
-    public URI[] getTargetFileSystemURIs() {
-      return targetFileSystemURIs;
+    public String[] getTargetFileSystemPaths() {

Review comment:
       This is a public method, can we keep the old signature? We can transform 
from string to URI within the method itself.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 729765)
    Time Spent: 0.5h  (was: 20m)

> Change URI[] in INodeLink to String[] to reduce memory footprint of 
> ViewFileSystem
> ----------------------------------------------------------------------------------
>
>                 Key: HADOOP-18129
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18129
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Abhishek Das
>            Assignee: Abhishek Das
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Around 40k instances of INodeLink each of which is taking memory ranging from 
> 1680bytes to 1160bytes. Multiplying 40k with 1160bytes will give us 
> approximate 45mb.
> With changing from URI to String in INodeLink the memory consumed by each of 
> the INodeLink objects has reduced from ~1160 bytes to ~320 bytes. Overall 
> size becomes (40k X 320) 12mb



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to