public class CollectionCreateOptions extends Object
Constructor and Description |
---|
CollectionCreateOptions() |
protected String getName()
protected CollectionCreateOptions name(String name)
name
- The name of the collectionpublic Long getJournalSize()
public CollectionCreateOptions journalSize(Long journalSize)
journalSize
- The maximal size of a journal or datafile in bytes. The value must be at least 1048576 (1 MiB).public Integer getReplicationFactor()
public CollectionCreateOptions replicationFactor(Integer replicationFactor)
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.public KeyOptions getKeyOptions()
public CollectionCreateOptions keyOptions(Boolean allowUserKeys, KeyType type, Integer increment, Integer offset)
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.public Boolean getWaitForSync()
public CollectionCreateOptions waitForSync(Boolean waitForSync)
waitForSync
- If true then the data is synchronized to disk before returning from a document create, update, replace
or removal operation. (default: false)public Boolean getDoCompact()
public CollectionCreateOptions doCompact(Boolean doCompact)
doCompact
- whether or not the collection will be compacted (default is true)public Boolean getIsVolatile()
public CollectionCreateOptions isVolatile(Boolean isVolatile)
isVolatile
- If true then the collection data is kept in-memory only and not made persistent. Unloading the
collection will cause the collection data to be discarded. Stopping or re-starting the server will
also cause full loss of data in the collection. Setting this option will make the resulting collection
be slightly faster than regular collections because ArangoDB does not enforce any synchronization to
disk and does not calculate any CRC checksums for datafiles (as there are no datafiles). This option
should therefore be used for cache-type collections only, and not for data that cannot be re-created
otherwise. (The default is false)public String[] getShardKeys()
public CollectionCreateOptions shardKeys(String... shardKeys)
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.public Integer getNumberOfShards()
public CollectionCreateOptions numberOfShards(Integer numberOfShards)
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.public Boolean getIsSystem()
public CollectionCreateOptions isSystem(Boolean isSystem)
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)public CollectionType getType()
public CollectionCreateOptions type(CollectionType type)
type
- (The default is CollectionType.DOCUMENT
): the type of the collection to create.public Integer getIndexBuckets()
public CollectionCreateOptions indexBuckets(Integer indexBuckets)
indexBuckets
- The: number of buckets into which indexes using a hash table are split. The default is 16 and this
number has to be a power of 2 and less than or equal to 1024. For very large collections one should
increase this to avoid long pauses when the hash table has to be initially built or resized, since
buckets are resized individually and can be initially built in parallel. For example, 64 might be a
sensible value for a collection with 100 000 000 documents. Currently, only the edge index respects
this value, but other index types might follow in future ArangoDB versions. Changes (see below) are
applied when the collection is loaded the next time.Copyright © 2016–2017 ArangoDB GmbH. All rights reserved.