类 TaskflowUtils


  • public class TaskflowUtils
    extends Object
    从以下版本开始:
    2024-09-04
    作者:
    SHOUSHEN.LUAN
    • 构造器详细资料

      • TaskflowUtils

        public TaskflowUtils()
    • 方法详细资料

      • dumpStackTrace

        public static String dumpStackTrace​(Throwable t)
        dump异常堆栈
        参数:
        t -
        返回:
      • dumpFullStackTrace

        public static String dumpFullStackTrace​(Throwable t)
        dump完整的执行栈
        参数:
        t -
        返回:
      • f

        public static String f​(String format,
                               Object... args)
        string format
        参数:
        format -
        args -
        返回:
      • blockedWait

        public static void blockedWait​(List<Future<?>> futures,
                                       int timeoutMs)
        等待futures执行完成,累计等待超时时间为 timeoutMs
        参数:
        futures -
        timeoutMs - 超时时间(单位:毫秒)
      • retryOperation

        public static void retryOperation​(Runnable task,
                                          int count,
                                          String opName)
        自动重试处理
        参数:
        task - 执行的任务
        count - 若执行出错,累计最大执行次数
        opName - 操作名称
      • getReasonableTimeout

        public static int getReasonableTimeout​(Worker worker)
        获取拉取任务超时时间,最小100ms,最大为1000ms
        参数:
        worker -
        返回: