[ 
https://issues.apache.org/jira/browse/BEAM-6276?focusedWorklogId=177560&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-177560
 ]

ASF GitHub Bot logged work on BEAM-6276:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Dec/18 15:42
            Start Date: 20/Dec/18 15:42
    Worklog Time Spent: 10m 
      Work Description: reuvenlax closed pull request #7331: [BEAM-6276] Fix 
performance regression.
URL: https://github.com/apache/beam/pull/7331
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/FieldValueTypeInformation.java
 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/FieldValueTypeInformation.java
index 593853ffef29..f731f6f58844 100644
--- 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/FieldValueTypeInformation.java
+++ 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/FieldValueTypeInformation.java
@@ -44,6 +44,9 @@
   /** Returns the field type. */
   public abstract TypeDescriptor getType();
 
+  /** Returns the raw class type. */
+  public abstract Class getRawType();
+
   @Nullable
   public abstract Field getField();
 
@@ -72,6 +75,8 @@
 
     public abstract Builder setType(TypeDescriptor type);
 
+    public abstract Builder setRawType(Class type);
+
     public abstract Builder setField(@Nullable Field field);
 
     public abstract Builder setMethod(@Nullable Method method);
@@ -86,10 +91,12 @@
   }
 
   public static FieldValueTypeInformation forField(Field field) {
+    TypeDescriptor type = TypeDescriptor.of(field.getGenericType());
     return new AutoValue_FieldValueTypeInformation.Builder()
         .setName(field.getName())
         .setNullable(field.isAnnotationPresent(Nullable.class))
-        .setType(TypeDescriptor.of(field.getGenericType()))
+        .setType(type)
+        .setRawType(type.getRawType())
         .setField(field)
         .setElementType(getArrayComponentType(field))
         .setMapKeyType(getMapKeyType(field))
@@ -113,6 +120,7 @@ public static FieldValueTypeInformation forGetter(Method 
method) {
         .setName(name)
         .setNullable(nullable)
         .setType(type)
+        .setRawType(type.getRawType())
         .setMethod(method)
         .setElementType(getArrayComponentType(type))
         .setMapKeyType(getMapKeyType(type))
@@ -137,6 +145,7 @@ public static FieldValueTypeInformation forSetter(Method 
method) {
         .setName(name)
         .setNullable(nullable)
         .setType(type)
+        .setRawType(type.getRawType())
         .setMethod(method)
         .setElementType(getArrayComponentType(type))
         .setMapKeyType(getMapKeyType(type))
@@ -173,10 +182,6 @@ private static Type getArrayComponentType(TypeDescriptor 
valueType) {
     return null;
   }
 
-  public Class getRawType() {
-    return getType().getRawType();
-  }
-
   // If the Field is a map type, returns the key type, otherwise returns a 
null reference.
   @Nullable
   private static Type getMapKeyType(Field field) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 177560)
    Time Spent: 1h 10m  (was: 1h)

> Performance regression caused by extra calls to TypeDescriptor.getRawType
> -------------------------------------------------------------------------
>
>                 Key: BEAM-6276
>                 URL: https://issues.apache.org/jira/browse/BEAM-6276
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Reuven Lax
>            Assignee: Kenneth Knowles
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to