Class DittoConfig
java.lang.Object
com.ditto.java.DittoConfig
Configuration for creating a
Ditto instance.
Use DittoConfig.Builder to construct instances of this class.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for creatingDittoConfiginstances.static classDefines how Ditto should connect to other peers.static final classExperimental features configuration for Ditto. -
Method Summary
Modifier and TypeMethodDescriptionboolean@NonNull DittoConfig.ConnectReturns the connection configuration.@NonNull StringReturns the database ID for this configuration.static @NonNull DittoConfigReturns the defaultDittoConfiginstance.static @NonNull StringReturns the default database ID.@NonNull DittoConfig.ExperimentalReturns the experimental features configuration.@Nullable FileReturns the persistence directory as a File object.@Nullable StringReturns the persistence directory path as a string.Returns the system parameters applied when the Ditto instance opened.inthashCode()toString()@NonNull DittoConfigwithConnect(@NonNull DittoConfig.Connect connect) Creates a newDittoConfigwith a different connection configuration.
-
Method Details
-
getDatabaseId
Returns the database ID for this configuration.- Returns:
- the database ID string.
-
getConnect
Returns the connection configuration.- Returns:
- the
DittoConfig.Connectconfiguration specifying how Ditto connects to other peers.
-
getPersistenceDirectory
-
getPersistenceDirectoryPath
Returns the persistence directory path as a string.- Returns:
- the persistence directory path, or null if using the default directory.
-
getExperimental
Returns the experimental features configuration.- Returns:
- the
DittoConfig.Experimentalconfiguration.
-
getSystemParameters
Returns the system parameters applied when the Ditto instance opened.
Non-negative integers are returned as
Longwhen possible andBigIntegerotherwise. Negative integers areLong, floating-point values are finiteDoublevalues, arrays areListvalues, and objects are string-keyedMapvalues.To inspect an effective value after opening Ditto, execute
SHOW parameter_nameand read the named field from the firstDittoQueryResultItem.getValue()with a typedDittoCborSerializableaccessor. The query result is a CBOR dictionary, not this configuration map.CompletionStage<Boolean> enabled = ditto.getStore().execute( "SHOW TOMBSTONE_TTL_ENABLED", result -> result.getItems().get(0).getValue().get("tombstone_ttl_enabled").asBoolean() ); -
withConnect
Creates a newDittoConfigwith a different connection configuration.- Parameters:
connect- the newDittoConfig.Connectconfiguration.- Returns:
- a new
DittoConfiginstance with the updated connection settings.
-
getDefault
Returns the defaultDittoConfiginstance.- Returns:
- a default configuration suitable for most use cases.
-
getDefaultDatabaseId
Returns the default database ID.- Returns:
- the default database ID string.
-
toString
-
hashCode
-
equals
-