Package com.mapr.baseutils.utils
Class GenericSorter<T>
java.lang.Object
com.mapr.baseutils.utils.GenericSorter<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareBoolean(Boolean b1, Boolean b2) intcompareLong(Long l1, Long l2) intcompareString(String s1, String s2) intcompareStringIgnoreCase(String s1, String s2) getFreshList(com.mapr.fs.cldb.proto.CLDBProto.ListSortKey sortingKey) Child class shall implement logic of creating list.getSortedList(com.mapr.fs.cldb.proto.CLDBProto.ListSortKey sortingKey) Returns list sorted by requested key.protected abstract intprotected voidlogMessage(String str) booleanMethod to be called by PurgeExecutor for purging old entries.abstract voidChild class shall implement logic of sorting given list by specified order.
-
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
Child class shall implement logic of creating list. -
getSortedListRefreshSeconds
protected abstract int getSortedListRefreshSeconds() -
getSortedList
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
-
compareLong
-
compareString
-
compareBoolean
-
compareStringIgnoreCase
-
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.
-