Package org.apache.drill.exec.ops

Examples of org.apache.drill.exec.ops.OperatorContext


        return ordinal();
      }
    }

    public SingleSenderRootExec(FragmentContext context, RecordBatch batch, SingleSender config) throws OutOfMemoryException {
      super(context, new OperatorContext(config, context, null, false), config);
      //super(context, config);
      this.incoming = batch;
      assert(incoming != null);
      this.handle = context.getHandle();
      this.config = config;
View Full Code Here


  protected AbstractRecordBatch(T popConfig, FragmentContext context) throws OutOfMemoryException {
    super();
    this.context = context;
    this.popConfig = popConfig;
    this.oContext = new OperatorContext(popConfig, context, true);
    this.stats = oContext.getStats();
    this.container = new VectorContainer(this.oContext);
  }
View Full Code Here

    stats = fragmentContext1.getStats().getOperatorStats(def, fragmentContext1.getAllocator());


    // Add a couple of Operator Contexts
    // Initial allocation = 1000000 bytes for all operators
    OperatorContext oContext11 = new OperatorContext(physicalOperator1, fragmentContext1, true);
    DrillBuf b11=oContext11.getAllocator().buffer(1000000);

    OperatorContext oContext12 = new OperatorContext(physicalOperator2, fragmentContext1, stats, true);
    DrillBuf b12=oContext12.getAllocator().buffer(500000);

    OperatorContext oContext21 = new OperatorContext(physicalOperator3, fragmentContext2, true);

    def = new OpProfileDef(physicalOperator4.getOperatorId(), UserBitShared.CoreOperatorType.TEXT_WRITER_VALUE, OperatorContext.getChildCount(physicalOperator4));
    stats = fragmentContext2.getStats().getOperatorStats(def, fragmentContext2.getAllocator());
    OperatorContext oContext22 = new OperatorContext(physicalOperator4, fragmentContext2, stats, true);
    DrillBuf b22=oContext22.getAllocator().buffer(2000000);

    // New Fragment begins
    BitControl.PlanFragment.Builder pfBuilder3=BitControl.PlanFragment.newBuilder();
    pfBuilder3.setMemInitial(1000000);
    BitControl.PlanFragment pf3=pfBuilder3.build();

    FragmentContext fragmentContext3 = new FragmentContext(bitContext, pf3, null, functionRegistry);

    // New fragment starts an operator that allocates an amount within the limit
    def = new OpProfileDef(physicalOperator5.getOperatorId(), UserBitShared.CoreOperatorType.UNION_VALUE, OperatorContext.getChildCount(physicalOperator5));
    stats = fragmentContext3.getStats().getOperatorStats(def, fragmentContext3.getAllocator());
    OperatorContext oContext31 = new OperatorContext(physicalOperator5, fragmentContext3, stats, true);

    DrillBuf b31a = oContext31.getAllocator().buffer(200000);

    //Previously running operator completes
    b22.release();
    oContext22.close();

    // Fragment 3 asks for more and fails
    boolean outOfMem=false;
    try {
      DrillBuf b31b = oContext31.getAllocator().buffer(4400000);
      if(b31b!=null) {
        b31b.release();
      }else{
        outOfMem=true;
      }
    }catch(Exception e){
      outOfMem=true;
    }
    assertEquals(true, (boolean)outOfMem);

    // Operator is Exempt from Fragment limits. Fragment 3 asks for more and succeeds
    outOfMem=false;
    OperatorContext oContext32 = new OperatorContext(physicalOperator6, fragmentContext3, false);
    DrillBuf b32=null;
    try {
      b32=oContext32.getAllocator().buffer(4400000);
    }catch(Exception e){
      outOfMem=true;
    }finally{
      if(b32!=null) {
        b32.release();
      }else{
        outOfMem=true;
      }
      oContext32.close();
    }
    assertEquals(false, (boolean)outOfMem);

    b11.release();
    oContext11.close();
View Full Code Here

    this.context = context;
    this.readers = readers;
    if (!readers.hasNext())
      throw new ExecutionSetupException("A scan batch must contain at least one reader.");
    this.currentReader = readers.next();
    this.oContext = new OperatorContext(subScanConfig, context);
    this.currentReader.setOperatorContext(this.oContext);
    this.currentReader.setup(mutator);
    this.partitionColumns = partitionColumns.iterator();
    this.partitionValues = this.partitionColumns.hasNext() ? this.partitionColumns.next() : null;
    this.selectedPartitionColumns = selectedPartitionColumns;
View Full Code Here

  private OperatorContext oContext;
  private ParquetDirectByteBufferAllocator allocator;

  public ParquetRecordWriter(FragmentContext context, ParquetWriter writer) throws OutOfMemoryException{
    super();
    this.oContext=new OperatorContext(writer, context);
  }
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.ops.OperatorContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.