private static TaskFilter createTaskFilter(String filter) {
    switch (TaskFilter.TaskType.getTaskType(filter)) {
      case GENERAL:
        return task -> task instanceof MonitoredRPCHandler;
      case HANDLER:
        return task -> !(task instanceof MonitoredRPCHandler);
      case RPC:
        return task -> !(task instanceof MonitoredRPCHandler)
          || !((MonitoredRPCHandler) task).isRPCRunning();
      case OPERATION:
        return task -> !(task instanceof MonitoredRPCHandler)
          || !((MonitoredRPCHandler) task).isOperationRunning();
      default:
        return task -> false;
    }
  }
Create a task filter according to a given filter type.
@param filter type of monitored task
@return a task filter
hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java