@@ -161,31 +161,39 @@ private byte[] parseBitMap(long bitLen, List<String> aggColumnNames, List<String
161161 */
162162 @ Override
163163 public Object decode (ByteBuf buf ) {
164- // 0. decode header
165- super .decode (buf );
166-
167- // 1. rowkey bitmap
168- rowKeyBitLen = Serialization .decodeVi64 (buf );
169- rowKeyBitMap = parseBitMap (rowKeyBitLen , aggRowKeyNames , rowKeyNames , buf );
170-
171- // 2. rowkey obobj
172- int len = (int ) Serialization .decodeVi64 (buf );
173- for (int i = 0 ; i < len ; i ++) {
174- ObObj obj = new ObObj ();
175- ObTableSerialUtil .decode (buf , obj );
176- rowkey .add (obj );
177- }
164+ int rowkeyLen = 0 ;
165+ int propLen = 0 ;
166+ try {
167+ // 0. decode header
168+ super .decode (buf );
169+
170+ // 1. rowkey bitmap
171+ rowKeyBitLen = Serialization .decodeVi64 (buf );
172+ rowKeyBitMap = parseBitMap (rowKeyBitLen , aggRowKeyNames , rowKeyNames , buf );
173+
174+ // 2. rowkey obobj
175+ rowkeyLen = (int ) Serialization .decodeVi64 (buf );
176+ for (int i = 0 ; i < rowkeyLen ; i ++) {
177+ ObObj obj = new ObObj ();
178+ ObTableSerialUtil .decode (buf , obj );
179+ rowkey .add (obj );
180+ }
178181
179- // 3. properties bitmap
180- propertiesBitLen = Serialization .decodeVi64 (buf );
181- propertiesBitMap = parseBitMap (propertiesBitLen , aggPropertiesNames , propertiesNames , buf );
182+ // 3. properties bitmap
183+ propertiesBitLen = Serialization .decodeVi64 (buf );
184+ propertiesBitMap = parseBitMap (propertiesBitLen , aggPropertiesNames , propertiesNames , buf );
182185
183- // 4. properties obobj
184- len = (int ) Serialization .decodeVi64 (buf );
185- for (int i = 0 ; i < len ; i ++) {
186- ObObj obj = new ObObj ();
187- ObTableSerialUtil .decode (buf , obj );
188- propertiesValues .add (obj );
186+ // 4. properties obobj
187+ propLen = (int ) Serialization .decodeVi64 (buf );
188+ for (int i = 0 ; i < propLen ; i ++) {
189+ ObObj obj = new ObObj ();
190+ ObTableSerialUtil .decode (buf , obj );
191+ propertiesValues .add (obj );
192+ }
193+ } catch (Exception e ) {
194+ String errMsg = String .format ("ObTableSingleOpEntity decode exception: rowkeyBitLen=%d, rowkeyLen=%d, propertiesBitLen=%d, propertiesLen=%d"
195+ , rowKeyBitLen , rowkeyLen , propertiesBitLen , propLen );
196+ throw new IllegalArgumentException (errMsg + ", cause: " + e .getMessage (), e );
189197 }
190198
191199 return this ;
0 commit comments