public F.Tuple<Integer, Integer> getClusterThroughput() {
   final Map<Node, NodeThroughputResponse> responses;
   try {
     responses =
         api.path(routes.ThroughputResource().total(), NodeThroughputResponse.class)
             .fromAllNodes()
             .executeOnAll();
   } catch (APIException e) {
     LOG.error("Unable to load cluster throughput", e);
     return F.Tuple(0, 0);
   }
   int t = 0;
   for (Map.Entry<Node, NodeThroughputResponse> entry : responses.entrySet()) {
     if (entry.getValue() == null) {
       LOG.warn("Skipping failed throughput request for node {}", entry.getKey());
       continue;
     }
     t += entry.getValue().throughput;
   }
   return F.Tuple(t, responses.size());
 }
Example #2
0
 @Util
 private static F.T2<List<MessageIndexDto>, Integer> getMessageIndexList(
     CommonSearchDto cs, int pageNo) {
   List<MessageIndexDto> messageIndexDtoList = null;
   if (cs != null && StringUtils.isNotBlank(cs.keyWord)) {
     cs.searchType = 1;
   }
   int moreType = cs.searchType;
   long advanceId = cs.advanceId;
   switch (moreType) {
     case 2:
       messageIndexDtoList = doAdvanceInfoSearch(advanceId, cs, pageNo);
       break;
     case 3:
       messageIndexDtoList = doDirectAdvanceSearch(pageNo, cs);
       break;
     default:
       messageIndexDtoList = doCommonInfoSearch(cs);
   }
   return F.T2(messageIndexDtoList, moreType);
 }