Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill >> mail # dev >> [08/15] DRILL-334: Subdivide Drillbit control and data messages. Add support for socket backpressure. Add TopLevel and Child memory allocator with debug mode to capture memory leaks. Various memory leak fixes to get build to complete.


Copy link to this message
-
[08/15] DRILL-334: Subdivide Drillbit control and data messages. Add support for socket backpressure. Add TopLevel and Child memory allocator with debug mode to capture memory leaks. Various memory leak fixes to get build to complete.
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a0eabf63/exec/java-exec/src/main/java/org/apache/drill/exec/util/AtomicState.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/util/AtomicState.java b/exec/java-exec/src/main/java/org/apache/drill/exec/util/AtomicState.java
index f6653bc..2df199d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/util/AtomicState.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/util/AtomicState.java
@@ -19,8 +19,6 @@ package org.apache.drill.exec.util;
 
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.drill.exec.proto.ExecProtos.FragmentStatus.FragmentState;
-
 import com.google.protobuf.Internal.EnumLite;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a0eabf63/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BitVector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BitVector.java b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BitVector.java
index aa2826f..cbc8b86 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BitVector.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BitVector.java
@@ -68,7 +68,6 @@ public final class BitVector extends BaseDataValueVector implements FixedWidthVe
     valueCapacity = valueCount;
     int valueSize = getSizeFromCount(valueCount);
     data = allocator.buffer(valueSize);
-    this.data.retain();
     for (int i = 0; i < valueSize; i++) {
       data.setByte(i, 0);
     }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a0eabf63/exec/java-exec/src/main/java/org/apache/drill/exec/work/AbstractFragmentRunnerListener.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/work/AbstractFragmentRunnerListener.java b/exec/java-exec/src/main/java/org/apache/drill/exec/work/AbstractFragmentRunnerListener.java
deleted file mode 100644
index 58b6d08..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/work/AbstractFragmentRunnerListener.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * 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.exec.work;
-
-import org.apache.drill.exec.ops.FragmentContext;
-import org.apache.drill.exec.proto.ExecProtos.FragmentHandle;
-import org.apache.drill.exec.proto.ExecProtos.FragmentStatus;
-import org.apache.drill.exec.proto.ExecProtos.FragmentStatus.FragmentState;
-import org.apache.drill.exec.work.foreman.ErrorHelper;
-
-public abstract class AbstractFragmentRunnerListener implements FragmentRunnerListener{
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(AbstractFragmentRunnerListener.class);
-  
-  private FragmentContext context;
-  private volatile long startNanos;
-  
-  public AbstractFragmentRunnerListener(FragmentContext context) {
-    super();
-    this.context = context;
-  }
-  
-  private  FragmentStatus.Builder getBuilder(FragmentState state){
-    FragmentStatus.Builder status = FragmentStatus.newBuilder();
-    context.addMetricsToStatus(status);
-    status.setState(state);
-    status.setRunningTime(System.nanoTime() - startNanos);
-    status.setHandle(context.getHandle());
-    status.setMemoryUse(context.getAllocator().getAllocatedMemory());
-    return status;
-  }
-  
-  @Override
-  public void stateChanged(FragmentHandle handle, FragmentState newState) {
-    FragmentStatus.Builder status = getBuilder(newState);
-
-    switch(newState){
-    case AWAITING_ALLOCATION:
-      awaitingAllocation(handle, status);
-      break;
-    case CANCELLED:
-      cancelled(handle, status);
-      break;
-    case FAILED:
-      // no op since fail should have also been called.
-      break;
-    case FINISHED:
-      finished(handle, status);
-      break;
-    case RUNNING:
-      this.startNanos = System.nanoTime();
-      running(handle, status);
-      break;
-    case SENDING:
-      // no op.
-      break;
-    default:
-      break;
-    
-    }
-  }
-  
-  protected void awaitingAllocation(FragmentHandle handle, FragmentStatus.Builder statusBuilder){
-    statusChange(handle, statusBuilder.build());
-  }
-  
-  protected void running(FragmentHandle handle, FragmentStatus.Builder statusBuilder){
-    statusChange(handle, statusBuilder.build());
-  }
-
-  protected void cancelled(FragmentHandle handle, FragmentStatus.Builder statusBuilder){
-    statusChange(handle, statusBuilder.build());
-  }
-
-  protected void finished(FragmentHandle handle, FragmentStatus.Builder statusBuilder){
-    statusChange(handle, statusBuilder.build());
-  }
-  
-  protected abstract void statusChange(FragmentHandle handle, FragmentStatus status);
-
-  @Override
-  public final void fail(FragmentHandle handle, String message, Throwable excep) {
-    FragmentStatus.Builder status = getBuilder(FragmentState.FAILED);
-    status.setError(ErrorHelper.logAndConvertError(context.getIdentity(), message, excep, logger));
-    fail(handle, status);
-  }
-
-  protected void fail(Frag