<commit_before>## Configuration

The driver's configuration is composed of options, organized in a hierarchical manner. Optionally,
it can define *profiles* that customize a set of options for a particular kind of request.

The default implementation is based on the TypeSafe Config framework. It can be completely
overridden if needed.

For a complete list of built-in options, see [reference.conf] in the driver sources.


### Concepts

#### Options

Essentially, an option is a path in the configuration with an expected type, for example
`connection.heartbeat.interval`, representing a duration.

#### Profiles

Imagine an application that does both transactional and analytical requests. Transactional requests
are simpler and must return quickly, so they will typically use a short timeout, let's say 100 
milliseconds; analytical requests are more complex and less frequent so a higher SLA is acceptable,
for example 5 seconds. In addition, maybe you want to use a different consistency level.

Instead of manually adjusting the options on every request, you can create configuration profiles:

```
datastax-java-driver {
  profiles {
    oltp {
      request.timeout = 100 milliseconds
      request.consistency = ONE
    }
    olap {
      request.timeout = 5 seconds
      request.consistency = QUORUM
    }
}
```

Now each request only needs a profile name:

```java
SimpleStatement s =
  SimpleStatement.builder("SELECT name FROM user WHERE id = 1")
      .withConfigProfileName("oltp")
      .build();
session.execute(s);
```

The configuration has an anonymous *default profile* that is always present. It can define an
arbitrary number of named profiles. They inherit from the default profile, so you only need to
override the options that have a different value.


### Default implementation: TypeSafe Config

Out of the box, the driver uses [TypeSafe Config]. 

It looks at the following locations, according to the [standard behavior][config standard behavior]
of that library:

* system properties
* `application.conf` (all resources on the classpath with this name)
* `application.json` (all resources on the classpath with this name)
* `application.properties` (all resources on the classpath with this name)
* `reference.conf` (all resources on the classpath with this name)

The driver ships with a [reference.conf] that defines sensible defaults for all the options. That
file is heavily documented, so refer to it for details about each option. It is included in the core
driver JAR, so it is in your application's classpath. If you to customize something, add an
`application.conf` in your source tree and also place it in the classpath; since it inherits from
`reference.conf`, you only need to redeclare what you override:

```
# Sample application.conf: overrides one option and adds a profile
datastax-java-driver {
  protocol.version = V4
  profiles {<commit_msg>Fix typo in config manual<commit_after>## Configuration

The driver's configuration is composed of options, organized in a hierarchical manner. Optionally,
it can define *profiles* that customize a set of options for a particular kind of request.

The default implementation is based on the TypeSafe Config framework. It can be completely
overridden if needed.

For a complete list of built-in options, see [reference.conf] in the driver sources.


### Concepts

#### Options

Essentially, an option is a path in the configuration with an expected type, for example
`connection.heartbeat.interval`, representing a duration.

#### Profiles

Imagine an application that does both transactional and analytical requests. Transactional requests
are simpler and must return quickly, so they will typically use a short timeout, let's say 100 
milliseconds; analytical requests are more complex and less frequent so a higher SLA is acceptable,
for example 5 seconds. In addition, maybe you want to use a different consistency level.

Instead of manually adjusting the options on every request, you can create configuration profiles:

```
datastax-java-driver {
  profiles {
    oltp {
      request.timeout = 100 milliseconds
      request.consistency = ONE
    }
    olap {
      request.timeout = 5 seconds
      request.consistency = QUORUM
    }
}
```

Now each request only needs a profile name:

```java
SimpleStatement s =
  SimpleStatement.builder("SELECT name FROM user WHERE id = 1")
      .withConfigProfileName("oltp")
      .build();
session.execute(s);
```

The configuration has an anonymous *default profile* that is always present. It can define an
arbitrary number of named profiles. They inherit from the default profile, so you only need to
override the options that have a different value.


### Default implementation: TypeSafe Config

Out of the box, the driver uses [TypeSafe Config]. 

It looks at the following locations, according to the [standard behavior][config standard behavior]
of that library:

* system properties
* `application.conf` (all resources on the classpath with this name)
* `application.json` (all resources on the classpath with this name)
* `application.properties` (all resources on the classpath with this name)
* `reference.conf` (all resources on the classpath with this name)

The driver ships with a [reference.conf] that defines sensible defaults for all the options. That
file is heavily documented, so refer to it for details about each option. It is included in the core
driver JAR, so it is in your application's classpath. If you need to customize something, add an
`application.conf` in your source tree and also place it in the classpath; since it inherits from
`reference.conf`, you only need to redeclare what you override:

```
# Sample application.conf: overrides one option and adds a profile
datastax-java-driver {
  protocol.version = V4
  profiles {
{'fraction_non_alphanumeric': 0.060637381567614126, 'fraction_numerical': 0.0034453057708871662, 'mean_word_length': 4.365988909426987, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4601421', 'n_tokens_mistral': 1473, 'n_tokens_neox': 1400, 'n_words': 775}