Package com.apple.foundationdb
Class DatabaseOptions
- java.lang.Object
-
- com.apple.foundationdb.DatabaseOptions
-
public class DatabaseOptions extends java.lang.ObjectA set of options that can be set on aDatabase.
-
-
Constructor Summary
Constructors Constructor Description DatabaseOptions(OptionConsumer consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description OptionConsumergetOptionConsumer()Returns the object on which these options are being set.voidsetDatacenterId(java.lang.String value)Specify the datacenter ID that was passed to fdbserver processes running in the same datacenter as this client, for better location-aware load balancing.voidsetLocationCacheSize(long value)Set the size of the client location cache.voidsetMachineId(java.lang.String value)Specify the machine ID that was passed to fdbserver processes running on the same machine as this client, for better location-aware load balancing.voidsetMaxWatches(long value)Set the maximum number of watches allowed to be outstanding on a database connection.protected voidsetOption(int code)protected voidsetOption(int code, byte[] param)protected voidsetOption(int code, long param)protected voidsetOption(int code, java.lang.String param)voidsetSnapshotRywDisable()Snapshot read operations will not see the results of writes done in the same transaction.voidsetSnapshotRywEnable()Snapshot read operations will see the results of writes done in the same transaction.voidsetTestCausalReadRisky(long value)Enables verification of causal read risky by checking whether clients are able to read stale data when they detect a recovery, and logging an error if so.voidsetTransactionAutomaticIdempotency()Set a random idempotency id for all transactions.voidsetTransactionBypassUnreadable()Allowsgetoperations to read from sections of keyspace that have become unreadable because of versionstamp operations.voidsetTransactionCausalReadRisky()The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock.voidsetTransactionIncludePortInAddress()Deprecated.voidsetTransactionLoggingMaxFieldLength(long value)Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option.voidsetTransactionMaxRetryDelay(long value)Set the maximum amount of backoff delay incurred in the call toonErrorif the error is retryable.voidsetTransactionReportConflictingKeys()Enables conflicting key reporting on all transactions, allowing them to retrieve the keys that are conflicting with other transactions.voidsetTransactionRetryLimit(long value)Set a maximum number of retries after which additional calls toonErrorwill throw the most recently seen error code.voidsetTransactionSizeLimit(long value)Set the maximum transaction size in bytes.voidsetTransactionTimeout(long value)Set a timeout in milliseconds which, when elapsed, will cause each transaction automatically to be cancelled.voidsetTransactionUsedDuringCommitProtectionDisable()By default, operations that are performed on a transaction while it is being committed will not only fail themselves, but they will attempt to fail other in-flight operations (such as the commit) as well.voidsetUseConfigDatabase()Use configuration database.
-
-
-
Constructor Detail
-
DatabaseOptions
public DatabaseOptions(OptionConsumer consumer)
-
-
Method Detail
-
setLocationCacheSize
public void setLocationCacheSize(long value)
Set the size of the client location cache. Raising this value can boost performance in very large databases where clients access data in a near-random pattern. Defaults to 100000.- Parameters:
value- Max location cache entries
-
setMaxWatches
public void setMaxWatches(long value)
Set the maximum number of watches allowed to be outstanding on a database connection. Increasing this number could result in increased resource usage. Reducing this number will not cancel any outstanding watches. Defaults to 10000 and cannot be larger than 1000000.- Parameters:
value- Max outstanding watches
-
setMachineId
public void setMachineId(java.lang.String value)
Specify the machine ID that was passed to fdbserver processes running on the same machine as this client, for better location-aware load balancing.- Parameters:
value- Hexadecimal ID
-
setDatacenterId
public void setDatacenterId(java.lang.String value)
Specify the datacenter ID that was passed to fdbserver processes running in the same datacenter as this client, for better location-aware load balancing.- Parameters:
value- A string identifier for the datacenter
-
setSnapshotRywEnable
public void setSnapshotRywEnable()
Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior.
-
setSnapshotRywDisable
public void setSnapshotRywDisable()
Snapshot read operations will not see the results of writes done in the same transaction. This was the default behavior prior to API version 300.
-
setTransactionLoggingMaxFieldLength
public void setTransactionLoggingMaxFieldLength(long value)
Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option. This sets thetransaction_logging_max_field_lengthoption of each transaction created by this database. See the transaction option description for more information.- Parameters:
value- Maximum length of escaped key and value fields.
-
setTransactionTimeout
public void setTransactionTimeout(long value)
Set a timeout in milliseconds which, when elapsed, will cause each transaction automatically to be cancelled. This sets thetimeoutoption of each transaction created by this database. See the transaction option description for more information. Using this option requires that the API version is 610 or higher.- Parameters:
value- value in milliseconds of timeout
-
setTransactionRetryLimit
public void setTransactionRetryLimit(long value)
Set a maximum number of retries after which additional calls toonErrorwill throw the most recently seen error code. This sets theretry_limitoption of each transaction created by this database. See the transaction option description for more information.- Parameters:
value- number of times to retry
-
setTransactionMaxRetryDelay
public void setTransactionMaxRetryDelay(long value)
Set the maximum amount of backoff delay incurred in the call toonErrorif the error is retryable. This sets themax_retry_delayoption of each transaction created by this database. See the transaction option description for more information.- Parameters:
value- value in milliseconds of maximum delay
-
setTransactionSizeLimit
public void setTransactionSizeLimit(long value)
Set the maximum transaction size in bytes. This sets thesize_limitoption on each transaction created by this database. See the transaction option description for more information.- Parameters:
value- value in bytes
-
setTransactionCausalReadRisky
public void setTransactionCausalReadRisky()
The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock.
-
setTransactionIncludePortInAddress
@Deprecated public void setTransactionIncludePortInAddress()
Deprecated.Deprecated. Addresses returned by get_addresses_for_key include the port when enabled. As of api version 630, this option is enabled by default and setting this has no effect.
-
setTransactionAutomaticIdempotency
public void setTransactionAutomaticIdempotency()
Set a random idempotency id for all transactions. See the transaction option description for more information. This feature is in development and not ready for general use.
-
setTransactionBypassUnreadable
public void setTransactionBypassUnreadable()
Allowsgetoperations to read from sections of keyspace that have become unreadable because of versionstamp operations. This sets thebypass_unreadableoption of each transaction created by this database. See the transaction option description for more information.
-
setTransactionUsedDuringCommitProtectionDisable
public void setTransactionUsedDuringCommitProtectionDisable()
By default, operations that are performed on a transaction while it is being committed will not only fail themselves, but they will attempt to fail other in-flight operations (such as the commit) as well. This behavior is intended to help developers discover situations where operations could be unintentionally executed after the transaction has been reset. Setting this option removes that protection, causing only the offending operation to fail.
-
setTransactionReportConflictingKeys
public void setTransactionReportConflictingKeys()
Enables conflicting key reporting on all transactions, allowing them to retrieve the keys that are conflicting with other transactions.
-
setUseConfigDatabase
public void setUseConfigDatabase()
Use configuration database.
-
setTestCausalReadRisky
public void setTestCausalReadRisky(long value)
Enables verification of causal read risky by checking whether clients are able to read stale data when they detect a recovery, and logging an error if so.- Parameters:
value- integer between 0 and 100 expressing the probability a client will verify it can't read stale data
-
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
-
setOption
protected void setOption(int code)
-
setOption
protected void setOption(int code, byte[] param)
-
setOption
protected void setOption(int code, java.lang.String param)
-
setOption
protected void setOption(int code, long param)
-
-