You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ja...@apache.org on 2015/11/13 03:38:00 UTC
[30/45] drill git commit: DRILL-3987: (REFACTOR) Remove any parent
Drill dependencies for drill-memory-base.
DRILL-3987: (REFACTOR) Remove any parent Drill dependencies for drill-memory-base.
Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/a289fd94
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/a289fd94
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/a289fd94
Branch: refs/heads/master
Commit: a289fd941a33833524516dea1a3f75ea853aa055
Parents: 363bf33
Author: Jacques Nadeau <ja...@apache.org>
Authored: Sun Nov 8 09:09:05 2015 -0800
Committer: Jacques Nadeau <ja...@apache.org>
Committed: Thu Nov 12 17:00:48 2015 -0800
----------------------------------------------------------------------
exec/memory/base/pom.xml | 23 --------------------
.../netty/buffer/PooledByteBufAllocatorL.java | 15 ++++++++-----
.../netty/buffer/UnsafeDirectLittleEndian.java | 11 +++++++---
.../exec/exception/OutOfMemoryException.java | 3 +--
4 files changed, 19 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/drill/blob/a289fd94/exec/memory/base/pom.xml
----------------------------------------------------------------------
diff --git a/exec/memory/base/pom.xml b/exec/memory/base/pom.xml
index 6bfd29b..59f6a29 100644
--- a/exec/memory/base/pom.xml
+++ b/exec/memory/base/pom.xml
@@ -23,29 +23,6 @@
<dependencies>
<dependency>
- <groupId>org.apache.drill</groupId>
- <artifactId>drill-protocol</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.drill</groupId>
- <artifactId>drill-common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.drill</groupId>
- <artifactId>drill-common</artifactId>
- <version>${project.version}</version>
- <classifier>tests</classifier>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- <version>2.5.0</version>
- </dependency>
- <dependency>
<groupId>com.codahale.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>3.0.1</version>
http://git-wip-us.apache.org/repos/asf/drill/blob/a289fd94/exec/memory/base/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
----------------------------------------------------------------------
diff --git a/exec/memory/base/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java b/exec/memory/base/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
index 5809df5..2fc1bd0 100644
--- a/exec/memory/base/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
+++ b/exec/memory/base/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
@@ -23,9 +23,6 @@ import java.lang.reflect.Field;
import java.nio.ByteBuffer;
import java.util.concurrent.atomic.AtomicLong;
-import org.apache.drill.common.exceptions.DrillRuntimeException;
-import org.apache.drill.exec.util.AssertionUtil;
-
import com.codahale.metrics.Gauge;
import com.codahale.metrics.Histogram;
import com.codahale.metrics.Metric;
@@ -142,7 +139,7 @@ public class PooledByteBufAllocatorL extends PooledByteBufAllocator{
}
normalBuffersHist.update(buf.capacity());
- if (AssertionUtil.ASSERT_ENABLED) {
+ if (ASSERT_ENABLED) {
normalBufferSize.addAndGet(buf.capacity());
normalBufferCount.incrementAndGet();
}
@@ -228,7 +225,7 @@ public class PooledByteBufAllocatorL extends PooledByteBufAllocator{
normalBufferCount.set(0);
hugeBufferSize.set(0);
normalBufferSize.set(0);
- throw new DrillRuntimeException(buf.toString());
+ throw new IllegalStateException(buf.toString());
}
}
@@ -254,4 +251,12 @@ public class PooledByteBufAllocatorL extends PooledByteBufAllocator{
buf.append(" bytes.");
return buf.toString();
}
+
+ public static final boolean ASSERT_ENABLED;
+
+ static {
+ boolean isAssertEnabled = false;
+ assert isAssertEnabled = true;
+ ASSERT_ENABLED = isAssertEnabled;
+ }
}
http://git-wip-us.apache.org/repos/asf/drill/blob/a289fd94/exec/memory/base/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
----------------------------------------------------------------------
diff --git a/exec/memory/base/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java b/exec/memory/base/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
index 50a9a01..559f06d 100644
--- a/exec/memory/base/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
+++ b/exec/memory/base/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
@@ -23,8 +23,6 @@ import io.netty.util.internal.PlatformDependent;
import java.nio.ByteOrder;
import java.util.concurrent.atomic.AtomicLong;
-import org.apache.drill.exec.util.AssertionUtil;
-
public final class UnsafeDirectLittleEndian extends WrappedByteBuf {
private static final boolean NATIVE_ORDER = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN;
private final AbstractByteBuf wrapped;
@@ -43,7 +41,7 @@ public final class UnsafeDirectLittleEndian extends WrappedByteBuf {
this.bufferSize = bufferSize;
// initCap is used if we're tracking memory release. If we're in non-debug mode, we'll skip this.
- this.initCap = AssertionUtil.ASSERT_ENABLED ? capacity() : -1;
+ this.initCap = ASSERT_ENABLED ? capacity() : -1;
}
private UnsafeDirectLittleEndian(AbstractByteBuf buf, boolean fake) {
@@ -243,5 +241,12 @@ public final class UnsafeDirectLittleEndian extends WrappedByteBuf {
return released;
}
+ public static final boolean ASSERT_ENABLED;
+
+ static {
+ boolean isAssertEnabled = false;
+ assert isAssertEnabled = true;
+ ASSERT_ENABLED = isAssertEnabled;
+ }
}
http://git-wip-us.apache.org/repos/asf/drill/blob/a289fd94/exec/memory/base/src/main/java/org/apache/drill/exec/exception/OutOfMemoryException.java
----------------------------------------------------------------------
diff --git a/exec/memory/base/src/main/java/org/apache/drill/exec/exception/OutOfMemoryException.java b/exec/memory/base/src/main/java/org/apache/drill/exec/exception/OutOfMemoryException.java
index 17d099d..3fbae6d 100644
--- a/exec/memory/base/src/main/java/org/apache/drill/exec/exception/OutOfMemoryException.java
+++ b/exec/memory/base/src/main/java/org/apache/drill/exec/exception/OutOfMemoryException.java
@@ -17,9 +17,8 @@
*/
package org.apache.drill.exec.exception;
-import org.apache.drill.common.exceptions.DrillRuntimeException;
-public class OutOfMemoryException extends DrillRuntimeException {
+public class OutOfMemoryException extends RuntimeException {
private static final long serialVersionUID = -6858052345185793382L;
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(OutOfMemoryException.class);