Class MutableGraphCache

java.lang.Object
com.aizuda.snailjob.server.job.task.support.cache.MutableGraphCache

public class MutableGraphCache extends Object
Since:
2.6.0
Author:
xiaowoniu
  • Constructor Details

    • MutableGraphCache

      public MutableGraphCache()
  • Method Details

    • getOrDefault

      public static com.google.common.graph.MutableGraph<Long> getOrDefault(Long workflowBatchId, String jsonGraph)
      获取指定workflowBatchId的可变图对象,若图对象不存在则使用给定的jsonGraph反序列化生成新的图对象并返回
      Parameters:
      workflowBatchId - 工作流批次ID
      jsonGraph - JSON格式的图对象字符串
      Returns:
      MutableGraph 图对象
    • get

      public static com.google.common.graph.MutableGraph<Long> get(Long workflowBatchId)
      根据给定的workflowBatchId获取图对象。
      Parameters:
      workflowBatchId - 工作流批次ID
      Returns:
      MutableGraph 返回对应的图对象,如果不存在则返回空图
    • getLeaves

      public static List<Long> getLeaves(Long workflowBatchId, String jsonGraph)
      获取所有的叶子节点
      Parameters:
      workflowBatchId - 工作流批次ID
      jsonGraph - JSON格式的图对象字符串
      Returns:
      叶子节点
    • getAllDescendants

      public static Set<Long> getAllDescendants(com.google.common.graph.MutableGraph<Long> graph, Long parentId)
    • getBrotherNode

      public static Set<Long> getBrotherNode(com.google.common.graph.MutableGraph<Long> graph, Long nodeId)