Package oracle.pgx.config
Class RuntimeConfigBuilder
- java.lang.Object
-
- oracle.pgx.config.RuntimeConfigBuilder
-
@Generated({"common/config/src/templates/ConfigBuilder.stg","common/config/config.gradle"}) public final class RuntimeConfigBuilder extends java.lang.Object
Builder forRuntimeConfig
.
-
-
Constructor Summary
Constructors Constructor Description RuntimeConfigBuilder()
Constructs an empty RuntimeConfigBuilderRuntimeConfigBuilder(java.util.Map<RuntimeConfig.Field,java.lang.Object> values)
Constructs a RuntimeConfigBuilder initialized with the values from the given mapRuntimeConfigBuilder(RuntimeConfig config)
Constructs a RuntimeConfigBuilder initialized with the values from the given configRuntimeConfigBuilder(RuntimeConfigBuilder builder)
Constructs a RuntimeConfigBuilder initialized with the values from the given builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RuntimeConfig
build()
Builds the RuntimeConfig with aparentPath
ofnull
.RuntimeConfig
build(java.lang.String parentPath)
Builds the RuntimeConfig.static RuntimeConfig
buildRuntimeConfig(java.util.function.Consumer<RuntimeConfigBuilder> builderSetup)
Builds aRuntimeConfig
in-placeRuntimeConfigBuilder
clear()
Clears all values from the builderjava.util.Map<RuntimeConfig.Field,java.lang.Object>
getValues()
RuntimeConfigBuilder
putAll(java.util.Map<RuntimeConfig.Field,java.lang.Object> values)
Puts all values from the given map into this builder.RuntimeConfigBuilder
putAll(RuntimeConfig config)
Puts all values from the given config into this builderRuntimeConfigBuilder
setAllowLazyLoadingForDatabaseGraphs(boolean allowLazyLoadingForDatabaseGraphs)
iftrue
, PGX will automatically load graphs from the database when they are first referenced in graph queriesRuntimeConfigBuilder
setBfsIterateQueTaskSize(int bfsIterateQueTaskSize)
task size for BFS iterate QUE phaseRuntimeConfigBuilder
setBfsThresholdParentReadBased(double bfsThresholdParentReadBased)
threshold of BFS traversal level items above which to switch to parent-read-based visiting strategyRuntimeConfigBuilder
setBfsThresholdReadBased(int bfsThresholdReadBased)
threshold of BFS traversal level items above which to switch to read-based visiting strategyRuntimeConfigBuilder
setBfsThresholdSingleThreaded(int bfsThresholdSingleThreaded)
until what number of BFS traversal level items vertices are visited single-threadedRuntimeConfigBuilder
setCharacterSet(java.lang.String characterSet)
standard charset to use throughout PGX, UTF-8 will be used as default.RuntimeConfigBuilder
setCniDiffFactorDefault(int cniDiffFactorDefault)
default diff factor value used in the common neighbor iterator implementations.RuntimeConfigBuilder
setCniSmallDefault(int cniSmallDefault)
default value used in the common neighbor iterator implementations, to indicate below which threshold a subarray is considered small.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.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.RuntimeConfigBuilder
setEnterpriseSchedulerFlags(java.util.function.Consumer<EnterpriseSchedulerFlagsConfigBuilder> enterpriseSchedulerFlagsBuilderSetup)
Builds a EnterpriseSchedulerFlagsConfig in-place.RuntimeConfigBuilder
setEnterpriseSchedulerFlags(EnterpriseSchedulerFlagsConfig enterpriseSchedulerFlags)
[relevant for enterprise_scheduler] enterprise scheduler specific settings.RuntimeConfigBuilder
setExplicitSpinLocks(boolean explicitSpinLocks)
true
means spin explicitly in a loop until lock becomes available.RuntimeConfigBuilder
setGraphValidationLevel(GraphValidationLevel graphValidationLevel)
level of validation performed on newly loaded or created graphsRuntimeConfigBuilder
setLargeArrayThreshold(int largeArrayThreshold)
threshold when the size of an array is too big to use a normal Java array.RuntimeConfigBuilder
setMaxDistinctStringsPerPool(int maxDistinctStringsPerPool)
[only relevant if string_pooling_strategy is indexed] amount of distinct strings per property after which to stop pooling.RuntimeConfigBuilder
setMaxOffHeapSize(int maxOffHeapSize)
maximum amount of off-heap memory PGX is allowed to allocate in megabytes, before an OutOfMemoryError will be thrown.RuntimeConfigBuilder
setMaxOnHeapMemoryUsageRatio(double maxOnHeapMemoryUsageRatio)
maximum ratio of on-heap memory that PGX is allowed to use, between 0 and 1.RuntimeConfigBuilder
setMemoryAllocator(MemoryAllocationStrategy memoryAllocator)
which memory allocator to useRuntimeConfigBuilder
setMsBfsFrontierTypeStrategy(FrontierTypeStrategy msBfsFrontierTypeStrategy)
the type strategy to use for MS-BFS frontiersRuntimeConfigBuilder
setNumSpinLocks(int numSpinLocks)
how many spin locks each generated app will create at instantiation.RuntimeConfigBuilder
setParallelism(int parallelism)
number of worker threads to be used in thread pool.RuntimeConfigBuilder
setPatternMatchingSupernodeCacheThreshold(int patternMatchingSupernodeCacheThreshold)
minimum number of a node's neighbor to be a supernode.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 ineffectiveRuntimeConfigBuilder
setRandomGeneratorStrategy(RandomGeneratorStrategy randomGeneratorStrategy)
method of generating random numbers in pgxRuntimeConfigBuilder
setRandomSeed(long randomSeed)
[relevant for deterministic random number generator only] seed for the deterministic random number generator used in pgx.RuntimeConfigBuilder
setRevisitThreshold(int revisitThreshold)
maximum number of matched results from a node to be cachedRuntimeConfigBuilder
setScheduler(SchedulerStrategy scheduler)
which scheduler to use.RuntimeConfigBuilder
setSmallTaskLength(int smallTaskLength)
task length if total amount of work is small than default task length (only relevant for task-stealing strategies)RuntimeConfigBuilder
setStringPoolingStrategy(StringPoolingStrategy stringPoolingStrategy)
which string pooling strategy to useRuntimeConfigBuilder
setTaskLength(int taskLength)
default task length (only relevant for task-stealing strategies).RuntimeConfigBuilder
setUseIndexForReachabilityQueries(ReachabilityIndexCreationMode useIndexForReachabilityQueries)
create index for reachability queriesRuntimeConfigBuilder
setUseMemoryMapperForReadingPgb(boolean useMemoryMapperForReadingPgb)
if true, use memory mapped files for reading graphs in PGB format if possible; false always use s stream based implementationRuntimeConfigBuilder
setUseMemoryMapperForStoringPgb(boolean useMemoryMapperForStoringPgb)
if true, use memory mapped files for storing in PGB format if possible; if false always use a stream based implementationjava.io.InputStream
toInputStream()
java.lang.String
toString()
-
-
-
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
-
buildRuntimeConfig
public static RuntimeConfig buildRuntimeConfig(java.util.function.Consumer<RuntimeConfigBuilder> builderSetup)
Builds aRuntimeConfig
in-place- Parameters:
builderSetup
- a consumer to setup a newly createdRuntimeConfig
-
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
-
clear
public RuntimeConfigBuilder clear()
Clears all values from the builder
-
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 aparentPath
ofnull
.- 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 classjava.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 totrue
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)
-
setMsBfsFrontierTypeStrategy
public RuntimeConfigBuilder setMsBfsFrontierTypeStrategy(FrontierTypeStrategy msBfsFrontierTypeStrategy)
the type strategy to use for MS-BFS frontiers
-
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 toInteger.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.
-
setRandomGeneratorStrategy
public RuntimeConfigBuilder setRandomGeneratorStrategy(RandomGeneratorStrategy randomGeneratorStrategy)
method of generating random numbers in pgx
-
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.
-
setUseIndexForReachabilityQueries
public RuntimeConfigBuilder setUseIndexForReachabilityQueries(ReachabilityIndexCreationMode useIndexForReachabilityQueries)
create index for reachability queries
-
setRevisitThreshold
public RuntimeConfigBuilder setRevisitThreshold(int revisitThreshold)
maximum number of matched results from a node to be cached
-
setEnterpriseSchedulerFlags
public RuntimeConfigBuilder setEnterpriseSchedulerFlags(EnterpriseSchedulerFlagsConfig enterpriseSchedulerFlags)
[relevant for enterprise_scheduler] enterprise scheduler specific settings.
-
setEnterpriseSchedulerFlags
public RuntimeConfigBuilder setEnterpriseSchedulerFlags(java.util.function.Consumer<EnterpriseSchedulerFlagsConfigBuilder> enterpriseSchedulerFlagsBuilderSetup)
Builds a EnterpriseSchedulerFlagsConfig in-place. [relevant for enterprise_scheduler] enterprise scheduler specific settings.- Parameters:
enterpriseSchedulerFlagsBuilderSetup
- a consumer to setup a newly createdEnterpriseSchedulerFlagsConfigBuilder
- See Also:
EnterpriseSchedulerFlagsConfigBuilder
-
setMemoryAllocator
public RuntimeConfigBuilder setMemoryAllocator(MemoryAllocationStrategy memoryAllocator)
which memory allocator to use
-
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
-
setStringPoolingStrategy
public RuntimeConfigBuilder setStringPoolingStrategy(StringPoolingStrategy stringPoolingStrategy)
which string pooling strategy to use
-
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
-
setGraphValidationLevel
public RuntimeConfigBuilder setGraphValidationLevel(GraphValidationLevel graphValidationLevel)
level of validation performed on newly loaded or created graphs
-
setAllowLazyLoadingForDatabaseGraphs
public RuntimeConfigBuilder setAllowLazyLoadingForDatabaseGraphs(boolean allowLazyLoadingForDatabaseGraphs)
iftrue
, PGX will automatically load graphs from the database when they are first referenced in graph queries
-
-