Class RuntimeConfigBuilder


  • @Generated({"common/config/src/templates/ConfigBuilder.stg","common/config/config.gradle"})
    public final class RuntimeConfigBuilder
    extends java.lang.Object
    Builder for RuntimeConfig.
    • Constructor Detail

      • RuntimeConfigBuilder

        public RuntimeConfigBuilder()
        Constructs an empty RuntimeConfigBuilder
      • RuntimeConfigBuilder

        public RuntimeConfigBuilder​(java.util.Map<RuntimeConfig.Field,​java.lang.Object> values)
        Constructs a RuntimeConfigBuilder initialized with the values from the given map
        Parameters:
        values - a map containing configuration values
      • RuntimeConfigBuilder

        public RuntimeConfigBuilder​(RuntimeConfig config)
        Constructs a RuntimeConfigBuilder initialized with the values from the given config
        Parameters:
        config - the configuration to take the values from
      • RuntimeConfigBuilder

        public RuntimeConfigBuilder​(RuntimeConfigBuilder builder)
        Constructs a RuntimeConfigBuilder initialized with the values from the given builder
        Parameters:
        builder - the builder to take the values from
    • Method Detail

      • putAll

        public RuntimeConfigBuilder putAll​(java.util.Map<RuntimeConfig.Field,​java.lang.Object> values)
        Puts all values from the given map into this builder.
        Parameters:
        values - the values to put in the builder
      • putAll

        public RuntimeConfigBuilder putAll​(RuntimeConfig config)
        Puts all values from the given config into this builder
        Parameters:
        config - the config to take the values from
      • build

        public RuntimeConfig build​(java.lang.String parentPath)
        Builds the RuntimeConfig.
        Parameters:
        parentPath - if not null, resolves relative paths against this parentPath
        Returns:
        an instance of RuntimeConfig
      • build

        public RuntimeConfig build()
        Builds the RuntimeConfig with a parentPath of null.
        Returns:
        An instance of RuntimeConfig
        See Also:
        build(String)
      • toInputStream

        public java.io.InputStream toInputStream()
        Returns:
        an InputStream representing the config
      • getValues

        public java.util.Map<RuntimeConfig.Field,​java.lang.Object> getValues()
        Returns:
        the raw config values
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setNumSpinLocks

        public RuntimeConfigBuilder setNumSpinLocks​(int numSpinLocks)
        how many spin locks each generated app will create at instantiation. Trade-off: small number implies less memory consumption. Big number implies faster execution (if algorithm uses spin locks)
      • setExplicitSpinLocks

        public RuntimeConfigBuilder setExplicitSpinLocks​(boolean explicitSpinLocks)
        true means spin explicitly in a loop until lock becomes available. false means using JDK locks which rely on the JVM to decide whether to context switch or spin. Our experiments showed that setting this value to true results in better performance.
      • setScheduler

        public RuntimeConfigBuilder setScheduler​(SchedulerStrategy scheduler)
        which scheduler to use.
        basic_scheduler = use scheduler with basic features.
        enterprise_scheduler = use scheduler with advanced, enterprise features for running multiple tasks concurrently and increased performance.
        low_latency_scheduler = use scheduler that privileges latency of tasks over throughput or fairness across multiple sessions. The low_latency_scheduler is only available in embedded mode
      • setTaskLength

        public RuntimeConfigBuilder setTaskLength​(int taskLength)
        default task length (only relevant for task-stealing strategies). F/J pool documentation says this value should be between 100 and 10000. Trade-off: small number implies more fine-grained tasks are generated, higher stealing throughput. High number implies less memory consumption and GC activity
      • setSmallTaskLength

        public RuntimeConfigBuilder setSmallTaskLength​(int smallTaskLength)
        task length if total amount of work is small than default task length (only relevant for task-stealing strategies)
      • setBfsThresholdSingleThreaded

        public RuntimeConfigBuilder setBfsThresholdSingleThreaded​(int bfsThresholdSingleThreaded)
        until what number of BFS traversal level items vertices are visited single-threaded
      • setBfsThresholdReadBased

        public RuntimeConfigBuilder setBfsThresholdReadBased​(int bfsThresholdReadBased)
        threshold of BFS traversal level items above which to switch to read-based visiting strategy
      • setBfsIterateQueTaskSize

        public RuntimeConfigBuilder setBfsIterateQueTaskSize​(int bfsIterateQueTaskSize)
        task size for BFS iterate QUE phase
      • setBfsThresholdParentReadBased

        public RuntimeConfigBuilder setBfsThresholdParentReadBased​(double bfsThresholdParentReadBased)
        threshold of BFS traversal level items above which to switch to parent-read-based visiting strategy
      • setDfsThresholdLarge

        public RuntimeConfigBuilder setDfsThresholdLarge​(int dfsThresholdLarge)
        value that determines at which number of visited vertices the DFS implementation will switch to data-structures that are more optimized for larger numbers of vertices.
      • setCniStopRecursionDefault

        public RuntimeConfigBuilder setCniStopRecursionDefault​(int cniStopRecursionDefault)
        default value used in the common neighbor iterator implementations, to indicate the minimum size where the binary search approach is applied.
      • setCniSmallDefault

        public RuntimeConfigBuilder setCniSmallDefault​(int cniSmallDefault)
        default value used in the common neighbor iterator implementations, to indicate below which threshold a subarray is considered small.
      • setCniDiffFactorDefault

        public RuntimeConfigBuilder setCniDiffFactorDefault​(int cniDiffFactorDefault)
        default diff factor value used in the common neighbor iterator implementations.
      • setLargeArrayThreshold

        public RuntimeConfigBuilder setLargeArrayThreshold​(int largeArrayThreshold)
        threshold when the size of an array is too big to use a normal Java array. This depends on the used JVM. (defaults to Integer.MAX_VALUE - 3)
      • setMaxOffHeapSize

        public RuntimeConfigBuilder setMaxOffHeapSize​(int maxOffHeapSize)
        maximum amount of off-heap memory PGX is allowed to allocate in megabytes, before an OutOfMemoryError will be thrown. Note: this limit is not guaranteed to never be exceeded because of rounding and synchronization trade-offs. It only serves as threshold when PGX starts to reject new memory allocation requests.
      • setMaxOnHeapMemoryUsageRatio

        public RuntimeConfigBuilder setMaxOnHeapMemoryUsageRatio​(double maxOnHeapMemoryUsageRatio)
        maximum ratio of on-heap memory that PGX is allowed to use, between 0 and 1.
      • setCharacterSet

        public RuntimeConfigBuilder setCharacterSet​(java.lang.String characterSet)
        standard charset to use throughout PGX, UTF-8 will be used as default. Note: Some formats may not be compatible.
      • setParallelism

        public RuntimeConfigBuilder setParallelism​(int parallelism)
        number of worker threads to be used in thread pool. Note: if caller thread is part of another thread-pool, this value is ignored and parallelism of parent pool is used.
      • setRandomSeed

        public RuntimeConfigBuilder setRandomSeed​(long randomSeed)
        [relevant for deterministic random number generator only] seed for the deterministic random number generator used in pgx. The default is -24466691093057031
      • setPatternMatchingSupernodeCacheThreshold

        public RuntimeConfigBuilder setPatternMatchingSupernodeCacheThreshold​(int patternMatchingSupernodeCacheThreshold)
        minimum number of a node's neighbor to be a supernode. This is for pattern matching engine.
      • setRevisitThreshold

        public RuntimeConfigBuilder setRevisitThreshold​(int revisitThreshold)
        maximum number of matched results from a node to be cached
      • setMaxDistinctStringsPerPool

        public RuntimeConfigBuilder setMaxDistinctStringsPerPool​(int maxDistinctStringsPerPool)
        [only relevant if string_pooling_strategy is indexed] amount of distinct strings per property after which to stop pooling. If the limit is reached an exception is thrown
      • setUseMemoryMapperForStoringPgb

        public RuntimeConfigBuilder setUseMemoryMapperForStoringPgb​(boolean useMemoryMapperForStoringPgb)
        if true, use memory mapped files for storing in PGB format if possible; if false always use a stream based implementation
      • setUseMemoryMapperForReadingPgb

        public RuntimeConfigBuilder setUseMemoryMapperForReadingPgb​(boolean useMemoryMapperForReadingPgb)
        if true, use memory mapped files for reading graphs in PGB format if possible; false always use s stream based implementation
      • setPoolingFactor

        public RuntimeConfigBuilder setPoolingFactor​(double poolingFactor)
        [only relevant if string_pooling_strategy is on_heap] this value prevents the string pool to grow as big as the property size which could render the pooling ineffective
      • setAllowLazyLoadingForDatabaseGraphs

        public RuntimeConfigBuilder setAllowLazyLoadingForDatabaseGraphs​(boolean allowLazyLoadingForDatabaseGraphs)
        if true, PGX will automatically load graphs from the database when they are first referenced in graph queries