@@ -236,25 +236,19 @@ public void decode(ByteBuf buf, ObObj obj) {
236236 }
237237
238238 public static ObTableObjType getTableObjType (ObObj obj ) {
239- ObTableObjType tableObjType = null ;
240- if (obj .getTableObjType () == ObTableInvalidType ) {
241- ObObjType objType = obj .getMeta ().getType ();
242- ObCollationType objCsType = obj .getMeta ().getCsType ();
243- tableObjType = objTableTypeMap .get (objType );
244- if (objType == ObObjType .ObVarcharType && objCsType == ObCollationType .CS_TYPE_BINARY ) {
245- tableObjType = ObTableObjType .ObTableVarbinaryType ;
246- } else if (objType == ObObjType .ObExtendType ) {
247- if (obj .isMinObj ()) {
248- tableObjType = ObTableObjType .ObTableMinType ;
249- } else if (obj .isMaxObj ()) {
250- tableObjType = ObTableObjType .ObTableMaxType ;
251- }
252- } else if (tableObjType == null ) {
253- throw new IllegalArgumentException ("Cannot get ObTableObjType, invalid ob obj type: " + objType );
239+ ObObjType objType = obj .getMeta ().getType ();
240+ ObCollationType objCsType = obj .getMeta ().getCsType ();
241+ ObTableObjType tableObjType = objTableTypeMap .get (objType );
242+ if (objType == ObObjType .ObVarcharType && objCsType == ObCollationType .CS_TYPE_BINARY ) {
243+ tableObjType = ObTableObjType .ObTableVarbinaryType ;
244+ } else if (objType == ObObjType .ObExtendType ) {
245+ if (obj .isMinObj ()) {
246+ tableObjType = ObTableObjType .ObTableMinType ;
247+ } else if (obj .isMaxObj ()) {
248+ tableObjType = ObTableObjType .ObTableMaxType ;
254249 }
255- obj .setTableObjType (tableObjType );
256- } else {
257- tableObjType = obj .getTableObjType ();
250+ } else if (tableObjType == null ) {
251+ throw new IllegalArgumentException ("Cannot get ObTableObjType, invalid ob obj type: " + objType );
258252 }
259253
260254 return tableObjType ;
@@ -337,15 +331,8 @@ public void decode(ByteBuf buf, ObObj obj) {
337331 }
338332
339333 public int getEncodedSize (ObObj obj ) {
340- int encodeSize = 0 ;
341- if (obj .getEncodeSizeCache () == -1 ) {
342- ObObjType objType = obj .getMeta ().getType ();
343- encodeSize = DEFAULT_TABLE_OBJ_TYPE_SIZE + objType .getEncodedSize (obj .getValue ());
344- obj .setEncodeSizeCache (encodeSize );
345- } else {
346- encodeSize = obj .getEncodeSizeCache ();
347- }
348- return encodeSize ;
334+ ObObjType objType = obj .getMeta ().getType ();
335+ return DEFAULT_TABLE_OBJ_TYPE_SIZE + objType .getEncodedSize (obj .getValue ());
349336 }
350337
351338 public byte [] encodeWithMeta (ObObj obj ) {
0 commit comments