You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by heytitle <gi...@git.apache.org> on 2017/05/06 22:25:18 UTC

[GitHub] flink pull request #3511: [Flink-5734] code generation for normalizedkey sor...

Github user heytitle commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3511#discussion_r115130267
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/NormalizedKeySorter.java ---
    @@ -47,61 +47,61 @@
     	
     	public static final int MAX_NORMALIZED_KEY_LEN_PER_ELEMENT = 8;
     	
    -	private static final int MIN_REQUIRED_BUFFERS = 3;
    +	public static final int MIN_REQUIRED_BUFFERS = 3;
     	
    -	private static final int LARGE_RECORD_THRESHOLD = 10 * 1024 * 1024;
    +	public static final int LARGE_RECORD_THRESHOLD = 10 * 1024 * 1024;
     	
    -	private static final long LARGE_RECORD_TAG = 1L << 63;
    +	public static final long LARGE_RECORD_TAG = 1L << 63;
     	
    -	private static final long POINTER_MASK = LARGE_RECORD_TAG - 1;
    +	public static final long POINTER_MASK = LARGE_RECORD_TAG - 1;
     
    --- End diff --
    
    The reason `public` is used here because `Janino` first check accessibility of these variables and it seems not able to access them when `protected` is used and it throws the error below.
    ```
    org.codehaus.commons.compiler.CompileException: Field "LARGE_RECORD_THRESHOLD" is not accessible
    
    	at org.codehaus.janino.ReflectionIClass$ReflectionIField.getConstantValue(ReflectionIClass.java:340)
    	at org.codehaus.janino.UnitCompiler.getConstantValue2(UnitCompiler.java:4433)
    	at org.codehaus.janino.UnitCompiler.access$10000(UnitCompiler.java:182)
    	at org.codehaus.janino.UnitCompiler$11.visitFieldAccess(UnitCompiler.java:4407)
    	at org.codehaus.janino.Java$FieldAccess.accept(Java.java:3229)
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---