Class SharedHttpClientSessionManager

java.lang.Object
org.eclipse.rdf4j.http.client.SharedHttpClientSessionManager
All Implemented Interfaces:
HttpClientDependent, HttpClientSessionManager

public class SharedHttpClientSessionManager extends Object implements HttpClientSessionManager, HttpClientDependent
A Manager for HTTP sessions that uses a shared RDF4JHttpClient to manage HTTP connections.
Author:
James Leigh
  • Field Details

    • CORE_POOL_SIZE_PROPERTY

      public static final String CORE_POOL_SIZE_PROPERTY
      Configurable system property org.eclipse.rdf4j.client.executors.corePoolSize for specifying the background executor core thread pool size.
      See Also:
    • MAX_CONN_PER_ROUTE_PROPERTY

      public static final String MAX_CONN_PER_ROUTE_PROPERTY
      Configurable system property org.eclipse.rdf4j.client.http.maxConnPerRoute for specifying the maximum number of connections per route (per host). Default is 25.

      This property determines the maximum number of concurrent connections to a single host (route). Adjusting this value can improve performance when communicating with a server that supports multiple concurrent connections.

      See Also:
    • MAX_CONN_TOTAL_PROPERTY

      public static final String MAX_CONN_TOTAL_PROPERTY
      Configurable system property org.eclipse.rdf4j.client.http.maxConnTotal for specifying the maximum total number of connections. Default is 50.

      This property sets the maximum total number of concurrent connections that can be open at the same time. Increasing this value allows more simultaneous connections to different hosts, which can improve throughput in multi-threaded environments.

      See Also:
    • CONNECTION_TIMEOUT_PROPERTY

      public static final String CONNECTION_TIMEOUT_PROPERTY
      Configurable system property org.eclipse.rdf4j.client.http.connectionTimeout for specifying the HTTP connection timeout in milliseconds for general use. Default is 30 seconds.

      The connection timeout determines the maximum time the client will wait to establish a TCP connection to the server. A default of 30 seconds is set to allow for potential network delays without causing unnecessary timeouts.

      See Also:
    • CONNECTION_REQUEST_TIMEOUT_PROPERTY

      public static final String CONNECTION_REQUEST_TIMEOUT_PROPERTY
      Configurable system property org.eclipse.rdf4j.client.http.connectionRequestTimeout for specifying the HTTP connection request timeout in milliseconds for general use. Default is 1 hour.

      The connection request timeout defines how long the client will wait for a connection from the connection pool.

      See Also:
    • SOCKET_TIMEOUT_PROPERTY

      public static final String SOCKET_TIMEOUT_PROPERTY
      Configurable system property org.eclipse.rdf4j.client.http.socketTimeout for specifying the HTTP socket timeout in milliseconds for general use. Default is 10 days.

      The socket timeout controls the maximum period of inactivity between data packets during data transfer. A longer timeout is appropriate for large data transfers, ensuring that operations are not interrupted prematurely.

      See Also:
    • SPARQL_CONNECTION_TIMEOUT_PROPERTY

      public static final String SPARQL_CONNECTION_TIMEOUT_PROPERTY
      Configurable system property org.eclipse.rdf4j.client.sparql.http.connectionTimeout for specifying the HTTP connection timeout in milliseconds when used in SPARQL SERVICE calls. Default is 5 seconds.

      A shorter connection timeout is set for SPARQL SERVICE calls to quickly detect unresponsive endpoints in federated queries, improving overall query performance by avoiding long waits for unreachable servers.

      See Also:
    • SPARQL_CONNECTION_REQUEST_TIMEOUT_PROPERTY

      public static final String SPARQL_CONNECTION_REQUEST_TIMEOUT_PROPERTY
      Configurable system property org.eclipse.rdf4j.client.sparql.http.connectionRequestTimeout for specifying the HTTP connection request timeout in milliseconds when used in SPARQL SERVICE calls. Default is 10 minutes.

      This timeout controls how long the client waits for a connection from the pool when making SPARQL SERVICE calls. A shorter timeout than general use ensures that queries fail fast if resources are constrained, maintaining responsiveness.

      See Also:
    • SPARQL_SOCKET_TIMEOUT_PROPERTY

      public static final String SPARQL_SOCKET_TIMEOUT_PROPERTY
      Configurable system property org.eclipse.rdf4j.client.sparql.http.socketTimeout for specifying the HTTP socket timeout in milliseconds when used in SPARQL SERVICE calls. Default is 1 hour.

      The socket timeout for SPARQL SERVICE calls is set to a shorter duration to detect unresponsive servers during data transfer, ensuring that the client does not wait indefinitely for data that may never arrive.

      See Also:
    • DEFAULT_CORE_POOL_SIZE

      public static final int DEFAULT_CORE_POOL_SIZE
      Default core pool size for the executor service. Set to 5.

      This value determines the number of threads to keep in the pool, even if they are idle. Adjusting this value can help manage resource utilization in high-load scenarios.

      See Also:
    • DEFAULT_MAX_CONN_PER_ROUTE

      public static final int DEFAULT_MAX_CONN_PER_ROUTE
      Default maximum number of connections per route (per host). Set to 25.

      This value limits the number of concurrent connections to a single host. Increasing it can improve performance when communicating with a server that can handle multiple connections.

      See Also:
    • DEFAULT_MAX_CONN_TOTAL

      public static final int DEFAULT_MAX_CONN_TOTAL
      Default maximum total number of connections. Set to 50.

      This value limits the total number of concurrent connections that can be open at the same time. Increasing it allows for more simultaneous connections to different hosts.

      See Also:
    • DEFAULT_CONNECTION_TIMEOUT

      public static final int DEFAULT_CONNECTION_TIMEOUT
      Default HTTP connection timeout in milliseconds for general use. Set to 30 seconds.

      The connection timeout determines the maximum time the client will wait to establish a TCP connection to the server.

      See Also:
    • DEFAULT_CONNECTION_REQUEST_TIMEOUT

      public static final int DEFAULT_CONNECTION_REQUEST_TIMEOUT
      Default HTTP connection request timeout in milliseconds for general use. Set to 1 hour.

      The connection request timeout defines how long the client will wait for a connection from the connection pool.

      See Also:
    • DEFAULT_SOCKET_TIMEOUT

      public static final int DEFAULT_SOCKET_TIMEOUT
      Default HTTP socket timeout in milliseconds for general use. Set to 10 days.

      The socket timeout controls the maximum period of inactivity between data packets during data transfer. A longer timeout is appropriate for large data transfers.

      See Also:
    • DEFAULT_SPARQL_CONNECTION_TIMEOUT

      public static final int DEFAULT_SPARQL_CONNECTION_TIMEOUT
      Default HTTP connection timeout in milliseconds for SPARQL SERVICE calls. Set to 5 seconds.

      A shorter connection timeout is set for SPARQL SERVICE calls to quickly detect unresponsive endpoints in federated queries.

      See Also:
    • DEFAULT_SPARQL_CONNECTION_REQUEST_TIMEOUT

      public static final int DEFAULT_SPARQL_CONNECTION_REQUEST_TIMEOUT
      Default HTTP connection request timeout in milliseconds for SPARQL SERVICE calls. Set to 10 minutes.

      This timeout controls how long the client waits for a connection from the pool when making SPARQL SERVICE calls.

      See Also:
    • DEFAULT_SPARQL_SOCKET_TIMEOUT

      public static final int DEFAULT_SPARQL_SOCKET_TIMEOUT
      Default HTTP socket timeout in milliseconds for SPARQL SERVICE calls. Set to 1 hour.

      The socket timeout for SPARQL SERVICE calls is set to a shorter duration to detect unresponsive servers during data transfer.

      See Also:
    • CORE_POOL_SIZE

      public static final int CORE_POOL_SIZE
      Core pool size for the executor service, as read from system properties or defaults.
    • MAX_CONN_PER_ROUTE

      public static final int MAX_CONN_PER_ROUTE
      Maximum number of connections per route (per host), as read from system properties or defaults.
    • MAX_CONN_TOTAL

      public static final int MAX_CONN_TOTAL
      Maximum total number of connections, as read from system properties or defaults.
    • CONNECTION_TIMEOUT

      public static final int CONNECTION_TIMEOUT
      HTTP connection timeout in milliseconds for general use.
    • CONNECTION_REQUEST_TIMEOUT

      public static final int CONNECTION_REQUEST_TIMEOUT
      HTTP connection request timeout in milliseconds for general use.
    • SOCKET_TIMEOUT

      public static final int SOCKET_TIMEOUT
      HTTP socket timeout in milliseconds for general use.
    • SPARQL_CONNECTION_TIMEOUT

      public static final int SPARQL_CONNECTION_TIMEOUT
      HTTP connection timeout in milliseconds for SPARQL SERVICE calls.
    • SPARQL_CONNECTION_REQUEST_TIMEOUT

      public static final int SPARQL_CONNECTION_REQUEST_TIMEOUT
      HTTP connection request timeout in milliseconds for SPARQL SERVICE calls.
    • SPARQL_SOCKET_TIMEOUT

      public static final int SPARQL_SOCKET_TIMEOUT
      HTTP socket timeout in milliseconds for SPARQL SERVICE calls.
  • Constructor Details

    • SharedHttpClientSessionManager

      public SharedHttpClientSessionManager()
    • SharedHttpClientSessionManager

      public SharedHttpClientSessionManager(RDF4JHttpClient dependentClient, ExecutorService dependentExecutorService)
  • Method Details