Skip to content
Snippets Groups Projects
Commit 354ae773 authored by felmer's avatar felmer
Browse files

SSDM-13489: Adding log statements in context of caching file system views

parent 5320ef74
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package ch.systemsx.cisd.openbis.dss.generic.server.ftp; package ch.systemsx.cisd.openbis.dss.generic.server.ftp;
import java.lang.ref.Cleaner;
import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
...@@ -115,6 +116,15 @@ public class DSSFileSystemView implements FileSystemView ...@@ -115,6 +116,15 @@ public class DSSFileSystemView implements FileSystemView
{ {
this.sessionToken = sessionToken; this.sessionToken = sessionToken;
this.cache = new Cache(); this.cache = new Cache();
Cleaner cleaner = Cleaner.create();
cleaner.register(cache, new Runnable()
{
@Override
public void run()
{
operationLog.info("Finish cache for session " + sessionToken + ": " + cache);
}
});
this.service = this.service =
(IServiceForDataStoreServer) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { IServiceForDataStoreServer.class }, (IServiceForDataStoreServer) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { IServiceForDataStoreServer.class },
new ServiceInvocationHandler(service)); new ServiceInvocationHandler(service));
......
...@@ -350,14 +350,17 @@ public class FtpServer implements FileSystemFactory, org.apache.sshd.common.file ...@@ -350,14 +350,17 @@ public class FtpServer implements FileSystemFactory, org.apache.sshd.common.file
String sessionToken = ((FtpUser) user).getSessionToken(); String sessionToken = ((FtpUser) user).getSessionToken();
DSSFileSystemView fileSystemView = new DSSFileSystemView(sessionToken, openBisService, generalInfoService, DSSFileSystemView fileSystemView = new DSSFileSystemView(sessionToken, openBisService, generalInfoService,
v3api, pathResolverRegistry); v3api, pathResolverRegistry);
operationLog.info("Get file system views set for session " + sessionToken + " ("
+ fileSystemViewsBySessionToken.size() + " sessions are cached)");
Set<DSSFileSystemView> views = fileSystemViewsBySessionToken.get(sessionToken); Set<DSSFileSystemView> views = fileSystemViewsBySessionToken.get(sessionToken);
if (views == null) if (views == null)
{ {
operationLog.info("Create new file system views set for session " + sessionToken);
views = new HashSet<>(); views = new HashSet<>();
fileSystemViewsBySessionToken.put(sessionToken, views); fileSystemViewsBySessionToken.put(sessionToken, views);
} }
views.add(fileSystemView); views.add(fileSystemView);
operationLog.info(views.size() + " filesystem views"); operationLog.info("There are " + views.size() + " file system views sets cached for session " + sessionToken);
return fileSystemView; return fileSystemView;
} else } else
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment