Package com.apple.foundationdb

## Class NetworkOptions

- java.lang.Object
- - com.apple.foundationdb.NetworkOptions

    public class NetworkOptions
    extends java.lang.Object

A set of options that can be set globally for the `FoundationDB API`.

### Constructor Summary

Constructors
`NetworkOptions​(OptionConsumer consumer)`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`OptionConsumer` `getOptionConsumer()` Returns the object on which these options are being set.
`void` `setBuggifyDisable()`
`void` `setBuggifyEnable()`
`void` `setBuggifySectionActivatedProbability​(long value)` Set the probability of a BUGGIFY section being active for the current execution.
`void` `setBuggifySectionFiredProbability​(long value)` Set the probability of an active BUGGIFY section being fired.
`void` `setCallbacksOnExternalThreads()` If set, callbacks from external client libraries can be called from threads created by the FoundationDB client library.
`void` `setClientBuggifyDisable()` Disable client buggify.
`void` `setClientBuggifyEnable()` Enable client buggify - will make requests randomly fail (intended for client testing).
`void` `setClientBuggifySectionActivatedProbability​(long value)` Set the probability of a CLIENT_BUGGIFY section being active for the current execution.
`void` `setClientBuggifySectionFiredProbability​(long value)` Set the probability of an active CLIENT_BUGGIFY section being fired.
`void` `setClientThreadsPerVersion​(long value)` Spawns multiple worker threads for each version of the client that is loaded.
`void` `setClusterFile​(java.lang.String value)` Deprecated.
`void` `setDisableClientStatisticsLogging()` Disables logging of client statistics, such as sampled transaction activity.
`void` `setDisableLocalClient()` Prevents connections through the local client, allowing only connections through externally loaded client libraries.
`void` `setDisableMultiVersionClientApi()` Disables the multi-version client API and instead uses the local client directly.
`void` `setDistributedClientTracer​(java.lang.String value)` Set a tracer to run on the client.
`void` `setEnableRunLoopProfiling()` Enables debugging feature to perform run loop profiling.
`void` `setEnableSlowTaskProfiling()` Deprecated.
`void` `setExternalClientDirectory​(java.lang.String value)` Searches the specified path for dynamic libraries and adds them to the list of client libraries for use by the multi-version client API.
`void` `setExternalClientLibrary​(java.lang.String value)` Adds an external client library for use by the multi-version client API.
`void` `setKnob​(java.lang.String value)` Set internal tuning or debugging knobs.
`void` `setLocalAddress​(java.lang.String value)` Deprecated.
`void` `setTLSCaBytes​(byte[] value)` Set the ca bundle.
`void` `setTLSCaPath​(java.lang.String value)` Set the file from which to load the certificate authority bundle.
`void` `setTLSCertBytes​(byte[] value)` Set the certificate chain.
`void` `setTLSCertPath​(java.lang.String value)` Set the file from which to load the certificate chain.
`void` `setTLSKeyBytes​(byte[] value)` Set the private key corresponding to your own certificate.
`void` `setTLSKeyPath​(java.lang.String value)` Set the file from which to load the private key corresponding to your own certificate.
`void` `setTLSPassword​(java.lang.String value)` Set the passphrase for encrypted private key.
`void` `setTLSPlugin​(java.lang.String value)` Deprecated.
`void` `setTLSVerifyPeers​(byte[] value)` Set the peer certificate field verification criteria.
`void` `setTraceClockSource​(java.lang.String value)` Select clock source for trace files.
`void` `setTraceEnable​(java.lang.String value)` Enables trace output to a file in a directory of the clients choosing.
`void` `setTraceFileIdentifier​(java.lang.String value)` Once provided, this string will be used to replace the port/PID in the log file names.
`void` `setTraceFormat​(java.lang.String value)` Select the format of the log files.
`void` `setTraceLogGroup​(java.lang.String value)` Sets the 'LogGroup' attribute with the specified value for all events in the trace output files.
`void` `setTraceMaxLogsSize​(long value)` Sets the maximum size of all the trace output files put together.
`void` `setTracePartialFileSuffix​(java.lang.String value)` Set file suffix for partially written log files.
`void` `setTraceRollSize​(long value)` Sets the maximum size in bytes of a single trace output file.

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

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

### Constructor Detail

#### NetworkOptions

    public NetworkOptions​(OptionConsumer consumer)

### Method Detail

#### setLocalAddress

    @Deprecated
    public void setLocalAddress​(java.lang.String value)

Deprecated.
Deprecated.

Parameters:
  `value` - IP:PORT

#### setClusterFile

    @Deprecated
    public void setClusterFile​(java.lang.String value)

Deprecated.
Deprecated.

Parameters:
  `value` - path to cluster file

#### setTraceEnable

    public void setTraceEnable​(java.lang.String value)

Enables trace output to a file in a directory of the clients choosing.

Parameters:
  `value` - path to output directory (or NULL for current working directory)

#### setTraceRollSize

    public void setTraceRollSize​(long value)

Sets the maximum size in bytes of a single trace output file. This value should be in the range `[0, INT64_MAX]`. If the value is set to 0, there is no limit on individual file size. The default is a maximum size of 10,485,760 bytes.

Parameters:
  `value` - max size of a single trace output file

#### setTraceMaxLogsSize

    public void setTraceMaxLogsSize​(long value)

Sets the maximum size of all the trace output files put together. This value should be in the range `[0, INT64_MAX]`. If the value is set to 0, there is no limit on the total size of the files. The default is a maximum size of 104,857,600 bytes. If the default roll size is used, this means that a maximum of 10 trace files will be written at a time.

Parameters:
  `value` - max total size of trace files

#### setTraceLogGroup

    public void setTraceLogGroup​(java.lang.String value)

Sets the 'LogGroup' attribute with the specified value for all events in the trace output files. The default log group is 'default'.

Parameters:
  `value` - value of the LogGroup attribute

#### setTraceFormat

    public void setTraceFormat​(java.lang.String value)

Select the format of the log files. xml (the default) and json are supported.

Parameters:
  `value` - Format of trace files

#### setTraceClockSource

    public void setTraceClockSource​(java.lang.String value)

Select clock source for trace files. now (the default) or realtime are supported.

Parameters:
  `value` - Trace clock source

#### setTraceFileIdentifier

    public void setTraceFileIdentifier​(java.lang.String value)

Once provided, this string will be used to replace the port/PID in the log file names.

Parameters:
  `value` - The identifier that will be part of all trace file names

#### setTracePartialFileSuffix

    public void setTracePartialFileSuffix​(java.lang.String value)

Set file suffix for partially written log files.

Parameters:
  `value` - Append this suffix to partially written log files. When a log file is complete, it is renamed to remove the suffix. No separator is added between the file and the suffix. If you want to add a file extension, you should include the separator - e.g. '.tmp' instead of 'tmp' to add the 'tmp' extension.

#### setKnob

    public void setKnob​(java.lang.String value)

Set internal tuning or debugging knobs.

Parameters:
  `value` - knob_name=knob_value

#### setTLSPlugin

    @Deprecated
    public void setTLSPlugin​(java.lang.String value)

Deprecated.
Deprecated.

Parameters:
  `value` - file path or linker-resolved name

#### setTLSCertBytes

    public void setTLSCertBytes​(byte[] value)

Set the certificate chain.

Parameters:
  `value` - certificates

#### setTLSCertPath

    public void setTLSCertPath​(java.lang.String value)

Set the file from which to load the certificate chain.

Parameters:
  `value` - file path

#### setTLSKeyBytes

    public void setTLSKeyBytes​(byte[] value)

Set the private key corresponding to your own certificate.

Parameters:
  `value` - key

#### setTLSKeyPath

    public void setTLSKeyPath​(java.lang.String value)

Set the file from which to load the private key corresponding to your own certificate.

Parameters:
  `value` - file path

#### setTLSVerifyPeers

    public void setTLSVerifyPeers​(byte[] value)

Set the peer certificate field verification criteria.

Parameters:
  `value` - verification pattern

#### setBuggifySectionActivatedProbability

    public void setBuggifySectionActivatedProbability​(long value)

Set the probability of a BUGGIFY section being active for the current execution. Only applies to code paths first traversed AFTER this option is changed.

Parameters:
  `value` - probability expressed as a percentage between 0 and 100

#### setBuggifySectionFiredProbability

    public void setBuggifySectionFiredProbability​(long value)

Set the probability of an active BUGGIFY section being fired.

Parameters:
  `value` - probability expressed as a percentage between 0 and 100

#### setTLSCaBytes

    public void setTLSCaBytes​(byte[] value)

Set the ca bundle.

Parameters:
  `value` - ca bundle

#### setTLSCaPath

    public void setTLSCaPath​(java.lang.String value)

Set the file from which to load the certificate authority bundle.

Parameters:
  `value` - file path

#### setTLSPassword

    public void setTLSPassword​(java.lang.String value)

Set the passphrase for encrypted private key. Password should be set before setting the key for the password to be used.

Parameters:
  `value` - key passphrase

#### setDisableMultiVersionClientApi

    public void setDisableMultiVersionClientApi()

Disables the multi-version client API and instead uses the local client directly. Must be set before setting up the network.

#### setCallbacksOnExternalThreads

    public void setCallbacksOnExternalThreads()

If set, callbacks from external client libraries can be called from threads created by the FoundationDB client library. Otherwise, callbacks will be called from either the thread used to add the callback or the network thread. Setting this option can improve performance when connected using an external client, but may not be safe to use in all environments. Must be set before setting up the network. WARNING: This feature is considered experimental at this time.

#### setExternalClientLibrary

    public void setExternalClientLibrary​(java.lang.String value)

Adds an external client library for use by the multi-version client API. Must be set before setting up the network.

Parameters:
  `value` - path to client library

#### setExternalClientDirectory

    public void setExternalClientDirectory​(java.lang.String value)

Searches the specified path for dynamic libraries and adds them to the list of client libraries for use by the multi-version client API. Must be set before setting up the network.

Parameters:
  `value` - path to directory containing client libraries

#### setDisableLocalClient

    public void setDisableLocalClient()

Prevents connections through the local client, allowing only connections through externally loaded client libraries.

#### setClientThreadsPerVersion

    public void setClientThreadsPerVersion​(long value)

Spawns multiple worker threads for each version of the client that is loaded. Setting this to a number greater than one implies disable_local_client.

Parameters:
  `value` - Number of client threads to be spawned. Each cluster will be serviced by a single client thread.

#### setDisableClientStatisticsLogging

    public void setDisableClientStatisticsLogging()

Disables logging of client statistics, such as sampled transaction activity.

#### setEnableSlowTaskProfiling

    @Deprecated
    public void setEnableSlowTaskProfiling()

Deprecated.
Deprecated.

#### setEnableRunLoopProfiling

    public void setEnableRunLoopProfiling()

Enables debugging feature to perform run loop profiling. Requires trace logging to be enabled. WARNING: this feature is not recommended for use in production.

#### setClientBuggifyEnable

    public void setClientBuggifyEnable()

Enable client buggify - will make requests randomly fail (intended for client testing).

#### setClientBuggifyDisable

    public void setClientBuggifyDisable()

Disable client buggify.

#### setClientBuggifySectionActivatedProbability

    public void setClientBuggifySectionActivatedProbability​(long value)

Set the probability of a CLIENT_BUGGIFY section being active for the current execution.

Parameters:
  `value` - probability expressed as a percentage between 0 and 100

#### setClientBuggifySectionFiredProbability

    public void setClientBuggifySectionFiredProbability​(long value)

Set the probability of an active CLIENT_BUGGIFY section being fired. A section will only fire if it was activated.

Parameters:
  `value` - probability expressed as a percentage between 0 and 100

#### setDistributedClientTracer

    public void setDistributedClientTracer​(java.lang.String value)

Set a tracer to run on the client. Should be set to the same value as the tracer set on the server.

Parameters:
  `value` - Distributed tracer type. Choose from none, log_file, or network_lossy

#### setBuggifyEnable

    public void setBuggifyEnable()

#### setBuggifyDisable

    public void setBuggifyDisable()

#### getOptionConsumer

    public OptionConsumer getOptionConsumer()

Returns the object on which these options are being set. Rarely used by client code, since all options should be top-level methods on extending classes.

Returns:
  target of option set calls