Skip to content

Commit 2e8726f

Browse files
authored
Merge pull request #103 from semi-technologies/replication_factor_support
Adds support for replication factor
2 parents e2311da + 68d0c7d commit 2e8726f

File tree

4 files changed

+44
-8
lines changed

4 files changed

+44
-8
lines changed

ci/docker-compose-wcs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
- --scheme
1111
- http
1212
- --write-timeout=600s
13-
image: semitechnologies/weaviate:1.16.5
13+
image: semitechnologies/weaviate:preview-replace-shardingconfig-replicas-with-replication-factor-29e987d
1414
ports:
1515
- 8083:8083
1616
restart: on-failure:0

ci/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version: '3.4'
33
services:
44
weaviate:
5-
image: semitechnologies/weaviate:1.16.5
5+
image: semitechnologies/weaviate:preview-replace-shardingconfig-replicas-with-replication-factor-29e987d
66
restart: on-failure:0
77
ports:
88
- "8080:8080"

cluster/journey.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const weaviate = require("../index");
22
const { createTestFoodSchemaAndData, cleanupTestFood, PIZZA_CLASS_NAME, SOUP_CLASS_NAME } = require("../utils/testData");
33

4-
const EXPECTED_WEAVIATE_VERSION = "1.16.5"
5-
const EXPECTED_WEAVIATE_GIT_HASH = "438e826"
4+
const EXPECTED_WEAVIATE_VERSION = "1.17.0-prealpha"
5+
const EXPECTED_WEAVIATE_GIT_HASH = "29e987d"
66

77
describe("cluster nodes endpoint", () => {
88
const client = weaviate.client({

schema/journey.test.js

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,8 @@ describe("schema", () => {
173173
removals: null
174174
}
175175
},
176-
moduleConfig: {
177-
'text2vec-contextionary':
178-
{
176+
moduleConfig: {
177+
'text2vec-contextionary': {
179178
vectorizeClassName: true
180179
}
181180
},
@@ -189,6 +188,9 @@ describe("schema", () => {
189188
strategy: "hash",
190189
virtualPerPhysical: 128,
191190
},
191+
replicationConfig: {
192+
factor: 1,
193+
},
192194
},
193195
],
194196
});
@@ -333,7 +335,7 @@ describe("schema", () => {
333335

334336
it("creates a class with bm25 and stopwords config", async () => {
335337
var newClass = {
336-
class: 'EmptyClass',
338+
class: 'EmptyClass',
337339
properties: [{dataType: ["string"],name: 'stringProp'}]
338340
}
339341

@@ -360,6 +362,37 @@ describe("schema", () => {
360362

361363
return deleteClass(client, newClass.class);
362364
});
365+
366+
it("creates a class with explicit replication config", async () => {
367+
const replicationFactor = 2;
368+
var newClass = newClassObject("SomeClass");
369+
newClass.replicationConfig.factor = replicationFactor;
370+
371+
await client.schema
372+
.classCreator()
373+
.withClass(newClass)
374+
.do()
375+
.then(res => {
376+
expect(res).toHaveProperty('replicationConfig.factor', replicationFactor);
377+
});
378+
379+
return deleteClass(client, newClass.class);
380+
});
381+
382+
it("creates a class with implicit replication config", async () => {
383+
var newClass = newClassObject("SomeClass");
384+
delete newClass.replicationConfig
385+
386+
await client.schema
387+
.classCreator()
388+
.withClass(newClass)
389+
.do()
390+
.then(res => {
391+
expect(res).toHaveProperty('replicationConfig.factor', 1);
392+
});
393+
394+
return deleteClass(client, newClass.class);
395+
});
363396
});
364397

365398
function newClassObject(className) {
@@ -421,6 +454,9 @@ function newClassObject(className) {
421454
strategy: "hash",
422455
virtualPerPhysical: 128,
423456
},
457+
replicationConfig: {
458+
factor: 1,
459+
},
424460
};
425461
}
426462

0 commit comments

Comments
 (0)