belugabehr commented on a change in pull request #807:
URL: https://github.com/apache/hive/pull/807#discussion_r434678396



##########
File path: serde/src/java/org/apache/hadoop/hive/serde2/avro/InstanceCache.java
##########
@@ -51,20 +51,19 @@ public Instance retrieve(SeedObject hv) throws 
AvroSerdeException {
    * Retrieve (or create if it doesn't exist) the correct Instance for this
    * SeedObject using 'seenSchemas' to resolve circular references
    */
-  public synchronized Instance retrieve(SeedObject hv,
-      Set<SeedObject> seenSchemas) throws AvroSerdeException {
+  public Instance retrieve(SeedObject hv, Set<SeedObject> seenSchemas)
+    throws AvroSerdeException {
     if(LOG.isDebugEnabled()) LOG.debug("Checking for hv: " + hv.toString());

Review comment:
       Please change this (and the rest) to:
   `
   LOG.debug("Checking for hv: {}", hv);
   `
   http://www.slf4j.org/faq.html#logging_performance

##########
File path: serde/src/java/org/apache/hadoop/hive/serde2/avro/InstanceCache.java
##########
@@ -51,20 +51,19 @@ public Instance retrieve(SeedObject hv) throws 
AvroSerdeException {
    * Retrieve (or create if it doesn't exist) the correct Instance for this
    * SeedObject using 'seenSchemas' to resolve circular references
    */
-  public synchronized Instance retrieve(SeedObject hv,
-      Set<SeedObject> seenSchemas) throws AvroSerdeException {
+  public Instance retrieve(SeedObject hv, Set<SeedObject> seenSchemas)
+    throws AvroSerdeException {
     if(LOG.isDebugEnabled()) LOG.debug("Checking for hv: " + hv.toString());
 
     if(cache.containsKey(hv)) {

Review comment:
       Please leverage `Map#computeIfAbsent` here




----------------------------------------------------------------
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