Class RecentTablesListManager

  • Direct Known Subclasses:
    RecentStreamsListManager

    public class RecentTablesListManager
    extends java.lang.Object
    - Manages the recent tables list of a user. - Persists the list to /user//.recent_tables file. - Limits the number of entries in this file to MAX_RECENT_TABLES_LIST_SIZE Author: smarella
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.String newTable)
      Adds {@param newTable} to the top of recent tables list.
      void delete​(java.lang.String tablePath)
      Deletes {@param tablePath} from the recent tables list.
      void deleteIfNotExist​(java.lang.String tablePath, com.mapr.fs.MapRFileSystem mfs)  
      protected java.lang.String getHomeDir()  
      java.util.List<java.lang.String> getListFromFile()  
      protected java.lang.String getPathForRecentList()  
      boolean hasHomeDir()
      Check if user has a home directory or not.
      void moveToTop​(java.lang.String mostRecentTable)
      Move up the {@param mostRecentTable} to the top of the recent tables list, if it exists.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RecentTablesListManager

        public RecentTablesListManager​(java.lang.String user)
    • Method Detail

      • hasHomeDir

        public boolean hasHomeDir()
        Check if user has a home directory or not.
        Returns:
      • add

        public void add​(java.lang.String newTable)
        Adds {@param newTable} to the top of recent tables list. Keeps the list size to MAX_RECENT_TABLES_LIST_SIZE
        Parameters:
        newTable -
      • moveToTop

        public void moveToTop​(java.lang.String mostRecentTable)
        Move up the {@param mostRecentTable} to the top of the recent tables list, if it exists. Else, add it to the top of the list.
        Parameters:
        mostRecentTable -
      • delete

        public void delete​(java.lang.String tablePath)
        Deletes {@param tablePath} from the recent tables list.
        Parameters:
        tablePath -
      • deleteIfNotExist

        public void deleteIfNotExist​(java.lang.String tablePath,
                                     com.mapr.fs.MapRFileSystem mfs)
      • getListFromFile

        public java.util.List<java.lang.String> getListFromFile()
      • getPathForRecentList

        protected java.lang.String getPathForRecentList()
      • getHomeDir

        protected java.lang.String getHomeDir()