Class GenericSorter<T>


  • public abstract class GenericSorter<T>
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      GenericSorter()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int compareBoolean​(java.lang.Boolean b1, java.lang.Boolean b2)  
      int compareLong​(java.lang.Long l1, java.lang.Long l2)  
      int compareString​(java.lang.String s1, java.lang.String s2)  
      int compareStringIgnoreCase​(java.lang.String s1, java.lang.String s2)  
      protected abstract java.util.List<T> getFreshList​(com.mapr.fs.cldb.proto.CLDBProto.ListSortKey sortingKey)
      Child class shall implement logic of creating list.
      java.util.List<T> getSortedList​(com.mapr.fs.cldb.proto.CLDBProto.ListSortKey sortingKey)
      Returns list sorted by requested key.
      protected abstract int getSortedListRefreshSeconds()  
      protected void logMessage​(java.lang.String str)  
      boolean purgeExpiredList()
      Method to be called by PurgeExecutor for purging old entries.
      abstract void sortList​(java.util.List<T> list, com.mapr.fs.cldb.proto.CLDBProto.ListSortKey sortingKey)
      Child class shall implement logic of sorting given list by specified order.
      • Methods inherited from class java.lang.Object

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

      • GenericSorter

        public GenericSorter()
    • Method Detail

      • sortList

        public abstract void sortList​(java.util.List<T> list,
                                      com.mapr.fs.cldb.proto.CLDBProto.ListSortKey sortingKey)
        Child class shall implement logic of sorting given list by specified order.
      • getFreshList

        protected abstract java.util.List<T> getFreshList​(com.mapr.fs.cldb.proto.CLDBProto.ListSortKey sortingKey)
        Child class shall implement logic of creating list.
      • getSortedListRefreshSeconds

        protected abstract int getSortedListRefreshSeconds()
      • getSortedList

        public java.util.List<T> getSortedList​(com.mapr.fs.cldb.proto.CLDBProto.ListSortKey sortingKey)
        Returns list sorted by requested key. Maintains SortedListMap by storing list against create time. Returns list from SortedListMap if the list was recently sorted, else returns a freshly sorted list, after storing it in SortedListMap.
      • logMessage

        protected void logMessage​(java.lang.String str)
      • compareLong

        public int compareLong​(java.lang.Long l1,
                               java.lang.Long l2)
      • compareString

        public int compareString​(java.lang.String s1,
                                 java.lang.String s2)
      • compareBoolean

        public int compareBoolean​(java.lang.Boolean b1,
                                  java.lang.Boolean b2)
      • compareStringIgnoreCase

        public int compareStringIgnoreCase​(java.lang.String s1,
                                           java.lang.String s2)
      • purgeExpiredList

        public boolean purgeExpiredList()
        Method to be called by PurgeExecutor for purging old entries. If the list has out lived its validity threshold, it is purged not otherwise.