Skip to content

Commit eb1bf75

Browse files
author
dxcity
committed
tagging release 3.280
1 parent 149b013 commit eb1bf75

File tree

76 files changed

+1967
-420
lines changed

Some content is hidden

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

76 files changed

+1967
-420
lines changed

ReleaseNotes.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
QDS 3.280:
2+
3+
* [QD-1202] dxFeed API: Add AnalyticOrder event
4+
- com.dxfeed.event.market.AnalyticOrder is introduced.
5+
* [QD-1201] [Schedule] Short days robustness
6+
* [QD-1160] Flaky test: RMIFunctionalityTest.testLargeRequests
7+
* [QD-1172] Flaky test: RMIFunctionalityTest.testLargeResponses
8+
* [QD-1175] Flaky test: RMIFunctionalityTest.testLargeRequestCancellations
9+
* [QD-1195] Publish "shaped" connection codec.
10+
- Output throughput limit is specified with 'outLimit' parameter (as a bytes-per-second float number):
11+
"shaped[outLimit=100k]+:7000"
12+
* [QD-1154] Flaky test: SocketRebindTest
13+
114
QDS 3.279:
215

316
* [QD-1182] [Schedule] Add ability to specify schedule for short days

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.279</version>
17+
<version>3.280</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.279</version>
17+
<version>3.280</version>
1818
<relativePath>../pom.xml</relativePath>
1919
</parent>
2020
<modelVersion>4.0.0</modelVersion>

dxfeed-api/src/main/java/com/dxfeed/api/DXFeed.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ public <E extends LastingEvent<?>> Collection<E> getLastEvents(Collection<E> eve
443443
* <h3>Event source</h3>
444444
*
445445
* Use the {@link IndexedEventSource#DEFAULT DEFAULT} value for {@code source} with events that do not
446-
* have multiple sources (like {@link Series}). For events with multiple sources (like {@link Order}
447-
* and {@link SpreadOrder}), use an even-specific source class (for example, {@link OrderSource}).
446+
* have multiple sources (like {@link Series}). For events with multiple sources (like {@link Order},
447+
* {@link AnalyticOrder}) and {@link SpreadOrder}, use an event-specific source class (for example, {@link OrderSource}).
448448
* This method does not support <em>synthetic</em> sources of orders (orders that are automatically
449449
* generated from {@link Quote} events).
450450
*
@@ -504,8 +504,8 @@ public abstract <E extends IndexedEvent<?>> Promise<List<E>> getIndexedEventsPro
504504
* <h3>Event source</h3>
505505
*
506506
* Use the {@link IndexedEventSource#DEFAULT DEFAULT} value for {@code source} with events that do not
507-
* have multiple sources (like {@link Series}). For events with multiple sources (like {@link Order}
508-
* and {@link SpreadOrder}), use an even-specific source class (for example, {@link OrderSource}).
507+
* have multiple sources (like {@link Series}). For events with multiple sources (like {@link Order},
508+
* {@link AnalyticOrder} and {@link SpreadOrder}), use an event-specific source class (for example, {@link OrderSource}).
509509
* This method does not support <em>synthetic</em> sources of orders (orders that are automatically
510510
* generated from {@link Quote} events).
511511
*
Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
/*
2+
* !++
3+
* QDS - Quick Data Signalling Library
4+
* !-
5+
* Copyright (C) 2002 - 2019 Devexperts LLC
6+
* !-
7+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
8+
* If a copy of the MPL was not distributed with this file, You can obtain one at
9+
* http://mozilla.org/MPL/2.0/.
10+
* !__
11+
*/
12+
package com.dxfeed.event.market;
13+
14+
import com.dxfeed.api.DXFeed;
15+
import com.dxfeed.api.DXPublisher;
16+
import com.dxfeed.model.AbstractIndexedEventModel;
17+
import com.dxfeed.model.IndexedEventModel;
18+
19+
import java.util.Collection;
20+
import javax.xml.bind.annotation.XmlRootElement;
21+
import javax.xml.bind.annotation.XmlType;
22+
23+
/**
24+
* Represents an extension of {@link Order} introducing analytic information, e.g. adding to this order iceberg related
25+
* information ({@link #icebergPeakSize}, {@link #icebergHiddenSize}, {@link #icebergExecutedSize}).
26+
* The collection of analytic order events of a symbol represents the most recent analytic information
27+
* that is available about orders on the market at any given moment of time.
28+
*
29+
* <p> Analytic order is similar to a regular {@link Order}. In addition this event has few additional properties:
30+
* <ul>
31+
* <li>{@link #icebergPeakSize} - the size of the peak, i.e. the visible part of the iceberg,
32+
* that is being continually refilled until the order is fully traded or cancelled;
33+
* <li>{@link #icebergHiddenSize} - the prediction of current hidden size of the iceberg, as inferred by the model;
34+
* <li>{@link #icebergExecutedSize} - the executed size of the iceberg order. For {@link IcebergType#SYNTHETIC} type
35+
* represents total executed size of all orders сomposing current iceberg;
36+
* <li>{@link #getIcebergType()} - type of the iceberg, either native (exchange-managed) or synthetic (managed outside of the exchange).
37+
* </ul>
38+
*
39+
* <p> Like regular orders, analytic order events arrive from
40+
* multiple sources for the same market symbol and are distinguished by their
41+
* {@link #getIndex index}.
42+
* It is unique across all the sources of depth information for the symbol.
43+
* The event with {@link #getSizeAsDouble() sizeAsDouble} either {@code 0} or {@link Double#NaN NaN}
44+
* is a signal to remove previously received order for the corresponding index.
45+
* The method {@link #hasSize() hasSize} is a convenient method to test for size presence.
46+
*
47+
* <h3>Properties</h3>
48+
* <p>
49+
* {@code Analytic} event has the following properties:
50+
*
51+
* <ul>
52+
* <li>{@link #getEventSymbol() eventSymbol} - underlying symbol of this event;
53+
* <li>{@link #getSource() source} - source of this event;
54+
* <li>{@link #getEventFlags() eventFlags} - transactional event flags;
55+
* <li>{@link #getIndex() index} - unique per-symbol index of this order;
56+
* <li>{@link #getTime() time} - time of this order;
57+
* <li>{@link #getTimeNanoPart() timeNanoPart} - microseconds and nanoseconds time part of this order;
58+
* <li>{@link #getSequence() sequence} - sequence of this order;
59+
* <li>{@link #getPrice() price} - price of this order;
60+
* <li>{@link #getSize() size} - size of this order as integer number (rounded toward zero);
61+
* <li>{@link #getSizeAsDouble() sizeAsDouble} - size of this order as floating number with fractions;
62+
* <li>{@link #getExecutedSize() executedSize} - executed size of this order;
63+
* <li>{@link #getCount() count} - number of individual orders in this aggregate order;
64+
* <li>{@link #getExchangeCode() exchangeCode} - exchange code of this order;
65+
* <li>{@link #getOrderSide() orderSide} - side of this order;
66+
* <li>{@link #getScope() scope} - scope of this order;
67+
* <li>{@link #getMarketMaker() marketMaker} - market maker or other aggregate identifier of this order;
68+
* <li>{@link #getIcebergPeakSize() icebergPeakSize} - iceberg peak size of this analytic order;
69+
* <li>{@link #getIcebergHiddenSize() icebergHiddenSize} - iceberg hidden size of this analytic order;
70+
* <li>{@link #getIcebergExecutedSize() icebergExecutedSize} - iceberg executed size of this analytic order;
71+
* <li>{@link #getIcebergType() icebergType} - iceberg type of this analytic order.
72+
* </ul>
73+
*
74+
* <h3><a name="eventFlagsSection">Event flags, transactions and snapshots</a></h3>
75+
* <p>
76+
* Analytic order event sources provide a consistent view of the analytic order book. Their updates
77+
* may incorporate multiple changes to individual orders that have to be processed at the same time.
78+
* The corresponding information is carried in {@link #getEventFlags() eventFlags} property.
79+
*
80+
* <p> See <a href="OrderBase.html#eventFlagsSection">Event Flags</a> section of {@link OrderBase}
81+
* class documentation for details.
82+
*
83+
* <p>{@link IndexedEventModel} class handles all the snapshot and transaction logic and conveniently represents
84+
* a list current of events.
85+
* It relies on the code of {@link AbstractIndexedEventModel} to handle this logic.
86+
* Use the source code of {@link AbstractIndexedEventModel} for clarification on transactions and snapshot logic.
87+
*
88+
* <h3>Publishing order books</h3>
89+
* <p>
90+
* When publishing an order event with {@link DXPublisher#publishEvents(Collection) DXPublisher.publishEvents}
91+
* method, least significant 32 bits of order {@link #getIndex() index} must be in a range of from 0 to
92+
* {@link Integer#MAX_VALUE} inclusive.
93+
* Use {@link #setSource(OrderSource) setSource} method after {@link #setIndex(long) setIndex} to properly
94+
* include source identifier into the index.
95+
* <p>
96+
* A snapshot has to be published in the <em>descending</em> order of {@link #getIndex() index}, starting with
97+
* an event with the largest index and marking it with {@link #SNAPSHOT_BEGIN} bit in {@link #getEventFlags() eventFlags},
98+
* and finishing the snapshot with an event that has zero 32 least significant bits of index.
99+
* {@link #SNAPSHOT_END} bit in {@link #getEventFlags() eventFlags} is optional during publishing.
100+
* It will be properly set on receiving end anyway.
101+
*
102+
* <h3>Limitations</h3>
103+
* <p>
104+
* This event type cannot be used with {@link DXFeed#getLastEvent DXFeed.getLastEvent} method.
105+
*
106+
* <h3>Implementation details</h3>
107+
* <p>
108+
* This event is implemented on top of QDS records {@code AnalyticOrder#<source-id>},
109+
* where {@code <source-id>} is up to 4 ASCII characters with a mnemonic for the source like "GLBX".
110+
*/
111+
@XmlRootElement(name = "AnalyticOrder")
112+
@XmlType(propOrder = {"icebergPeakSize", "icebergHiddenSize", "icebergExecutedSize", "icebergType"})
113+
public class AnalyticOrder extends Order {
114+
private static final long serialVersionUID = 0;
115+
116+
// ========================= private static =========================
117+
118+
/*
119+
* Analytic flags property has several significant bits that are packed into an integer in the following way:
120+
* 31...2 1 0
121+
* +--------------+-------+-------+
122+
* | | IcebergType |
123+
* +--------------+-------+-------+
124+
*/
125+
126+
// TYPE values are taken from Type enum.
127+
static final int ICEBERG_TYPE_MASK = 3;
128+
static final int ICEBERG_TYPE_SHIFT = 0;
129+
130+
// ========================= instance =========================
131+
132+
private double icebergPeakSize = Double.NaN;
133+
private double icebergHiddenSize = Double.NaN;
134+
private double icebergExecutedSize = Double.NaN;
135+
private int icebergFlags;
136+
137+
/**
138+
* Creates new analytic order with default values.
139+
*/
140+
public AnalyticOrder() {
141+
}
142+
143+
/**
144+
* Creates new analytic order with the specified event symbol.
145+
*
146+
* @param eventSymbol event symbol.
147+
*/
148+
public AnalyticOrder(String eventSymbol) {
149+
super(eventSymbol);
150+
}
151+
152+
/**
153+
* Returns iceberg peak size of this analytic order.
154+
*
155+
* @return iceberg peak size of this analytic order.
156+
*/
157+
public double getIcebergPeakSize() {
158+
return icebergPeakSize;
159+
}
160+
161+
/**
162+
* Changes iceberg peak size of this analytic order.
163+
*
164+
* @param icebergPeakSize iceberg peak size of this analytic order.
165+
*/
166+
public void setIcebergPeakSize(double icebergPeakSize) {
167+
this.icebergPeakSize = icebergPeakSize;
168+
}
169+
170+
/**
171+
* Returns iceberg hidden size of this analytic order.
172+
*
173+
* @return iceberg hidden size of this analytic order.
174+
*/
175+
public double getIcebergHiddenSize() {
176+
return icebergHiddenSize;
177+
}
178+
179+
/**
180+
* Changes iceberg hidden size of this analytic order.
181+
*
182+
* @param icebergHiddenSize iceberg hidden size of this analytic order.
183+
*/
184+
public void setIcebergHiddenSize(double icebergHiddenSize) {
185+
this.icebergHiddenSize = icebergHiddenSize;
186+
}
187+
188+
/**
189+
* Returns iceberg executed size of this analytic order.
190+
*
191+
* @return iceberg executed size of this analytic order.
192+
*/
193+
194+
public double getIcebergExecutedSize() {
195+
return icebergExecutedSize;
196+
}
197+
198+
/**
199+
* Changes iceberg executed size of this analytic order.
200+
*
201+
* @param icebergExecutedSize iceberg executed size of this analytic order.
202+
*/
203+
public void setIcebergExecutedSize(double icebergExecutedSize) {
204+
this.icebergExecutedSize = icebergExecutedSize;
205+
}
206+
207+
/**
208+
* Returns iceberg type of this analytic order.
209+
*
210+
* @return iceberg type of this analytic order.
211+
*/
212+
public IcebergType getIcebergType() {
213+
return IcebergType.valueOf(Util.getBits(icebergFlags, ICEBERG_TYPE_MASK, ICEBERG_TYPE_SHIFT));
214+
}
215+
216+
/**
217+
* Changes iceberg type of this analytic order.
218+
*
219+
* @param icebergType iceberg type of this analytic order.
220+
*/
221+
public void setIcebergType(IcebergType icebergType) {
222+
icebergFlags = Util.setBits(icebergFlags, ICEBERG_TYPE_MASK, ICEBERG_TYPE_SHIFT, icebergType.getCode());
223+
}
224+
225+
/**
226+
* Returns string representation of this analytic order.
227+
*
228+
* @return string representation of this analytic order.
229+
*/
230+
@Override
231+
public String toString() {
232+
return "AnalyticOrder{" + baseFieldsToString() +
233+
", icebergPeakSize=" + icebergPeakSize +
234+
", icebergHiddenSize=" + icebergHiddenSize +
235+
", icebergExecutedSize=" + icebergExecutedSize +
236+
", icebergType=" + getIcebergType() +
237+
"}";
238+
}
239+
240+
// ========================= package private access for delegate =========================
241+
242+
/**
243+
* Returns implementation-specific flags relevant only for iceberg related part of analytic order.
244+
* <b>Do not use this method directly.</b>
245+
* It may be removed or changed in the future versions.
246+
*
247+
* @return iceberg flags.
248+
*/
249+
int getIcebergFlags() {
250+
return icebergFlags;
251+
}
252+
253+
/**
254+
* Changes implementation-specific flags relevant only for iceberg related part of analytic order.
255+
* <b>Do not use this method directly.</b>
256+
* It may be removed or changed in the future versions.
257+
*
258+
* @param icebergFlags iceberg flags.
259+
*/
260+
void setIcebergFlags(int icebergFlags) {
261+
this.icebergFlags = icebergFlags;
262+
}
263+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* !++
3+
* QDS - Quick Data Signalling Library
4+
* !-
5+
* Copyright (C) 2002 - 2019 Devexperts LLC
6+
* !-
7+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
8+
* If a copy of the MPL was not distributed with this file, You can obtain one at
9+
* http://mozilla.org/MPL/2.0/.
10+
* !__
11+
*/
12+
package com.dxfeed.event.market;
13+
14+
/**
15+
* Type of an iceberg order.
16+
*/
17+
public enum IcebergType {
18+
19+
/**
20+
* Iceberg type is undefined, unknown or inapplicable.
21+
*/
22+
UNDEFINED(0),
23+
24+
/**
25+
* Represents native (exchange-managed) iceberg type.
26+
*/
27+
NATIVE(1),
28+
29+
/**
30+
* Represents synthetic (managed outside of the exchange) iceberg type
31+
*/
32+
SYNTHETIC(2);
33+
34+
private static final IcebergType[] TYPES = Util.buildEnumArrayByOrdinal(UNDEFINED, 3);
35+
36+
/**
37+
* Returns iceberg type by integer code bit pattern.
38+
*
39+
* @param code integer code.
40+
* @return iceberg type.
41+
* @throws ArrayIndexOutOfBoundsException if code is invalid.
42+
*/
43+
public static IcebergType valueOf(int code) {
44+
return TYPES[code];
45+
}
46+
47+
private final int code;
48+
49+
private IcebergType(int code) {
50+
this.code = code;
51+
if (code != ordinal())
52+
throw new IllegalArgumentException("code differs from ordinal");
53+
}
54+
55+
/**
56+
* Returns integer code that is used in flag bits.
57+
*
58+
* @return integer code.
59+
*/
60+
public int getCode() {
61+
return code;
62+
}
63+
}

0 commit comments

Comments
 (0)