Class CollectionPropertiesOptions

java.lang.Object
com.arangodb.model.CollectionPropertiesOptions

public final class CollectionPropertiesOptions extends Object
Author:
Mark Vollmary
  • Constructor Details

    • CollectionPropertiesOptions

      public CollectionPropertiesOptions()
  • Method Details

    • getCacheEnabled

      public Boolean getCacheEnabled()
    • cacheEnabled

      public CollectionPropertiesOptions cacheEnabled(Boolean cacheEnabled)
      Parameters:
      cacheEnabled - Whether the in-memory hash cache for documents should be enabled for this collection. Can be controlled globally with the --cache.size startup option. The cache can speed up repeated reads of the same documents via their document keys. If the same documents are not fetched often or are modified frequently, then you may disable the cache to avoid the maintenance costs.
      Returns:
      this
    • getComputedValues

      public List<ComputedValue> getComputedValues()
    • computedValues

      public CollectionPropertiesOptions computedValues(ComputedValue... computedValues)
      Parameters:
      computedValues - An optional list of computed values.
      Returns:
      this
      Since:
      ArangoDB 3.10
    • getReplicationFactor

      public ReplicationFactor getReplicationFactor()
    • replicationFactor

      public CollectionPropertiesOptions replicationFactor(ReplicationFactor replicationFactor)
      Parameters:
      replicationFactor - In a cluster, this attribute determines how many copies of each shard are kept on different DB-Servers. The value 1 means that only one copy (no synchronous replication) is kept. A value of k means that k-1 replicas are kept. For SatelliteCollections, it needs to be the string "satellite", which matches the replication factor to the number of DB-Servers (Enterprise Edition only).

      Any two copies reside on different DB-Servers. Replication between them is synchronous, that is, every write operation to the “leader” copy will be replicated to all “follower” replicas, before the write operation is reported successful.

      If a server fails, this is detected automatically and one of the servers holding copies take over, usually without an error being reported.

      Returns:
      this
    • getSchema

      public CollectionSchema getSchema()
    • schema

      Parameters:
      schema - object that specifies the collection level schema for documents
      Returns:
      this
      Since:
      ArangoDB 3.7
    • getWaitForSync

      public Boolean getWaitForSync()
    • waitForSync

      public CollectionPropertiesOptions waitForSync(Boolean waitForSync)
      Parameters:
      waitForSync - If true then creating or changing a document will wait until the data has been synchronized to disk.
      Returns:
      this
    • getWriteConcern

      public Integer getWriteConcern()
    • writeConcern

      public CollectionPropertiesOptions writeConcern(Integer writeConcern)
      Parameters:
      writeConcern - Determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be greater than replicationFactor.

      If distributeShardsLike is set, the default writeConcern is that of the prototype collection. For SatelliteCollections, the writeConcern is automatically controlled to equal the number of DB-Servers and has a value of 0. Otherwise, the default value is controlled by the current database’s default writeConcern, which uses the --cluster.write-concern startup option as default, which defaults to 1. (cluster only)

      Returns:
      this