2020import org .apache .ignite .internal .GridKernalContext ;
2121import org .apache .ignite .internal .binary .BinaryRawReaderEx ;
2222import org .apache .ignite .internal .binary .BinaryRawWriterEx ;
23+ import org .apache .ignite .internal .binary .BinaryReaderExImpl ;
2324import org .apache .ignite .internal .binary .GridBinaryMarshaller ;
2425import org .apache .ignite .internal .binary .streams .BinaryHeapInputStream ;
2526import org .apache .ignite .internal .binary .streams .BinaryHeapOutputStream ;
6970 * Thin client message parser.
7071 */
7172public class ClientMessageParser implements ClientListenerMessageParser {
73+ /* General-purpose operations. */
7274 /** */
73- private static final short OP_CACHE_GET = 1 ;
75+ private static final short OP_RESOURCE_CLOSE = 0 ;
7476
77+ /* Cache operations */
7578 /** */
76- private static final short OP_GET_BINARY_TYPE_NAME = 2 ;
79+ private static final short OP_CACHE_GET = 1000 ;
7780
7881 /** */
79- private static final short OP_GET_BINARY_TYPE = 3 ;
82+ private static final short OP_CACHE_PUT = 1001 ;
8083
8184 /** */
82- private static final short OP_CACHE_PUT = 4 ;
85+ private static final short OP_CACHE_PUT_IF_ABSENT = 1002 ;
8386
8487 /** */
85- private static final short OP_REGISTER_BINARY_TYPE_NAME = 5 ;
88+ private static final short OP_CACHE_GET_ALL = 1003 ;
8689
8790 /** */
88- private static final short OP_PUT_BINARY_TYPE = 6 ;
91+ private static final short OP_CACHE_PUT_ALL = 1004 ;
8992
9093 /** */
91- private static final short OP_QUERY_SCAN = 7 ;
94+ private static final short OP_CACHE_GET_AND_PUT = 1005 ;
9295
9396 /** */
94- private static final short OP_QUERY_SCAN_CURSOR_GET_PAGE = 8 ;
97+ private static final short OP_CACHE_GET_AND_REPLACE = 1006 ;
9598
9699 /** */
97- private static final short OP_RESOURCE_CLOSE = 9 ;
100+ private static final short OP_CACHE_GET_AND_REMOVE = 1007 ;
98101
99102 /** */
100- private static final short OP_CACHE_CONTAINS_KEY = 10 ;
103+ private static final short OP_CACHE_GET_AND_PUT_IF_ABSENT = 1008 ;
101104
102105 /** */
103- private static final short OP_CACHE_CONTAINS_KEYS = 11 ;
106+ private static final short OP_CACHE_REPLACE = 1009 ;
104107
105108 /** */
106- private static final short OP_CACHE_GET_ALL = 12 ;
109+ private static final short OP_CACHE_REPLACE_IF_EQUALS = 1010 ;
107110
108111 /** */
109- private static final short OP_CACHE_GET_AND_PUT = 13 ;
112+ private static final short OP_CACHE_CONTAINS_KEY = 1011 ;
110113
111114 /** */
112- private static final short OP_CACHE_GET_AND_REPLACE = 14 ;
115+ private static final short OP_CACHE_CONTAINS_KEYS = 1012 ;
113116
114117 /** */
115- private static final short OP_CACHE_GET_AND_REMOVE = 15 ;
118+ private static final short OP_CACHE_CLEAR = 1013 ;
116119
117120 /** */
118- private static final short OP_CACHE_PUT_IF_ABSENT = 16 ;
121+ private static final short OP_CACHE_CLEAR_KEY = 1014 ;
119122
120123 /** */
121- private static final short OP_CACHE_GET_AND_PUT_IF_ABSENT = 17 ;
124+ private static final short OP_CACHE_CLEAR_KEYS = 1015 ;
122125
123126 /** */
124- private static final short OP_CACHE_REPLACE = 18 ;
127+ private static final short OP_CACHE_REMOVE_KEY = 1016 ;
125128
126129 /** */
127- private static final short OP_CACHE_REPLACE_IF_EQUALS = 19 ;
130+ private static final short OP_CACHE_REMOVE_IF_EQUALS = 1017 ;
128131
129132 /** */
130- private static final short OP_CACHE_PUT_ALL = 20 ;
133+ private static final short OP_CACHE_REMOVE_KEYS = 1018 ;
131134
132135 /** */
133- private static final short OP_CACHE_CLEAR = 21 ;
136+ private static final short OP_CACHE_REMOVE_ALL = 1019 ;
134137
135138 /** */
136- private static final short OP_CACHE_CLEAR_KEY = 22 ;
139+ private static final short OP_CACHE_GET_SIZE = 1020 ;
137140
141+ /* Cache create / destroy, configuration. */
138142 /** */
139- private static final short OP_CACHE_CLEAR_KEYS = 23 ;
143+ private static final short OP_CACHE_GET_NAMES = 1050 ;
140144
141145 /** */
142- private static final short OP_CACHE_REMOVE_KEY = 24 ;
146+ private static final short OP_CACHE_CREATE_WITH_NAME = 1051 ;
143147
144148 /** */
145- private static final short OP_CACHE_REMOVE_IF_EQUALS = 25 ;
149+ private static final short OP_CACHE_GET_OR_CREATE_WITH_NAME = 1052 ;
146150
147151 /** */
148- private static final short OP_CACHE_GET_SIZE = 26 ;
152+ private static final short OP_CACHE_CREATE_WITH_CONFIGURATION = 1053 ;
149153
150154 /** */
151- private static final short OP_CACHE_REMOVE_KEYS = 27 ;
155+ private static final short OP_CACHE_GET_OR_CREATE_WITH_CONFIGURATION = 1054 ;
152156
153157 /** */
154- private static final short OP_CACHE_REMOVE_ALL = 28 ;
158+ private static final short OP_CACHE_GET_CONFIGURATION = 1055 ;
155159
156160 /** */
157- private static final short OP_CACHE_CREATE_WITH_NAME = 29 ;
161+ private static final short OP_CACHE_DESTROY = 1056 ;
158162
163+ /* Query operations. */
159164 /** */
160- private static final short OP_CACHE_GET_OR_CREATE_WITH_NAME = 30 ;
165+ private static final short OP_QUERY_SCAN = 2000 ;
161166
162167 /** */
163- private static final short OP_CACHE_DESTROY = 31 ;
168+ private static final short OP_QUERY_SCAN_CURSOR_GET_PAGE = 2001 ;
164169
165170 /** */
166- private static final short OP_CACHE_GET_NAMES = 32 ;
171+ private static final short OP_QUERY_SQL = 2002 ;
167172
168173 /** */
169- private static final short OP_CACHE_GET_CONFIGURATION = 33 ;
174+ private static final short OP_QUERY_SQL_CURSOR_GET_PAGE = 2003 ;
170175
171176 /** */
172- private static final short OP_CACHE_CREATE_WITH_CONFIGURATION = 34 ;
177+ private static final short OP_QUERY_SQL_FIELDS = 2004 ;
173178
174179 /** */
175- private static final short OP_CACHE_GET_OR_CREATE_WITH_CONFIGURATION = 35 ;
180+ private static final short OP_QUERY_SQL_FIELDS_CURSOR_GET_PAGE = 2005 ;
176181
182+ /* Binary metadata operations. */
177183 /** */
178- private static final short OP_QUERY_SQL = 36 ;
184+ private static final short OP_BINARY_TYPE_NAME_GET = 3000 ;
179185
180186 /** */
181- private static final short OP_QUERY_SQL_CURSOR_GET_PAGE = 37 ;
187+ private static final short OP_BINARY_TYPE_NAME_PUT = 3001 ;
182188
183189 /** */
184- private static final short OP_QUERY_SQL_FIELDS = 38 ;
190+ private static final short OP_BINARY_TYPE_GET = 3002 ;
185191
186192 /** */
187- private static final short OP_QUERY_SQL_FIELDS_CURSOR_GET_PAGE = 39 ;
193+ private static final short OP_BINARY_TYPE_PUT = 3003 ;
188194
189195 /** Marshaller. */
190196 private final GridBinaryMarshaller marsh ;
@@ -206,7 +212,10 @@ public class ClientMessageParser implements ClientListenerMessageParser {
206212 assert msg != null ;
207213
208214 BinaryInputStream inStream = new BinaryHeapInputStream (msg );
209- BinaryRawReaderEx reader = marsh .reader (inStream );
215+
216+ // skipHdrCheck must be true (we have 103 op code).
217+ BinaryRawReaderEx reader = new BinaryReaderExImpl (marsh .context (), inStream ,
218+ null , null , true , true );
210219
211220 return decode (reader );
212221 }
@@ -224,19 +233,19 @@ public ClientListenerRequest decode(BinaryRawReaderEx reader) {
224233 case OP_CACHE_GET :
225234 return new ClientCacheGetRequest (reader );
226235
227- case OP_GET_BINARY_TYPE_NAME :
236+ case OP_BINARY_TYPE_NAME_GET :
228237 return new ClientBinaryTypeNameGetRequest (reader );
229238
230- case OP_GET_BINARY_TYPE :
239+ case OP_BINARY_TYPE_GET :
231240 return new ClientBinaryTypeGetRequest (reader );
232241
233242 case OP_CACHE_PUT :
234243 return new ClientCachePutRequest (reader );
235244
236- case OP_REGISTER_BINARY_TYPE_NAME :
245+ case OP_BINARY_TYPE_NAME_PUT :
237246 return new ClientBinaryTypeNamePutRequest (reader );
238247
239- case OP_PUT_BINARY_TYPE :
248+ case OP_BINARY_TYPE_PUT :
240249 return new ClientBinaryTypePutRequest (reader );
241250
242251 case OP_QUERY_SCAN :
0 commit comments