Skip to content

Commit a28b0d1

Browse files
author
dxcity
committed
tagging release 3.293
1 parent a2b3fe1 commit a28b0d1

File tree

51 files changed

+183
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+183
-197
lines changed

ReleaseNotes.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
QDS 3.293:
2+
3+
* [QD-1246] LongHashMap key_set,values,entry_set,mod_count fields should not be volatile
4+
* [QD-1252] dxFeed API: Add accessor to flags constants for OrderAction in Order
5+
* [QD-1254] QDS: Improve schema generation code
6+
* [QD-1255] dxFeed API: Make "ExecutedSize" field in Order enabled for Full Order Book
7+
18
QDS 3.292:
29

310
* [QD-1251] New order source for cboe C2 options

auth/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<artifactId>QD</artifactId>
1616
<groupId>com.devexperts.qd</groupId>
17-
<version>3.292</version>
17+
<version>3.293</version>
1818
<relativePath>../pom.xml</relativePath>
1919
</parent>
2020
<modelVersion>4.0.0</modelVersion>

dxfeed-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<artifactId>QD</artifactId>
1616
<groupId>com.devexperts.qd</groupId>
17-
<version>3.292</version>
17+
<version>3.293</version>
1818
<relativePath>../pom.xml</relativePath>
1919
</parent>
2020
<modelVersion>4.0.0</modelVersion>

dxfeed-bin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<artifactId>QD</artifactId>
1616
<groupId>com.devexperts.qd</groupId>
17-
<version>3.292</version>
17+
<version>3.293</version>
1818
<relativePath>../pom.xml</relativePath>
1919
</parent>
2020
<modelVersion>4.0.0</modelVersion>

dxfeed-codegen-verify/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<artifactId>QD</artifactId>
1616
<groupId>com.devexperts.qd</groupId>
17-
<version>3.292</version>
17+
<version>3.293</version>
1818
</parent>
1919
<modelVersion>4.0.0</modelVersion>
2020

dxfeed-codegen/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<artifactId>QD</artifactId>
1616
<groupId>com.devexperts.qd</groupId>
17-
<version>3.292</version>
17+
<version>3.293</version>
1818
<relativePath>../pom.xml</relativePath>
1919
</parent>
2020
<modelVersion>4.0.0</modelVersion>

dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/DelegateGen.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ DelegateGen phantom(String phantomProperty) {
200200
RecordField field = lastFieldMapping().field;
201201
field.conditionalProperty = phantomProperty;
202202
field.isPhantom = true;
203+
field.required = false;
204+
field.enabled = false;
203205
}
204206
return this;
205207
}
@@ -211,6 +213,7 @@ DelegateGen onlyIf(String conditionalProperty) {
211213
field.conditionalProperty = conditionalProperty;
212214
field.isPhantom = false;
213215
field.required = false;
216+
field.enabled = false;
214217
return this;
215218
}
216219

@@ -249,6 +252,7 @@ DelegateGen onlySuffixes(String suffixesProperty, String suffixesDefault) {
249252
fm.field.onlySuffixesProperty = suffixesProperty;
250253
fm.field.onlySuffixesDefault = suffixesDefault;
251254
fm.field.required = false;
255+
fm.field.enabled = false;
252256
return this;
253257
}
254258

@@ -259,6 +263,7 @@ DelegateGen exceptSuffixes(String suffixes) {
259263
throw new AssertionError("Record should have suffixes");
260264
fm.field.exceptSuffixes = suffixes;
261265
fm.field.required = false;
266+
fm.field.enabled = false;
262267
return this;
263268
}
264269

dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/FactoryImplGen.java

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -119,45 +119,12 @@ private void generateBuildSchemeCode(ClassGen cg) {
119119
private void generateFieldCode(ClassGen cg, Map<String, RecordField> fields, String recordNameReference,
120120
boolean isRegional)
121121
{
122-
String conditionalProperty = null;
123-
boolean isPhantom = false;
124122
for (Map.Entry<String, RecordField> fieldEntry : fields.entrySet()) {
125123
String fieldName = fieldEntry.getKey();
126124
RecordField f = fieldEntry.getValue();
127125
if (isRegional && f.isCompositeOnly)
128126
continue;
129-
if (conditionalProperty != null &&
130-
(!conditionalProperty.equals(f.conditionalProperty) || isPhantom != f.isPhantom))
131-
{
132-
cg.unindent();
133-
cg.code("}");
134-
conditionalProperty = null;
135-
}
136-
if (f.conditionalProperty != null && !f.conditionalProperty.equals(conditionalProperty)) {
137-
cg.addImport(new ClassName(SystemProperties.class));
138-
cg.code("if (SystemProperties.getBooleanProperty(\"" + f.conditionalProperty + "\", false)) {");
139-
cg.indent();
140-
conditionalProperty = f.conditionalProperty;
141-
isPhantom = f.isPhantom;
142-
}
143-
if (f.onlySuffixesDefault != null || f.exceptSuffixes != null) {
144-
cg.code("if (" +
145-
(f.onlySuffixesDefault != null ?
146-
("suffix.matches(" +
147-
(f.onlySuffixesProperty != null ?
148-
"SystemProperties.getProperty(\"" + f.onlySuffixesProperty + "\", \"" +
149-
f.onlySuffixesDefault + "\")" :
150-
"\"" + f.onlySuffixesDefault + "\""
151-
) +
152-
")"
153-
) :
154-
""
155-
) +
156-
(f.onlySuffixesDefault != null && f.exceptSuffixes != null ? " && " : "") +
157-
(f.exceptSuffixes != null ? "!suffix.matches(\"" + f.exceptSuffixes + "\")" : "") +
158-
")");
159-
cg.indent();
160-
}
127+
161128
cg.addImport(new ClassName(SerialFieldType.class));
162129
for (FieldType.Field field : f.fieldType.fields) {
163130
String typeExpr = "SerialFieldType." + field.serialType;
@@ -179,17 +146,43 @@ private void generateFieldCode(ClassGen cg, Map<String, RecordField> fields, Str
179146
} else {
180147
cg.code("builder.addOptionalField(" +
181148
recordNameReference + ", \"" + field.getFullName(fieldName) + "\", " + typeExpr +
182-
", \"" + f.eventName + "\", \"" + f.propertyName + "\", " + f.enabled +
149+
", \"" + f.eventName + "\", \"" + f.propertyName + "\", " + generateEnabledCondition(cg, f) +
183150
(f.time == SchemeFieldTime.COMMON_FIELD ? "" : ", SchemeFieldTime." + f.time) + ");");
184151
}
185152
}
186-
if (f.onlySuffixesDefault != null || f.exceptSuffixes != null)
187-
cg.unindent();
188153
}
189-
if (conditionalProperty != null) {
190-
cg.unindent();
191-
cg.code("}");
154+
}
155+
156+
private String generateEnabledCondition(ClassGen cg, RecordField f) {
157+
if (f.enabled) {
158+
// Field is unconditionally enabled
159+
return "true";
160+
}
161+
162+
String enabledCondition = "";
163+
if (f.conditionalProperty != null) {
164+
// Field is enabled if system property is set
165+
cg.addImport(new ClassName(SystemProperties.class));
166+
enabledCondition += "SystemProperties.getBooleanProperty(\"" + f.conditionalProperty + "\", false)";
167+
}
168+
if (f.onlySuffixesDefault != null) {
169+
if (!enabledCondition.isEmpty()) {
170+
enabledCondition += " && ";
171+
}
172+
// Field is enabled if suffix matches pattern
173+
enabledCondition += "suffix.matches(" + (f.onlySuffixesProperty != null ?
174+
"SystemProperties.getProperty(\"" + f.onlySuffixesProperty + "\", \"" + f.onlySuffixesDefault + "\")" :
175+
"\"" + f.onlySuffixesDefault + "\"") + ")";
176+
177+
}
178+
if (f.exceptSuffixes != null) {
179+
if (!enabledCondition.isEmpty()) {
180+
enabledCondition += " && ";
181+
}
182+
// Field is enabled if not suffix matches pattern
183+
enabledCondition += "!suffix.matches(\"" + f.exceptSuffixes + "\")";
192184
}
185+
return (enabledCondition.isEmpty()) ? "false" : enabledCondition;
193186
}
194187

195188
private void generateCreateDelegatesCode(ClassGen cg, boolean streamOnly) {

dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/ImplCodeGen.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public void runForDxfeedImpl() throws IOException {
242242
map("AuxOrderId", "AuxOrderId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
243243
map("Price", "Price", FieldType.PRICE).
244244
map("Size", "Size", FieldType.SIZE).
245-
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).optional().disabledByDefault().
245+
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
246246
map("Count", "Count", FieldType.INT_DECIMAL).onlySuffixes("com.dxfeed.event.order.impl.Order.suffixes.count", "").
247247
map("Flags", "Flags", FieldType.FLAGS).
248248
map("TradeId", "TradeId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
@@ -284,7 +284,7 @@ public void runForDxfeedImpl() throws IOException {
284284
map("AuxOrderId", "AuxOrderId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
285285
map("Price", "Price", FieldType.PRICE).
286286
map("Size", "Size", FieldType.SIZE).
287-
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).optional().disabledByDefault().
287+
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
288288
map("Count", "Count", FieldType.INT_DECIMAL).onlySuffixes("com.dxfeed.event.order.impl.AnalyticOrder.suffixes.count", "").
289289
map("Flags", "Flags", FieldType.FLAGS).
290290
map("TradeId", "TradeId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
@@ -326,7 +326,7 @@ public void runForDxfeedImpl() throws IOException {
326326
map("AuxOrderId", "AuxOrderId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
327327
map("Price", "Price", FieldType.PRICE).
328328
map("Size", "Size", FieldType.SIZE).
329-
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).optional().disabledByDefault().
329+
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
330330
map("Count", "Count", FieldType.INT_DECIMAL).onlySuffixes("com.dxfeed.event.order.impl.SpreadOrder.suffixes.count", "").
331331
map("Flags", "Flags", FieldType.FLAGS).
332332
map("TradeId", "TradeId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).

dxfeed-impl/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<artifactId>QD</artifactId>
1616
<groupId>com.devexperts.qd</groupId>
17-
<version>3.292</version>
17+
<version>3.293</version>
1818
</parent>
1919
<modelVersion>4.0.0</modelVersion>
2020

0 commit comments

Comments
 (0)