Package com.arangodb.model
Class CollectionCreateOptions
- java.lang.Object
-
- com.arangodb.model.CollectionCreateOptions
-
public final class CollectionCreateOptions extends Object
- Author:
- Mark Vollmary
- See Also:
- API Documentation
-
-
Constructor Summary
Constructors Constructor Description CollectionCreateOptions()
-
Method Summary
-
-
-
Method Detail
-
getName
public String getName()
-
getReplicationFactor
public ReplicationFactor getReplicationFactor()
-
replicationFactor
public CollectionCreateOptions replicationFactor(ReplicationFactor replicationFactor)
- Parameters:
replicationFactor
- (The default is 1): in a cluster, this attribute determines how many copies of each shard are kept on different DBServers. The value 1 means that only one copy (no synchronous replication) is kept. A value of k means that k-1 replicas are kept. Any two copies reside on different DBServers. 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:
- options
-
replicationFactor
public CollectionCreateOptions replicationFactor(int replicationFactor)
-
getWriteConcern
public Integer getWriteConcern()
-
writeConcern
public CollectionCreateOptions writeConcern(Integer writeConcern)
- Parameters:
writeConcern
- write concern for this collection (default: 1). It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less then these many copies in the cluster a shard will refuse to write. Writes to shards with enough up-to-date copies will succeed at the same time however. The value of writeConcern can not be larger than replicationFactor. (cluster only)- Returns:
- options
-
getKeyOptions
public KeyOptions getKeyOptions()
-
keyOptions
public CollectionCreateOptions keyOptions(Boolean allowUserKeys, KeyType type, Integer increment, Integer offset)
- Parameters:
allowUserKeys
- if set to true, then it is allowed to supply own key values in the _key attribute of a document. If set to false, then the key generator will solely be responsible for generating keys and supplying own key values in the _key attribute of documents is considered an error.type
- specifies the type of the key generator. The currently available generators are traditional and autoincrement.increment
- increment value for autoincrement key generator. Not used for other key generator types.offset
- Initial offset value for autoincrement key generator. Not used for other key generator types.- Returns:
- options
-
getWaitForSync
public Boolean getWaitForSync()
-
waitForSync
public CollectionCreateOptions waitForSync(Boolean waitForSync)
- Parameters:
waitForSync
- If true then the data is synchronized to disk before returning from a document create, update, replace or removal operation. (default: false)- Returns:
- options
-
getShardKeys
public Collection<String> getShardKeys()
-
shardKeys
public CollectionCreateOptions shardKeys(String... shardKeys)
- Parameters:
shardKeys
- (The default is [ "_key" ]): in a cluster, this attribute determines which document attributes are used to determine the target shard for documents. Documents are sent to shards based on the values of their shard key attributes. The values of all shard key attributes in a document are hashed, and the hash value is used to determine the target shard. Note: Values of shard key attributes cannot be changed once set. This option is meaningless in a single server setup.- Returns:
- options
-
smartJoinAttribute
public CollectionCreateOptions smartJoinAttribute(String smartJoinAttribute)
- Parameters:
smartJoinAttribute
-- Returns:
- options
-
getSmartJoinAttribute
public String getSmartJoinAttribute()
-
shardingStrategy
public CollectionCreateOptions shardingStrategy(String shardingStrategy)
- Parameters:
shardingStrategy
-- Returns:
- options
-
getShardingStrategy
public String getShardingStrategy()
-
numberOfShards
public CollectionCreateOptions numberOfShards(Integer numberOfShards)
- Parameters:
numberOfShards
- (The default is 1): in a cluster, this value determines the number of shards to create for the collection. In a single server setup, this option is meaningless.- Returns:
- options
-
getNumberOfShards
public Integer getNumberOfShards()
-
getIsSystem
public Boolean getIsSystem()
-
isSystem
public CollectionCreateOptions isSystem(Boolean isSystem)
- Parameters:
isSystem
- If true, create a system collection. In this case collection-name should start with an underscore. End users should normally create non-system collections only. API implementors may be required to create system collections in very special occasions, but normally a regular collection will do. (The default is false)- Returns:
- options
-
getType
public CollectionType getType()
-
type
public CollectionCreateOptions type(CollectionType type)
- Parameters:
type
- (The default isCollectionType.DOCUMENT
): the type of the collection to create.- Returns:
- options
-
getDistributeShardsLike
public String getDistributeShardsLike()
-
distributeShardsLike
public CollectionCreateOptions distributeShardsLike(String distributeShardsLike)
- Parameters:
distributeShardsLike
- (The default is ""): in an enterprise cluster, this attribute binds the specifics of sharding for the newly created collection to follow that of a specified existing collection. Note: Using this parameter has consequences for the prototype collection. It can no longer be dropped, before sharding imitating collections are dropped. Equally, backups and restores of imitating collections alone will generate warnings, which can be overridden, about missing sharding prototype.- Returns:
- options
-
getSchema
public CollectionSchema getSchema()
-
schema
public CollectionCreateOptions schema(CollectionSchema schema)
- Parameters:
schema
- object that specifies the collection level schema for documents- Returns:
- options
- Since:
- ArangoDB 3.7
-
computedValues
public CollectionCreateOptions computedValues(ComputedValue... computedValues)
- Parameters:
computedValues
- An optional list of computed values.- Returns:
- options
- Since:
- ArangoDB 3.10
-
getComputedValues
public List<ComputedValue> getComputedValues()
-
-