17
17
18
18
package org .apache .ignite .internal .processors .query .h2 .twostep .messages ;
19
19
20
- import java . nio . ByteBuffer ;
20
+ import org . apache . ignite . internal . Order ;
21
21
import org .apache .ignite .internal .util .typedef .internal .S ;
22
22
import org .apache .ignite .plugin .extensions .communication .Message ;
23
- import org .apache .ignite .plugin .extensions .communication .MessageReader ;
24
- import org .apache .ignite .plugin .extensions .communication .MessageWriter ;
25
23
26
24
/**
27
25
* Cancel map part of query request.
28
26
*/
29
27
public class GridQueryCancelRequest implements Message {
30
28
/** */
29
+ @ Order (value = 0 , method = "queryRequestId" )
31
30
private long qryReqId ;
32
31
33
32
/**
@@ -51,50 +50,16 @@ public long queryRequestId() {
51
50
return qryReqId ;
52
51
}
53
52
54
- /** {@inheritDoc} */
55
- @ Override public String toString () {
56
- return S .toString (GridQueryCancelRequest .class , this );
57
- }
58
-
59
- /** {@inheritDoc} */
60
- @ Override public boolean writeTo (ByteBuffer buf , MessageWriter writer ) {
61
- writer .setBuffer (buf );
62
-
63
- if (!writer .isHeaderWritten ()) {
64
- if (!writer .writeHeader (directType ()))
65
- return false ;
66
-
67
- writer .onHeaderWritten ();
68
- }
69
-
70
- switch (writer .state ()) {
71
- case 0 :
72
- if (!writer .writeLong (qryReqId ))
73
- return false ;
74
-
75
- writer .incrementState ();
76
-
77
- }
78
-
79
- return true ;
53
+ /**
54
+ * @param qryReqId Query request ID.
55
+ */
56
+ public void queryRequestId (long qryReqId ) {
57
+ this .qryReqId = qryReqId ;
80
58
}
81
59
82
60
/** {@inheritDoc} */
83
- @ Override public boolean readFrom (ByteBuffer buf , MessageReader reader ) {
84
- reader .setBuffer (buf );
85
-
86
- switch (reader .state ()) {
87
- case 0 :
88
- qryReqId = reader .readLong ();
89
-
90
- if (!reader .isLastRead ())
91
- return false ;
92
-
93
- reader .incrementState ();
94
-
95
- }
96
-
97
- return true ;
61
+ @ Override public String toString () {
62
+ return S .toString (GridQueryCancelRequest .class , this );
98
63
}
99
64
100
65
/** {@inheritDoc} */
0 commit comments