Class PartitionUtils

java.lang.Object
org.neo4j.gds.core.utils.partition.PartitionUtils

public final class PartitionUtils extends Object
  • Method Details

    • rangePartition

      public static <TASK> List<TASK> rangePartition(int concurrency, long nodeCount, Function<Partition,TASK> taskCreator, Optional<Integer> minBatchSize)
    • rangePartitionWithBatchSize

      public static <TASK> List<TASK> rangePartitionWithBatchSize(long nodeCount, long batchSize, Function<Partition,TASK> taskCreator)
    • numberAlignedPartitioning

      public static List<Partition> numberAlignedPartitioning(int concurrency, long nodeCount, long alignTo)
    • numberAlignedPartitioning

      public static <TASK> List<TASK> numberAlignedPartitioning(int concurrency, long nodeCount, long alignTo, Function<Partition,TASK> taskCreator)
    • numberAlignedPartitioningWithMaxSize

      public static List<Partition> numberAlignedPartitioningWithMaxSize(int concurrency, long nodeCount, long alignTo, long maxPartitionSize)
    • numberAlignedPartitioningWithMaxSize

      public static <TASK> List<TASK> numberAlignedPartitioningWithMaxSize(int concurrency, long nodeCount, long alignTo, long maxPartitionSize, Function<Partition,TASK> taskCreator)
    • degreePartition

      public static <TASK> List<TASK> degreePartition(Graph graph, int concurrency, Function<DegreePartition,TASK> taskCreator, Optional<Integer> minBatchSize)
    • degreePartition

      public static <TASK> List<TASK> degreePartition(long nodeCount, long relationshipCount, PartitionUtils.DegreeFunction degrees, int concurrency, Function<DegreePartition,TASK> taskCreator, Optional<Integer> minBatchSize)
    • customDegreePartitionWithBatchSize

      public static <TASK> List<TASK> customDegreePartitionWithBatchSize(Graph graph, int concurrency, LongToIntFunction customDegreeFunction, Function<DegreePartition,TASK> taskCreator, Optional<Integer> minBatchSize, Optional<Long> weightSum)
    • degreePartitionStream

      public static Stream<DegreePartition> degreePartitionStream(long nodeCount, long relationshipCount, int concurrency, PartitionUtils.DegreeFunction degrees)
      Returns a lazy stream of many small partitions (in contrast to list of few big ones)
    • degreePartitionWithBatchSize

      public static <TASK> List<TASK> degreePartitionWithBatchSize(Graph graph, long batchSize, Function<DegreePartition,TASK> taskCreator)
    • degreePartitionWithBatchSize

      public static <TASK> List<TASK> degreePartitionWithBatchSize(long nodeCount, PartitionUtils.DegreeFunction degrees, long batchSize, Function<DegreePartition,TASK> taskCreator)
    • degreePartitionWithBatchSize

      public static <TASK> List<TASK> degreePartitionWithBatchSize(com.carrotsearch.hppc.BitSet bitset, PartitionUtils.DegreeFunction degrees, long degreesPerBatch, Function<IteratorPartition,TASK> taskCreator)
    • rangePartitionActualBatchSizes

      public static List<Long> rangePartitionActualBatchSizes(int concurrency, long nodeCount, Optional<Integer> minBatchSize)
    • blockAlignedPartitioning

      public static <TASK> Iterator<TASK> blockAlignedPartitioning(org.neo4j.gds.collections.ha.HugeLongArray sortedIds, int blockShift, Function<Partition,TASK> taskCreator)