Package com.c8db.model
Class CollectionCreateOptions
- java.lang.Object
-
- com.c8db.model.CollectionCreateOptions
-
public class CollectionCreateOptions extends Object
-
-
Constructor Summary
Constructors Constructor Description CollectionCreateOptions()
-
Method Summary
-
-
-
Method Detail
-
getName
protected String getName()
-
name
protected CollectionCreateOptions name(String name)
- Parameters:
name- The name of the collection- 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
-
getShardKeys
public 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
-
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
-
getIsSpot
public Boolean getIsSpot()
-
isSpot
public CollectionCreateOptions isSpot(Boolean isSpot)
- Parameters:
isSpot- If true then all access to the collection is done on the spot region of the fabric the collection is in. (default: false)- Returns:
- options
-
getLocal
public Boolean getLocal()
-
hasStream
public Boolean hasStream()
-
isLocal
public CollectionCreateOptions isLocal(Boolean isLocal)
- Parameters:
isLocal- If true replication type of the collection will be set as local (default: false)- Returns:
CollectionCreateOptions
-
stream
public CollectionCreateOptions stream(Boolean stream)
- Parameters:
stream- If true an associated stream will be created- Returns:
CollectionCreateOptions
-
isSystem
public CollectionCreateOptions isSystem(Boolean isSystem)
- Parameters:
isSystem- Creates a system collection when is true- Returns:
CollectionCreateOptions
-
isSystem
public final Boolean isSystem()
Checks whether the collection is system- Returns:
- true or false
-
isEnableShards
public Boolean isEnableShards()
Checks whether the shards are enabled.- Returns:
- true of false
-
enableShards
public CollectionCreateOptions enableShards(Boolean enableShards)
- Parameters:
enableShards- Sets numberOfShards to 8 if true else numberOfShards is set to 1- Returns:
CollectionCreateOptions
-
isWaitForSync
public Boolean isWaitForSync()
Checks whether the waitForSync is enabled.- Returns:
- true of false
-
waitForSync
public CollectionCreateOptions waitForSync(Boolean waitForSync)
Sets waitForSync collection creation property.- Returns:
CollectionCreateOptions
-
-