kyoty opened a new pull request #32313:
URL: https://github.com/apache/spark/pull/32313


   ### What changes were proposed in this pull request?
   SImply the `getOperationType ` method.
   Introduce a `HashMap` to cache the existed enumeration types, so as to avoid 
 a linear search in a for loop.
   
   ### Why are the changes needed?
   
   `OperationType.getOperationType`  can be called in 
OperationHandler.constructor:
   ```java
   public OperationHandle(TOperationHandle tOperationHandle, TProtocolVersion 
protocol) {
       super(tOperationHandle.getOperationId());
       this.opType = 
OperationType.getOperationType(tOperationHandle.getOperationType());
       this.hasResultSet = tOperationHandle.isHasResultSet();
       this.protocol = protocol;
     }
   ```
   `OperationHandle ` is widely used, It's better to improve the execution 
efficiency of  `OperationType.getOperationType`
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Just a refractor, using Existing UTs
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to