Skip to content

Commit df0c1a3

Browse files
author
Mark
committed
added missing replicationFactor in
CollectionCreateOptions,CollectionPropertiesEntity
1 parent 0d4e441 commit df0c1a3

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
v4.1.1 (2016-xx-xx)
2+
---------------------------
3+
* changed json parsing of VelocyPack types not known in json
4+
* fixed VelocyPack bug with non-ASCII characters
5+
* added missing replicationFactor in CollectionCreateOptions
6+
* added missing replicationFactor in CollectionPropertiesEntity
7+
18
v4.1.0 (2016-10-28)
29
---------------------------
310
* changed VelocyStream communication (send protocol header)

src/main/java/com/arangodb/entity/CollectionPropertiesEntity.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class CollectionPropertiesEntity extends CollectionEntity {
3737
private Long count;
3838
private Integer numberOfShards;
3939
private Collection<String> shardKeys;
40+
private Integer replicationFactor;
4041

4142
public CollectionPropertiesEntity() {
4243
super();
@@ -105,4 +106,12 @@ public void setShardKeys(final Collection<String> shardKeys) {
105106
this.shardKeys = shardKeys;
106107
}
107108

109+
public Integer getReplicationFactor() {
110+
return replicationFactor;
111+
}
112+
113+
public void setReplicationFactor(final Integer replicationFactor) {
114+
this.replicationFactor = replicationFactor;
115+
}
116+
108117
}

src/main/java/com/arangodb/model/CollectionCreateOptions.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class CollectionCreateOptions {
3434

3535
private String name;
3636
private Long journalSize;
37+
private Integer replicationFactor;
3738
private KeyOptions keyOptions;
3839
private Boolean waitForSync;
3940
private Boolean doCompact;
@@ -76,6 +77,26 @@ public CollectionCreateOptions journalSize(final Long journalSize) {
7677
return this;
7778
}
7879

80+
public Integer getReplicationFactor() {
81+
return replicationFactor;
82+
}
83+
84+
/**
85+
* @param replicationFactor
86+
* (The default is 1): in a cluster, this attribute determines how many copies of each shard are kept on
87+
* different DBServers. The value 1 means that only one copy (no synchronous replication) is kept. A
88+
* value of k means that k-1 replicas are kept. Any two copies reside on different DBServers. Replication
89+
* between them is synchronous, that is, every write operation to the "leader" copy will be replicated to
90+
* all "follower" replicas, before the write operation is reported successful. If a server fails, this is
91+
* detected automatically and one of the servers holding copies take over, usually without an error being
92+
* reported.
93+
* @return options
94+
*/
95+
public CollectionCreateOptions replicationFactor(final Integer replicationFactor) {
96+
this.replicationFactor = replicationFactor;
97+
return this;
98+
}
99+
79100
public KeyOptions getKeyOptions() {
80101
return keyOptions;
81102
}

0 commit comments

Comments
 (0)