private void initSessions ( ) throws FileNotFoundException , ClassNotFoundException , IOException , ResourceNotExistingException , TTException { Map < String , String > filelisteners = getFilelisteners ( ) ; mSessions = new HashMap < String , ISession > ( ) ; mTrx = new HashMap < String , IFilelistenerWriteTrx > ( ) ; if ( filelisteners . isEmpty ( ) ) { return ; } for ( Entry < String , String > e : filelisteners . entrySet ( ) ) { mSessions . put ( e . getKey ( ) , StorageManager . getSession ( e . getKey ( ) ) ) ; mTrx . put ( e . getKey ( ) , new FilelistenerWriteTrx ( mSessions . get ( e . getKey ( ) ) . beginBucketWtx ( ) , mSessions . get ( e . getKey ( ) ) ) ) ; mSubDirectories . put ( e . getValue ( ) , new ArrayList < String > ( ) ) ; mExecutorMap . put ( e . getValue ( ) , Executors . newSingleThreadExecutor ( ) ) ; List < String > subDirs = mSubDirectories . get ( e . getValue ( ) ) ; for ( String s : mTrx . get ( e . getKey ( ) ) . getFilePaths ( ) ) { String fullFilePath = new StringBuilder ( ) . append ( e . getValue ( ) ) . append ( File . separator ) . append ( s ) . toString ( ) ; subDirs . add ( fullFilePath ) ; Path p = Paths . get ( fullFilePath ) ; watchParents ( p , e . getValue ( ) ) ; } } }
This method is used to initialize a session with treetank for every storage configuration thats in the database .