Class GenericSorter<T>

java.lang.Object
com.mapr.baseutils.utils.GenericSorter<T>

public abstract class GenericSorter<T> extends Object
  • Constructor Details

    • GenericSorter

      public GenericSorter()
  • Method Details

    • sortList

      public abstract void sortList(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 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 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(String str)
    • compareLong

      public int compareLong(Long l1, Long l2)
    • compareString

      public int compareString(String s1, String s2)
    • compareBoolean

      public int compareBoolean(Boolean b1, Boolean b2)
    • compareStringIgnoreCase

      public int compareStringIgnoreCase(String s1, 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.