[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-11-21 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r235613442
 
 

 ##
 File path: contrib/storage-jdbc/pom.xml
 ##
 @@ -104,7 +104,7 @@
 
 org.apache.maven.plugins
 maven-failsafe-plugin
-2.18.1
+2.22.0
 
 
 Review comment:
   @vvysotskyi , done


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-09-03 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r214607655
 
 

 ##
 File path: pom.xml
 ##
 @@ -734,6 +735,9 @@
   -Djava.net.preferIPv4Stack=true
   -Djava.awt.headless=true
   -XX:+CMSClassUnloadingEnabled -ea
+  -Djdk.attach.allowAttachSelf=true
+  -Duser.language=en
 
 Review comment:
   This tests fails on non-english locale. Main reason is a decimal and 
thousand separator char.
   https://drill.apache.org/docs/compiling-drill-from-source/ - I don't see any 
requirements about locale in documentaion. Maybe it must be an another Bug+PR ?
   
   TestDurationFormat.testCompactSecMillis:58->validateDurationFormat:43 
expected:<4[,]545s> but was:<4[.]545s>
   TestDurationFormat.testCompactTwoDigitMilliSec:48->validateDurationFormat:43 
expected:<0[,]045s> but was:<0[.]045s>
   TestFunctionsQuery.testToCharFunction:534 »  After matching 0 records, did 
not...
   TestSelectivity.testFilterSelectivityOptions » UserRemote PARSE ERROR: 
Encount...
   
TestVarDecimalFunctions.testCastDecimalDouble:680->BaseTestQuery.testRunAndReturn:341
 » Rpc
   
TestVarDecimalFunctions.testCastDoubleDecimal:650->BaseTestQuery.testRunAndReturn:341
 » Rpc
   TestVarDecimalFunctions.testDecimalToChar:731 »  at position 0 column '`s1`' 
m...
   TestTopNSchemaChanges.testMissingColumn:192 »  
org.apache.drill.common.excepti...
   TestTopNSchemaChanges.testNumericTypes:82 »  
org.apache.drill.common.exception...
   TestTopNSchemaChanges.testUnionTypes:162 »  
org.apache.drill.common.exceptions...
   
TestMergeJoinWithSchemaChanges.testNumericStringTypes:192->BaseTestQuery.testRunAndReturn:341
 » Rpc
   
TestMergeJoinWithSchemaChanges.testNumericTypes:114->BaseTestQuery.testRunAndReturn:341
 » Rpc
   
TestMergeJoinWithSchemaChanges.testOneSideSchemaChanges:348->BaseTestQuery.testRunAndReturn:341
 » Rpc
   TestExternalSort.testNumericTypesLegacy:49->testNumericTypes:113 »  
org.apache...
   TestExternalSort.testNumericTypesManaged:44->testNumericTypes:113 »  
org.apach...
   TestImageRecordReader.testAviImage:101->createAndQuery:50 »  at position 0 
col...
   TestImageRecordReader.testBmpImage:56->createAndQuery:50 »  at position 0 
colu...
   TestImageRecordReader.testEpsImage:121->createAndQuery:50 »  at position 0 
col...
   TestImageRecordReader.testJpegImage:71->createAndQuery:50 »  at position 0 
col...
   TestImageRecordReader.testMovImage:111->createAndQuery:50 »  at position 0 
col...
   TestImageRecordReader.testPngImage:81->createAndQuery:50 »  at position 0 
colu...
   TestImageRecordReader.testPsdImage:86->createAndQuery:50 »  at position 0 
colu...
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-09-03 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r214607655
 
 

 ##
 File path: pom.xml
 ##
 @@ -734,6 +735,9 @@
   -Djava.net.preferIPv4Stack=true
   -Djava.awt.headless=true
   -XX:+CMSClassUnloadingEnabled -ea
+  -Djdk.attach.allowAttachSelf=true
+  -Duser.language=en
 
 Review comment:
   This tests fails on non-english locale. Main reason is a decimal and 
thousand separator char.
   https://drill.apache.org/docs/compiling-drill-from-source/ - I don't see any 
requirements about locale in documentaion. Maybe it must be an another Bug+PR ?
   
   **TestDurationFormat.testCompactSecMillis:58->validateDurationFormat:43 
expected:<4[,]545s> but was:<4[.]545s>
   TestDurationFormat.testCompactTwoDigitMilliSec:48->validateDurationFormat:43 
expected:<0[,]045s> but was:<0[.]045s>
   TestFunctionsQuery.testToCharFunction:534 »  After matching 0 records, did 
not...
   TestSelectivity.testFilterSelectivityOptions » UserRemote PARSE ERROR: 
Encount...
   
TestVarDecimalFunctions.testCastDecimalDouble:680->BaseTestQuery.testRunAndReturn:341
 » Rpc
   
TestVarDecimalFunctions.testCastDoubleDecimal:650->BaseTestQuery.testRunAndReturn:341
 » Rpc
   TestVarDecimalFunctions.testDecimalToChar:731 »  at position 0 column '`s1`' 
m...
   TestTopNSchemaChanges.testMissingColumn:192 »  
org.apache.drill.common.excepti...
   TestTopNSchemaChanges.testNumericTypes:82 »  
org.apache.drill.common.exception...
   TestTopNSchemaChanges.testUnionTypes:162 »  
org.apache.drill.common.exceptions...
   
TestMergeJoinWithSchemaChanges.testNumericStringTypes:192->BaseTestQuery.testRunAndReturn:341
 » Rpc
   
TestMergeJoinWithSchemaChanges.testNumericTypes:114->BaseTestQuery.testRunAndReturn:341
 » Rpc
   
TestMergeJoinWithSchemaChanges.testOneSideSchemaChanges:348->BaseTestQuery.testRunAndReturn:341
 » Rpc
   TestExternalSort.testNumericTypesLegacy:49->testNumericTypes:113 »  
org.apache...
   TestExternalSort.testNumericTypesManaged:44->testNumericTypes:113 »  
org.apach...
   TestImageRecordReader.testAviImage:101->createAndQuery:50 »  at position 0 
col...
   TestImageRecordReader.testBmpImage:56->createAndQuery:50 »  at position 0 
colu...
   TestImageRecordReader.testEpsImage:121->createAndQuery:50 »  at position 0 
col...
   TestImageRecordReader.testJpegImage:71->createAndQuery:50 »  at position 0 
col...
   TestImageRecordReader.testMovImage:111->createAndQuery:50 »  at position 0 
col...
   TestImageRecordReader.testPngImage:81->createAndQuery:50 »  at position 0 
colu...
   TestImageRecordReader.testPsdImage:86->createAndQuery:50 »  at position 0 
colu...**
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-31 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r214403360
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
 ##
 @@ -180,7 +180,7 @@ protected void createPartitionSublists() {
 
 // build a list of DFSDirPartitionLocation.
 for (final List dirs : dirToFileMap.keySet()) {
-  locations.add( new DFSDirPartitionLocation((String [])dirs.toArray(), 
dirToFileMap.get(dirs)));
+  locations.add( new DFSDirPartitionLocation(dirs.toArray(new 
String[dirs.size()]), dirToFileMap.get(dirs)));
 
 Review comment:
   https://bugs.java.com/view_bug.do?bug_id=6260652
   Result type of Arrays.ArrayList::toArray() was changed from T[] to Object[] 
in JDK 9+.
   So, FileSystemPartitionDescriptor::createPartitionSublists() doesn't work if 
Drill running on JDK9+. 
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-31 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r214403360
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
 ##
 @@ -180,7 +180,7 @@ protected void createPartitionSublists() {
 
 // build a list of DFSDirPartitionLocation.
 for (final List dirs : dirToFileMap.keySet()) {
-  locations.add( new DFSDirPartitionLocation((String [])dirs.toArray(), 
dirToFileMap.get(dirs)));
+  locations.add( new DFSDirPartitionLocation(dirs.toArray(new 
String[dirs.size()]), dirToFileMap.get(dirs)));
 
 Review comment:
   https://bugs.java.com/view_bug.do?bug_id=6260652
   Result type of Arrays.ArrayList::toArray() was changed from T[] to Object[] 
in JDK 9+.
   So, FileSystemPartitionDescriptor::createPartitionSublists() doesn't work if 
Drill running under JDK9+. 
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-31 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r214403360
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
 ##
 @@ -180,7 +180,7 @@ protected void createPartitionSublists() {
 
 // build a list of DFSDirPartitionLocation.
 for (final List dirs : dirToFileMap.keySet()) {
-  locations.add( new DFSDirPartitionLocation((String [])dirs.toArray(), 
dirToFileMap.get(dirs)));
+  locations.add( new DFSDirPartitionLocation(dirs.toArray(new 
String[dirs.size()]), dirToFileMap.get(dirs)));
 
 Review comment:
   https://bugs.java.com/view_bug.do?bug_id=6260652
   Result type of Arrays.ArrayList::toArray() was changed from T[] to Object[] 
in JDK 9+.
   So, test fails, then it's running under JDK9+. 
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-31 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r214403360
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
 ##
 @@ -180,7 +180,7 @@ protected void createPartitionSublists() {
 
 // build a list of DFSDirPartitionLocation.
 for (final List dirs : dirToFileMap.keySet()) {
-  locations.add( new DFSDirPartitionLocation((String [])dirs.toArray(), 
dirToFileMap.get(dirs)));
+  locations.add( new DFSDirPartitionLocation(dirs.toArray(new 
String[dirs.size()]), dirToFileMap.get(dirs)));
 
 Review comment:
   Test fails, when Drill builds on JDK10. Reason: Arrays.ArrayList.toArray() 
returns Object[] instead of String[] and cast fails.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-31 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r214406316
 
 

 ##
 File path: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ##
 @@ -375,6 +375,11 @@ else if (NullPointerException.class == cause.getClass()
 
 public void testAllMethods() {
   for (Method method : jdbcIntf.getMethods()) {
+if (method.isDefault()) {
 
 Review comment:
   Some method was added in JDBC 4.3 API
   Additional information:
   
https://jcp.org/aboutJava/communityprocess/maintenance/jsr221/JDBC4.3MR-January2017.pdf
   6. java.sql.Connection changes
   8. java.sql.DatabaseMetaData changes
   12. java.sql.Statement changes


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-31 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r214403360
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
 ##
 @@ -180,7 +180,7 @@ protected void createPartitionSublists() {
 
 // build a list of DFSDirPartitionLocation.
 for (final List dirs : dirToFileMap.keySet()) {
-  locations.add( new DFSDirPartitionLocation((String [])dirs.toArray(), 
dirToFileMap.get(dirs)));
+  locations.add( new DFSDirPartitionLocation(dirs.toArray(new 
String[dirs.size()]), dirToFileMap.get(dirs)));
 
 Review comment:
   Test fails, when Drill builds on JDK10. Reason: Arrays.ArrayList.toArray() 
returns Object[] instead of String[] and cast not work.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-29 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213628920
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/JarBuilder.java
 ##
 @@ -69,6 +69,8 @@ public String build(String jarName, String buildDirectory, 
String includeFiles,
   List params = new LinkedList<>();
   params.add("clean");
   params.add("package");
+  params.add("-Dmaven.compiler.source=1.8");
 
 Review comment:
   fixed


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-29 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213387093
 
 

 ##
 File path: pom.xml
 ##
 @@ -733,6 +734,11 @@
   -Djava.net.preferIPv4Stack=true
   -Djava.awt.headless=true
   -XX:+CMSClassUnloadingEnabled -ea
+  -XX:+IgnoreUnrecognizedVMOptions
+  "--add-modules java.se"
+  -Djdk.attach.allowAttachSelf=true
+  -Duser.language=en
 
 Review comment:
   -Djdk.attach.allowAttachSelf=true - for jmockit (more info: 
https://bugs.java.com/view_bug.do?bug_id=8180425)
   -Duser.language=en - format tests fails on non-english system locale
   -XX:+IgnoreUnrecognizedVMOptions  "--add-modules java.se" - revalidate it 
tomorrow


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-29 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213610309
 
 

 ##
 File path: 
common/src/main/java/org/apache/drill/common/util/DrillPlatformDependent.java
 ##
 @@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.common.util;
+
+import io.netty.util.internal.PlatformDependent;
+
+import java.lang.reflect.Method;
+
+public class DrillPlatformDependent {
+  private final static long MAX_DIRECT_MEMORY = maxDirectMemory0();
+
+  public static long maxDirectMemory() {
+return MAX_DIRECT_MEMORY;
+  }
+
+
+  private static long maxDirectMemory0() {
 
 Review comment:
   netty `PlatformDependent` and `jdk.internal.misc.VM` returns same value for 
maxDirectMemory, so i remove my custom class


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-29 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213608768
 
 

 ##
 File path: pom.xml
 ##
 @@ -733,6 +734,11 @@
   -Djava.net.preferIPv4Stack=true
   -Djava.awt.headless=true
   -XX:+CMSClassUnloadingEnabled -ea
+  -XX:+IgnoreUnrecognizedVMOptions
+  "--add-modules java.se"
+  -Djdk.attach.allowAttachSelf=true
+  -Duser.language=en
 
 Review comment:
   http://openjdk.java.net/jeps/261 - java.se module available by default  for 
unnamed modules, so `-XX:+IgnoreUnrecognizedVMOptions "--add-modules java.se" ` 
can be removed


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-28 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213392442
 
 

 ##
 File path: 
common/src/main/java/org/apache/drill/common/util/DrillPlatformDependent.java
 ##
 @@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.common.util;
+
+import io.netty.util.internal.PlatformDependent;
+
+import java.lang.reflect.Method;
+
+public class DrillPlatformDependent {
+  private final static long MAX_DIRECT_MEMORY = maxDirectMemory0();
+
+  public static long maxDirectMemory() {
+return MAX_DIRECT_MEMORY;
+  }
+
+
+  private static long maxDirectMemory0() {
 
 Review comment:
   Looks like it can cause OOM:
   In Drill version of `PooledByteBufAllocatorL` exists a reflective access to 
`PooledByteBufAllocator.directArenas` field. 
   It's size depends on 
   ` DEFAULT_NUM_DIRECT_ARENA = Math.max(0,
   SystemPropertyUtil.getInt(
   "io.netty.allocator.numDirectArenas",
   (int) Math.min(
   defaultMinNumArena,
   PlatformDependent.maxDirectMemory() / 
defaultChunkSize / 2 / 3)));`
   
   Should i use a netty `PlatformDependent`, or "override" it (as 
`PooledByteBufAllocatorL`) ?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-28 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213392442
 
 

 ##
 File path: 
common/src/main/java/org/apache/drill/common/util/DrillPlatformDependent.java
 ##
 @@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.common.util;
+
+import io.netty.util.internal.PlatformDependent;
+
+import java.lang.reflect.Method;
+
+public class DrillPlatformDependent {
+  private final static long MAX_DIRECT_MEMORY = maxDirectMemory0();
+
+  public static long maxDirectMemory() {
+return MAX_DIRECT_MEMORY;
+  }
+
+
+  private static long maxDirectMemory0() {
 
 Review comment:
   Looks like it can cause OOM:
   In Drill version of `PooledByteBufAllocatorL` exists a reflective access to 
`PooledByteBufAllocator.directArenas` field. 
   It's size depends on 
   ` DEFAULT_NUM_DIRECT_ARENA = Math.max(0,
   SystemPropertyUtil.getInt(
   "io.netty.allocator.numDirectArenas",
   (int) Math.min(
   defaultMinNumArena,
   *PlatformDependent.maxDirectMemory()* / 
defaultChunkSize / 2 / 3)));`
   
   Should i use a netty `PlatformDependent`, or "override" it (as 
`PooledByteBufAllocatorL`) ?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-28 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213392442
 
 

 ##
 File path: 
common/src/main/java/org/apache/drill/common/util/DrillPlatformDependent.java
 ##
 @@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.common.util;
+
+import io.netty.util.internal.PlatformDependent;
+
+import java.lang.reflect.Method;
+
+public class DrillPlatformDependent {
+  private final static long MAX_DIRECT_MEMORY = maxDirectMemory0();
+
+  public static long maxDirectMemory() {
+return MAX_DIRECT_MEMORY;
+  }
+
+
+  private static long maxDirectMemory0() {
 
 Review comment:
   Looks like it can cause OOM:
   In Drill version of `PooledByteBufAllocatorL` exists a reflective access to 
`PooledByteBufAllocator.directArenas` field. 
   It's size depends on 
   ` DEFAULT_NUM_DIRECT_ARENA = Math.max(0,
   SystemPropertyUtil.getInt(
   "io.netty.allocator.numDirectArenas",
   (int) Math.min(
   defaultMinNumArena,
   PlatformDependent.maxDirectMemory() / 
defaultChunkSize / 2 / 3)));`
   
   Should i use a netty `PlatformDependent`, or "override" it (as 
`PooledByteBufAllocatorL`) ?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-28 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213392442
 
 

 ##
 File path: 
common/src/main/java/org/apache/drill/common/util/DrillPlatformDependent.java
 ##
 @@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.common.util;
+
+import io.netty.util.internal.PlatformDependent;
+
+import java.lang.reflect.Method;
+
+public class DrillPlatformDependent {
+  private final static long MAX_DIRECT_MEMORY = maxDirectMemory0();
+
+  public static long maxDirectMemory() {
+return MAX_DIRECT_MEMORY;
+  }
+
+
+  private static long maxDirectMemory0() {
 
 Review comment:
   Looks like it can cause OOM:
   In Drill version of `PooledByteBufAllocatorL` exists a reflective access to 
`PooledByteBufAllocator.directArenas` field. It's size depends on 
   ` DEFAULT_NUM_DIRECT_ARENA = Math.max(0,
   SystemPropertyUtil.getInt(
   "io.netty.allocator.numDirectArenas",
   (int) Math.min(
   defaultMinNumArena,
   PlatformDependent.maxDirectMemory() / 
defaultChunkSize / 2 / 3)));`
   
   Should i use a netty `PlatformDependent`, or "override" it (as 
`PooledByteBufAllocatorL`) ?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-28 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213392442
 
 

 ##
 File path: 
common/src/main/java/org/apache/drill/common/util/DrillPlatformDependent.java
 ##
 @@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.common.util;
+
+import io.netty.util.internal.PlatformDependent;
+
+import java.lang.reflect.Method;
+
+public class DrillPlatformDependent {
+  private final static long MAX_DIRECT_MEMORY = maxDirectMemory0();
+
+  public static long maxDirectMemory() {
+return MAX_DIRECT_MEMORY;
+  }
+
+
+  private static long maxDirectMemory0() {
 
 Review comment:
   Looks like it can cause OOM:
   In Drill version of `PooledByteBufAllocatorL` exists a reflective access to 
`PooledByteBufAllocator.directArenas` field. It's size depends on 
   ` DEFAULT_NUM_DIRECT_ARENA = Math.max(0,
   SystemPropertyUtil.getInt(
   "io.netty.allocator.numDirectArenas",
   (int) Math.min(
   defaultMinNumArena,
   PlatformDependent.maxDirectMemory() / 
defaultChunkSize / 2 / 3)));`


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-28 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213386245
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
 ##
 @@ -179,7 +179,7 @@ protected void createPartitionSublists() {
 
 // build a list of DFSDirPartitionLocation.
 for (final List dirs : dirToFileMap.keySet()) {
-  locations.add( new DFSDirPartitionLocation((String [])dirs.toArray(), 
dirToFileMap.get(dirs)));
+  locations.add( new DFSDirPartitionLocation(dirs.toArray(new String [0]), 
dirToFileMap.get(dirs)));
 
 Review comment:
   According to 
https://stackoverflow.com/questions/174093/toarraynew-myclass0-or-toarraynew-myclassmylist-size
 `.toArray(new T[0])` faster
   
   + https://github.com/naver/pinpoint/issues/4138


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-28 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213386245
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
 ##
 @@ -179,7 +179,7 @@ protected void createPartitionSublists() {
 
 // build a list of DFSDirPartitionLocation.
 for (final List dirs : dirToFileMap.keySet()) {
-  locations.add( new DFSDirPartitionLocation((String [])dirs.toArray(), 
dirToFileMap.get(dirs)));
+  locations.add( new DFSDirPartitionLocation(dirs.toArray(new String [0]), 
dirToFileMap.get(dirs)));
 
 Review comment:
   According to 
https://stackoverflow.com/questions/174093/toarraynew-myclass0-or-toarraynew-myclassmylist-size
 `.toArray(new T[0])` faster
   
   +https://github.com/naver/pinpoint/issues/4138


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-28 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213386245
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
 ##
 @@ -179,7 +179,7 @@ protected void createPartitionSublists() {
 
 // build a list of DFSDirPartitionLocation.
 for (final List dirs : dirToFileMap.keySet()) {
-  locations.add( new DFSDirPartitionLocation((String [])dirs.toArray(), 
dirToFileMap.get(dirs)));
+  locations.add( new DFSDirPartitionLocation(dirs.toArray(new String [0]), 
dirToFileMap.get(dirs)));
 
 Review comment:
   According to 
https://stackoverflow.com/questions/174093/toarraynew-myclass0-or-toarraynew-myclassmylist-size
 `.toArray(new T[0])` faster
   
   + https://github.com/naver/pinpoint/issues/4138


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-28 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213387093
 
 

 ##
 File path: pom.xml
 ##
 @@ -733,6 +734,11 @@
   -Djava.net.preferIPv4Stack=true
   -Djava.awt.headless=true
   -XX:+CMSClassUnloadingEnabled -ea
+  -XX:+IgnoreUnrecognizedVMOptions
+  "--add-modules java.se"
+  -Djdk.attach.allowAttachSelf=true
+  -Duser.language=en
 
 Review comment:
   -Djdk.attach.allowAttachSelf=true - for jmockit
   -Duser.language=en - format tests fails on non-english system locale
   -XX:+IgnoreUnrecognizedVMOptions  "--add-modules java.se" - revalidate it 
tomorrow


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-28 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213386245
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
 ##
 @@ -179,7 +179,7 @@ protected void createPartitionSublists() {
 
 // build a list of DFSDirPartitionLocation.
 for (final List dirs : dirToFileMap.keySet()) {
-  locations.add( new DFSDirPartitionLocation((String [])dirs.toArray(), 
dirToFileMap.get(dirs)));
+  locations.add( new DFSDirPartitionLocation(dirs.toArray(new String [0]), 
dirToFileMap.get(dirs)));
 
 Review comment:
   According to 
https://stackoverflow.com/questions/174093/toarraynew-myclass0-or-toarraynew-myclassmylist-size
 `.toArray(new T[0])` faster


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM

2018-08-28 Thread GitBox
oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill 
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213346042
 
 

 ##
 File path: 
common/src/main/java/org/apache/drill/common/util/DrillPlatformDependent.java
 ##
 @@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.common.util;
+
+import io.netty.util.internal.PlatformDependent;
+
+import java.lang.reflect.Method;
+
+public class DrillPlatformDependent {
+  private final static long MAX_DIRECT_MEMORY = maxDirectMemory0();
+
+  public static long maxDirectMemory() {
+return MAX_DIRECT_MEMORY;
+  }
+
+
+  private static long maxDirectMemory0() {
 
 Review comment:
   netty PlatformDependent do not try to access jdk.internal.misc.VM.
   By "copy-paste" i mean only a method name


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:
us...@infra.apache.org


With regards,
Apache Git Services