org.eclipse.rdf4j.federated

## Class FedXConfig

- java.lang.Object
- - org.eclipse.rdf4j.federated.FedXConfig

-     public class FedXConfig
      extends Object

  Configuration class for FedX
  Author:
    Andreas Schwarte

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static FedXConfig` | `DEFAULT_CONFIG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FedXConfig()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getBoundJoinBlockSize()` The block size for a bound join, i.e.
    `boolean` | `getEnableServiceAsBoundJoin()` Returns a flag indicating whether vectored evaluation using the VALUES clause shall be applied for SERVICE expressions.
    `int` | `getEnforceMaxQueryTime()` Get the maximum query time in seconds used for query evaluation.
    `boolean` | `getIncludeInferredDefault()`
    `int` | `getJoinWorkerThreads()` The (maximum) number of join worker threads used in the `ControlledWorkerScheduler` for join operations.
    `int` | `getLeftJoinWorkerThreads()` The (maximum) number of left join worker threads used in the `ControlledWorkerScheduler` for join operations.
    `String` | `getPrefixDeclarations()` Returns the path to a property file containing prefix declarations as "namespace=prefix" pairs (one per line).
    `Class<? extends FederationEvalStrategy>` | `getSailEvaluationStrategy()` Returns the class of the `FederationEvalStrategy` implementation that is used in the case of SAIL implementations, e.g.
    `String` | `getSourceSelectionCacheSpec()` Returns the configured `CacheBuilderSpec` (if any) for the `SourceSelectionMemoryCache`.
    `Class<? extends FederationEvalStrategy>` | `getSPARQLEvaluationStrategy()` Returns the class of the `FederationEvalStrategy` implementation that is used in the case of SPARQL implementations, e.g.
    `Optional<TaskWrapper>` | `getTaskWrapper()` Returns a `TaskWrapper` which may be used for wrapping any background `Runnable`s.
    `int` | `getUnionWorkerThreads()` The (maximum) number of union worker threads used in the `ControlledWorkerScheduler` for join operations.
    `Class<? extends WriteStrategyFactory>` | `getWriteStrategyFactory()` Returns the class of the `WriteStrategyFactory` implementation.
    `boolean` | `isDebugQueryPlan()` The debug mode for query plan.
    `boolean` | `isEnableMonitoring()` Flag to enable/disable monitoring features.
    `boolean` | `isLogQueries()` Flag to enable/disable query logging via `QueryLog`.
    `boolean` | `isLogQueryPlan()` Flag to enable/disable query plan logging via `QueryPlanLog`.
    `FedXConfig` | `withBoundJoinBlockSize(int boundJoinBlockSize)` Set the bound join block size.
    `FedXConfig` | `withDebugQueryPlan(boolean flag)` Set whether the query plan shall be debugged.
    `FedXConfig` | `withEnableMonitoring(boolean flag)` Enable monitoring.
    `FedXConfig` | `withEnableServiceAsBoundJoin(boolean flag)` Whether external SERVICE clauses are evaluated using bound join (i.e.
    `FedXConfig` | `withEnforceMaxQueryTime(int enforceMaxQueryTime)` Set enforce max query time.
    `FedXConfig` | `withIncludeInferredDefault(boolean flag)` Set the default value supplied to `Operation.setIncludeInferred(boolean)`
    `FedXConfig` | `withJoinWorkerThreads(int joinWorkerThreads)` Set the number of join worker threads.
    `FedXConfig` | `withLeftJoinWorkerThreads(int leftJoinWorkerThreads)` Set the number of left join worker threads.
    `FedXConfig` | `withLogQueries(boolean flag)` Set whether to log queries.
    `FedXConfig` | `withLogQueryPlan(boolean flag)` Whether to log the query plan with `QueryPlanLog`.
    `FedXConfig` | `withPrefixDeclarations(String prefixFile)` Set the optional prefix declarations file.
    `FedXConfig` | `withSailEvaluationStrategy(Class<? extends FederationEvalStrategy> sailEvaluationStrategy)` Set the `FederationEvalStrategy` for SAIL federations.
    `FedXConfig` | `withSourceSelectionCacheSpec(String cacheSpec)` The cache specification for the `SourceSelectionMemoryCache`.
    `FedXConfig` | `withSparqlEvaluationStrategy(Class<? extends FederationEvalStrategy> sparqlEvaluationStrategy)` Set the `FederationEvalStrategy` for SPARQL federations.
    `FedXConfig` | `withTaskWrapper(TaskWrapper taskWrapper)` Sets a `TaskWrapper` which may be used for wrapping any background `Runnable`s.
    `FedXConfig` | `withUnionWorkerThreads(int unionWorkerThreads)` Set the number of union worker threads.
    `FedXConfig` | `withWriteStrategyFactory(Class<? extends WriteStrategyFactory> writeStrategyFactory)` Set the `WriteStrategyFactory` to be used.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_CONFIG

          public static FedXConfig DEFAULT_CONFIG

  - ### Constructor Detail

    - #### FedXConfig

          public FedXConfig()

  - ### Method Detail

    - #### withDebugQueryPlan

          public FedXConfig withDebugQueryPlan(boolean flag)

      Set whether the query plan shall be debugged. See `isDebugQueryPlan()`.

      Can be set after federation construction and initialize.

      Parameters:
        `flag` -
      Returns:
        the current config

    - #### withLogQueries

          public FedXConfig withLogQueries(boolean flag)

      Set whether to log queries. See `isLogQueries()`.

      Can only be set before federation initialization.

      Parameters:
        `flag` -
      Returns:
        the current config

    - #### withSparqlEvaluationStrategy

          public FedXConfig withSparqlEvaluationStrategy(Class<? extends FederationEvalStrategy> sparqlEvaluationStrategy)

      Set the `FederationEvalStrategy` for SPARQL federations. See `getSPARQLEvaluationStrategy()`.

      Can only be set before federation initialization.

      Parameters:
        `sparqlEvaluationStrategy` -
      Returns:
        the current config

    - #### withSailEvaluationStrategy

          public FedXConfig withSailEvaluationStrategy(Class<? extends FederationEvalStrategy> sailEvaluationStrategy)

      Set the `FederationEvalStrategy` for SAIL federations. See `getSailEvaluationStrategy()`.

      Can only be set before federation initialization.

      Parameters:
        `sailEvaluationStrategy` -
      Returns:
        the current config

    - #### withWriteStrategyFactory

          public FedXConfig withWriteStrategyFactory(Class<? extends WriteStrategyFactory> writeStrategyFactory)

      Set the `WriteStrategyFactory` to be used.
      Parameters:
        `writeStrategyFactory` -
      Returns:
        the current config

    - #### withEnforceMaxQueryTime

          public FedXConfig withEnforceMaxQueryTime(int enforceMaxQueryTime)

      Set enforce max query time. See `getEnforceMaxQueryTime()`.

      Can be set after federation construction and initialize.

      Parameters:
        `enforceMaxQueryTime` - time in seconds, 0 to disable
      Returns:
        the current config

    - #### withIncludeInferredDefault

          public FedXConfig withIncludeInferredDefault(boolean flag)

      Set the default value supplied to `Operation.setIncludeInferred(boolean)`
      Parameters:
        `flag` -
      Returns:
        the current config

    - #### withEnableMonitoring

          public FedXConfig withEnableMonitoring(boolean flag)

      Enable monitoring. See `isEnableMonitoring()`.

      Can only be set before federation initialization.

      Parameters:
        `flag` -
      Returns:
        the current config

    - #### withBoundJoinBlockSize

          public FedXConfig withBoundJoinBlockSize(int boundJoinBlockSize)

      Set the bound join block size. See `getBoundJoinBlockSize()`.

      Can only be set before federation initialization.

      Parameters:
        `boundJoinBlockSize` -
      Returns:
        the current config

    - #### withJoinWorkerThreads

          public FedXConfig withJoinWorkerThreads(int joinWorkerThreads)

      Set the number of join worker threads. See `getJoinWorkerThreads()`.

      Can only be set before federation initialization.

      Parameters:
        `joinWorkerThreads` -
      Returns:
        the current config

    - #### withLeftJoinWorkerThreads

          public FedXConfig withLeftJoinWorkerThreads(int leftJoinWorkerThreads)

      Set the number of left join worker threads. See `getLeftJoinWorkerThreads()`.

      Can only be set before federation initialization.

      Parameters:
        `leftJoinWorkerThreads` -
      Returns:
        the current config

    - #### withUnionWorkerThreads

          public FedXConfig withUnionWorkerThreads(int unionWorkerThreads)

      Set the number of union worker threads. See `getUnionWorkerThreads()`.

      Can only be set before federation initialization.

      Parameters:
        `unionWorkerThreads` -
      Returns:
        the current config

    - #### withPrefixDeclarations

          public FedXConfig withPrefixDeclarations(String prefixFile)

      Set the optional prefix declarations file. See `getPrefixDeclarations()`.

      Can only be set before federation initialization.

      Parameters:
        `prefixFile` -
      Returns:
        config

    - #### withLogQueryPlan

          public FedXConfig withLogQueryPlan(boolean flag)

      Whether to log the query plan with `QueryPlanLog`. See `isLogQueryPlan()`.

      Can only be set before federation initialization.

      Parameters:
        `flag` -
      Returns:
        the current config

    - #### withEnableServiceAsBoundJoin

          public FedXConfig withEnableServiceAsBoundJoin(boolean flag)

      Whether external SERVICE clauses are evaluated using bound join (i.e. with the VALUES clause). Default true
      Parameters:
        `flag` -
      Returns:
        the current config.

    - #### withSourceSelectionCacheSpec

          public FedXConfig withSourceSelectionCacheSpec(String cacheSpec)

      The cache specification for the `SourceSelectionMemoryCache`. If not set explicitly, the `SourceSelectionMemoryCache.DEFAULT_CACHE_SPEC` is used.
      Parameters:
        `cacheSpec` - the `CacheBuilderSpec` for the `SourceSelectionCache`
      Returns:
        the current config
      See Also:
        `SourceSelectionMemoryCache`

    - #### withTaskWrapper

          public FedXConfig withTaskWrapper(TaskWrapper taskWrapper)

      Sets a `TaskWrapper` which may be used for wrapping any background `Runnable`s. If no such wrapper is explicitly configured, the unmodified task is returned. See `TaskWrapper` for more information.
      Parameters:
        `taskWrapper` - the `TaskWrapper`
      Returns:
        the current config
      See Also:
        `TaskWrapper`

    - #### getJoinWorkerThreads

          public int getJoinWorkerThreads()

      The (maximum) number of join worker threads used in the `ControlledWorkerScheduler` for join operations. Default is 20.
      Returns:
        the number of join worker threads

    - #### getUnionWorkerThreads

          public int getUnionWorkerThreads()

      The (maximum) number of union worker threads used in the `ControlledWorkerScheduler` for join operations. Default is 20
      Returns:
        number of union worker threads

    - #### getLeftJoinWorkerThreads

          public int getLeftJoinWorkerThreads()

      The (maximum) number of left join worker threads used in the `ControlledWorkerScheduler` for join operations. Default is 10.
      Returns:
        the number of left join worker threads

    - #### getBoundJoinBlockSize

          public int getBoundJoinBlockSize()

      The block size for a bound join, i.e. the number of bindings that are integrated in a single subquery. Default is 15.
      Returns:
        the bound join block size

    - #### getEnableServiceAsBoundJoin

          public boolean getEnableServiceAsBoundJoin()

      Returns a flag indicating whether vectored evaluation using the VALUES clause shall be applied for SERVICE expressions. Default: false Note: for todays endpoints it is more efficient to disable vectored evaluation of SERVICE.
      Returns:
        whether SERVICE expressions are evaluated using bound joins

    - #### getEnforceMaxQueryTime

          public int getEnforceMaxQueryTime()

      Get the maximum query time in seconds used for query evaluation. Applied if `QueryManager` is used to create queries.

      Set to 0 to disable query timeouts.

      The timeout is also applied for individual fine-granular join or union operations as a max time.
      Returns:
        the maximum query time in seconds

    - #### getIncludeInferredDefault

          public boolean getIncludeInferredDefault()

      Returns:
        the default for `Operation.getIncludeInferred()`

    - #### isEnableMonitoring

          public boolean isEnableMonitoring()

      Flag to enable/disable monitoring features. Default=false.
      Returns:
        whether monitoring is enabled

    - #### isLogQueryPlan

          public boolean isLogQueryPlan()

      Flag to enable/disable query plan logging via `QueryPlanLog`. Default=false The `QueryPlanLog` facility allows to retrieve the query execution plan from a variable local to the executing thread.
      Returns:
        whether the query plan shall be logged

    - #### isLogQueries

          public boolean isLogQueries()

      Flag to enable/disable query logging via `QueryLog`. Default=false The `QueryLog` facility allows to log all queries to a file. See `QueryLog` for details. Requires `isEnableMonitoring()` to be active.
      Returns:
        whether queries are logged

    - #### getPrefixDeclarations

          public String getPrefixDeclarations()

      Returns the path to a property file containing prefix declarations as "namespace=prefix" pairs (one per line).

      Default: no prefixes are replaced. Note that prefixes are only replaced when using the `QueryManager` to create/evaluate queries. Example: `foaf=http://xmlns.com/foaf/0.1/ rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# =http://mydefaultns.org/`

      Returns:
        the location of the prefix declarations or `null` if not configured

    - #### getSourceSelectionCacheSpec

          public String getSourceSelectionCacheSpec()

      Returns the configured `CacheBuilderSpec` (if any) for the `SourceSelectionMemoryCache`. If not defined, the `SourceSelectionMemoryCache.DEFAULT_CACHE_SPEC` is used.
      Returns:
        the `CacheBuilderSpec` or `null`

    - #### getSailEvaluationStrategy

          public Class<? extends FederationEvalStrategy> getSailEvaluationStrategy()

      Returns the class of the `FederationEvalStrategy` implementation that is used in the case of SAIL implementations, e.g. for native stores.

      Default `SailFederationEvalStrategy`

      Returns:
        the evaluation strategy class

    - #### getSPARQLEvaluationStrategy

          public Class<? extends FederationEvalStrategy> getSPARQLEvaluationStrategy()

      Returns the class of the `FederationEvalStrategy` implementation that is used in the case of SPARQL implementations, e.g. SPARQL repository or remote repository.

      Default `SparqlFederationEvalStrategy`

      Returns:
        the evaluation strategy class

    - #### getWriteStrategyFactory

          public Class<? extends WriteStrategyFactory> getWriteStrategyFactory()

      Returns the class of the `WriteStrategyFactory` implementation.

      Default: `DefaultWriteStrategyFactory`

      Returns:
        the `WriteStrategyFactory` class

    - #### isDebugQueryPlan

          public boolean isDebugQueryPlan()

      The debug mode for query plan. If enabled, the query execution plan is printed to stdout
      Returns:
        whether the query plan is printed to std out

    - #### getTaskWrapper

          public Optional<TaskWrapper> getTaskWrapper()

      Returns a `TaskWrapper` which may be used for wrapping any background `Runnable`s. If no such wrapper is explicitly configured, the unmodified task is returned. See `TaskWrapper` for more information.
      Returns:
        the `TaskWrapper`, an empty `Optional` if none is explicitly configured

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.