Skip to content

Commit

Permalink
tagging release 3.293
Browse files Browse the repository at this point in the history
  • Loading branch information
dxcity committed Sep 9, 2020
1 parent a2b3fe1 commit a28b0d1
Show file tree
Hide file tree
Showing 51 changed files with 183 additions and 197 deletions.
7 changes: 7 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
QDS 3.293:

* [QD-1246] LongHashMap key_set,values,entry_set,mod_count fields should not be volatile
* [QD-1252] dxFeed API: Add accessor to flags constants for OrderAction in Order
* [QD-1254] QDS: Improve schema generation code
* [QD-1255] dxFeed API: Make "ExecutedSize" field in Order enabled for Full Order Book

QDS 3.292:

* [QD-1251] New order source for cboe C2 options
Expand Down
2 changes: 1 addition & 1 deletion auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.292</version>
<version>3.293</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.292</version>
<version>3.293</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-bin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.292</version>
<version>3.293</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-codegen-verify/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.292</version>
<version>3.293</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion dxfeed-codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.292</version>
<version>3.293</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ DelegateGen phantom(String phantomProperty) {
RecordField field = lastFieldMapping().field;
field.conditionalProperty = phantomProperty;
field.isPhantom = true;
field.required = false;
field.enabled = false;
}
return this;
}
Expand All @@ -211,6 +213,7 @@ DelegateGen onlyIf(String conditionalProperty) {
field.conditionalProperty = conditionalProperty;
field.isPhantom = false;
field.required = false;
field.enabled = false;
return this;
}

Expand Down Expand Up @@ -249,6 +252,7 @@ DelegateGen onlySuffixes(String suffixesProperty, String suffixesDefault) {
fm.field.onlySuffixesProperty = suffixesProperty;
fm.field.onlySuffixesDefault = suffixesDefault;
fm.field.required = false;
fm.field.enabled = false;
return this;
}

Expand All @@ -259,6 +263,7 @@ DelegateGen exceptSuffixes(String suffixes) {
throw new AssertionError("Record should have suffixes");
fm.field.exceptSuffixes = suffixes;
fm.field.required = false;
fm.field.enabled = false;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,45 +119,12 @@ private void generateBuildSchemeCode(ClassGen cg) {
private void generateFieldCode(ClassGen cg, Map<String, RecordField> fields, String recordNameReference,
boolean isRegional)
{
String conditionalProperty = null;
boolean isPhantom = false;
for (Map.Entry<String, RecordField> fieldEntry : fields.entrySet()) {
String fieldName = fieldEntry.getKey();
RecordField f = fieldEntry.getValue();
if (isRegional && f.isCompositeOnly)
continue;
if (conditionalProperty != null &&
(!conditionalProperty.equals(f.conditionalProperty) || isPhantom != f.isPhantom))
{
cg.unindent();
cg.code("}");
conditionalProperty = null;
}
if (f.conditionalProperty != null && !f.conditionalProperty.equals(conditionalProperty)) {
cg.addImport(new ClassName(SystemProperties.class));
cg.code("if (SystemProperties.getBooleanProperty(\"" + f.conditionalProperty + "\", false)) {");
cg.indent();
conditionalProperty = f.conditionalProperty;
isPhantom = f.isPhantom;
}
if (f.onlySuffixesDefault != null || f.exceptSuffixes != null) {
cg.code("if (" +
(f.onlySuffixesDefault != null ?
("suffix.matches(" +
(f.onlySuffixesProperty != null ?
"SystemProperties.getProperty(\"" + f.onlySuffixesProperty + "\", \"" +
f.onlySuffixesDefault + "\")" :
"\"" + f.onlySuffixesDefault + "\""
) +
")"
) :
""
) +
(f.onlySuffixesDefault != null && f.exceptSuffixes != null ? " && " : "") +
(f.exceptSuffixes != null ? "!suffix.matches(\"" + f.exceptSuffixes + "\")" : "") +
")");
cg.indent();
}

cg.addImport(new ClassName(SerialFieldType.class));
for (FieldType.Field field : f.fieldType.fields) {
String typeExpr = "SerialFieldType." + field.serialType;
Expand All @@ -179,17 +146,43 @@ private void generateFieldCode(ClassGen cg, Map<String, RecordField> fields, Str
} else {
cg.code("builder.addOptionalField(" +
recordNameReference + ", \"" + field.getFullName(fieldName) + "\", " + typeExpr +
", \"" + f.eventName + "\", \"" + f.propertyName + "\", " + f.enabled +
", \"" + f.eventName + "\", \"" + f.propertyName + "\", " + generateEnabledCondition(cg, f) +
(f.time == SchemeFieldTime.COMMON_FIELD ? "" : ", SchemeFieldTime." + f.time) + ");");
}
}
if (f.onlySuffixesDefault != null || f.exceptSuffixes != null)
cg.unindent();
}
if (conditionalProperty != null) {
cg.unindent();
cg.code("}");
}

private String generateEnabledCondition(ClassGen cg, RecordField f) {
if (f.enabled) {
// Field is unconditionally enabled
return "true";
}

String enabledCondition = "";
if (f.conditionalProperty != null) {
// Field is enabled if system property is set
cg.addImport(new ClassName(SystemProperties.class));
enabledCondition += "SystemProperties.getBooleanProperty(\"" + f.conditionalProperty + "\", false)";
}
if (f.onlySuffixesDefault != null) {
if (!enabledCondition.isEmpty()) {
enabledCondition += " && ";
}
// Field is enabled if suffix matches pattern
enabledCondition += "suffix.matches(" + (f.onlySuffixesProperty != null ?
"SystemProperties.getProperty(\"" + f.onlySuffixesProperty + "\", \"" + f.onlySuffixesDefault + "\")" :
"\"" + f.onlySuffixesDefault + "\"") + ")";

}
if (f.exceptSuffixes != null) {
if (!enabledCondition.isEmpty()) {
enabledCondition += " && ";
}
// Field is enabled if not suffix matches pattern
enabledCondition += "!suffix.matches(\"" + f.exceptSuffixes + "\")";
}
return (enabledCondition.isEmpty()) ? "false" : enabledCondition;
}

private void generateCreateDelegatesCode(ClassGen cg, boolean streamOnly) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public void runForDxfeedImpl() throws IOException {
map("AuxOrderId", "AuxOrderId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
map("Price", "Price", FieldType.PRICE).
map("Size", "Size", FieldType.SIZE).
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).optional().disabledByDefault().
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
map("Count", "Count", FieldType.INT_DECIMAL).onlySuffixes("com.dxfeed.event.order.impl.Order.suffixes.count", "").
map("Flags", "Flags", FieldType.FLAGS).
map("TradeId", "TradeId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
Expand Down Expand Up @@ -284,7 +284,7 @@ public void runForDxfeedImpl() throws IOException {
map("AuxOrderId", "AuxOrderId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
map("Price", "Price", FieldType.PRICE).
map("Size", "Size", FieldType.SIZE).
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).optional().disabledByDefault().
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
map("Count", "Count", FieldType.INT_DECIMAL).onlySuffixes("com.dxfeed.event.order.impl.AnalyticOrder.suffixes.count", "").
map("Flags", "Flags", FieldType.FLAGS).
map("TradeId", "TradeId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
Expand Down Expand Up @@ -326,7 +326,7 @@ public void runForDxfeedImpl() throws IOException {
map("AuxOrderId", "AuxOrderId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
map("Price", "Price", FieldType.PRICE).
map("Size", "Size", FieldType.SIZE).
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).optional().disabledByDefault().
map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
map("Count", "Count", FieldType.INT_DECIMAL).onlySuffixes("com.dxfeed.event.order.impl.SpreadOrder.suffixes.count", "").
map("Flags", "Flags", FieldType.FLAGS).
map("TradeId", "TradeId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT).
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.292</version>
<version>3.293</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ public void buildScheme(SchemeBuilder builder) {
builder.addRequiredField(recordName, "Close", select(SerialFieldType.DECIMAL, "dxscheme.price"));
builder.addOptionalField(recordName, "Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "Volume", true);
builder.addOptionalField(recordName, "VWAP", select(SerialFieldType.DECIMAL, "dxscheme.price"), "Candle", "VWAP", true);
if (!suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*"))
builder.addOptionalField(recordName, "Bid.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "BidVolume", true);
if (!suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*"))
builder.addOptionalField(recordName, "Ask.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "AskVolume", true);
builder.addOptionalField(recordName, "Bid.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "BidVolume", !suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*"));
builder.addOptionalField(recordName, "Ask.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "AskVolume", !suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*"));
builder.addOptionalField(recordName, "ImpVolatility", select(SerialFieldType.DECIMAL), "Candle", "ImpVolatility", true);
builder.addOptionalField(recordName, "OpenInterest", select(SerialFieldType.DECIMAL, "dxscheme.oi"), "Candle", "OpenInterest", true);
}
Expand All @@ -74,10 +72,8 @@ public void buildScheme(SchemeBuilder builder) {
builder.addRequiredField(recordName, "Close", select(SerialFieldType.DECIMAL, "dxscheme.price"));
builder.addOptionalField(recordName, "Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "Volume", true);
builder.addOptionalField(recordName, "VWAP", select(SerialFieldType.DECIMAL, "dxscheme.price"), "Candle", "VWAP", true);
if (!suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*"))
builder.addOptionalField(recordName, "Bid.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "BidVolume", true);
if (!suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*"))
builder.addOptionalField(recordName, "Ask.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "AskVolume", true);
builder.addOptionalField(recordName, "Bid.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "BidVolume", !suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*"));
builder.addOptionalField(recordName, "Ask.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "AskVolume", !suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*"));
builder.addOptionalField(recordName, "ImpVolatility", select(SerialFieldType.DECIMAL), "Candle", "ImpVolatility", true);
builder.addOptionalField(recordName, "OpenInterest", select(SerialFieldType.DECIMAL, "dxscheme.oi"), "Candle", "OpenInterest", true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ public static void setOrderFlags(OrderBase order, int flags) {
order.setFlags(flags);
}

public static int orderAction(OrderAction action) {
return action.getCode() << OrderBase.ACTION_SHIFT;
}

public static OrderAction getOrderAction(int flags) {
return OrderAction.valueOf(Util.getBits(flags, OrderBase.ACTION_MASK, OrderBase.ACTION_SHIFT));
}

public static int setOrderAction(int flags, OrderAction action) {
return Util.setBits(flags, OrderBase.ACTION_MASK, OrderBase.ACTION_SHIFT, action.getCode());
}

public static int orderExchange(char exchangeCode) {
Util.checkChar(exchangeCode, OrderBase.EXCHANGE_MASK, "exchangeCode");
return exchangeCode << OrderBase.EXCHANGE_SHIFT;
Expand Down
Loading

0 comments on commit a28b0d1

Please sign in to comment.