-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathCreateProjectionOptions.java
More file actions
62 lines (53 loc) · 1.72 KB
/
Copy pathCreateProjectionOptions.java
File metadata and controls
62 lines (53 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package io.kurrent.dbclient;
/**
* Options for create projection request.
*/
public class CreateProjectionOptions extends OptionsBase<CreateProjectionOptions> {
private boolean trackEmittedStreams;
private boolean emitEnabled;
private int engineVersion;
private CreateProjectionOptions() {
this.trackEmittedStreams = false;
}
/**
* Returns options with default values.
*/
public static CreateProjectionOptions get() {
return new CreateProjectionOptions();
}
boolean isTrackingEmittedStreams() {
return trackEmittedStreams;
}
boolean isEmitEnabled() {
return emitEnabled;
}
int getEngineVersion() {
return engineVersion;
}
/**
* If true, the projection tracks all streams it creates.
*/
public CreateProjectionOptions trackEmittedStreams(boolean trackEmittedStreams) {
this.trackEmittedStreams = trackEmittedStreams;
return this;
}
/**
* If true, allows the projection to emit events.
*/
public CreateProjectionOptions emitEnabled(boolean value) {
this.emitEnabled = value;
return this;
}
/**
* Selects the projection engine version. {@code 0} (default) or {@code 1} selects V1;
* {@code 2} selects the V2 engine, which provides partition-based parallel processing.
* <p>
* The engine version is pinned at create time and cannot be changed via update.
* V2 has limitations versus V1: {@code trackEmittedStreams} is rejected,
* result streams are not emitted, and bi-state projections are not supported.
*/
public CreateProjectionOptions engineVersion(int value) {
this.engineVersion = value;
return this;
}
}