Package org.apache.drill.exec.memory

Examples of org.apache.drill.exec.memory.TopLevelAllocator$PreAlloc


  // next batch. But the value has already been increased by 1 in the prior failed try. Therefore, the sum of the generated number could be different,
  // depending on the size of each outgoing batch, and when the batch could not hold any more values.
  public void testLimitAcrossBatches(@Injectable final DrillbitContext bitContext, @Injectable UserServer.UserClientConnection connection) throws Throwable{
    new NonStrictExpectations(){{
      bitContext.getMetrics(); result = new MetricRegistry();
      bitContext.getAllocator(); result = new TopLevelAllocator();
      bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c);
      bitContext.getConfig(); result = c;
    }};

    verifyLimitCount(bitContext, connection, "test2.json", 69999);
View Full Code Here


    new NonStrictExpectations() {
      {
        context.getMetrics();
        result = new MetricRegistry();
        context.getAllocator();
        result = new TopLevelAllocator();
        context.getConfig();
        result = c;
      }
    };
    RemoteServiceSet lss = RemoteServiceSet.getLocalServiceSet();
View Full Code Here

    new NonStrictExpectations() {
      {
        bitContext.getMetrics();
        result = new MetricRegistry();
        bitContext.getAllocator();
        result = new TopLevelAllocator();
        bitContext.getConfig();
        result = c;
      }
    };
View Full Code Here

  DrillConfig c = DrillConfig.create();

  private SimpleRootExec doTest(final DrillbitContext bitContext, UserClientConnection connection, String file) throws Exception{
    new NonStrictExpectations(){{
      bitContext.getMetrics(); result = new MetricRegistry();
      bitContext.getAllocator(); result = new TopLevelAllocator();
      bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c);
      bitContext.getConfig(); result = c;
    }};

    PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance());
View Full Code Here

  public void runTest(@Injectable final DrillbitContext bitContext,
                      @Injectable UserServer.UserClientConnection connection, String expression, int expectedResults) throws Throwable {

    new NonStrictExpectations(){{
      bitContext.getMetrics(); result = new MetricRegistry();
      bitContext.getAllocator(); result = new TopLevelAllocator();
      bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c);
      bitContext.getConfig(); result = c;
    }};

    String planString = Resources.toString(Resources.getResource(COMPARISON_TEST_PHYSICAL_PLAN), Charsets.UTF_8).replaceAll("EXPRESSION", expression);
View Full Code Here

    columns.add(new SchemaPath("_MAP.bin", ExpressionPosition.UNKNOWN));
    columns.add(new SchemaPath("_MAP.bin2", ExpressionPosition.UNKNOWN));
    int totalRowCount = 0;

    FileSystem fs = new CachedSingleFileSystem(fileName);
    BufferAllocator allocator = new TopLevelAllocator();
    for(int i = 0; i < 25; i++){
      ParquetRecordReader rr = new ParquetRecordReader(context, 256000, fileName, 0, fs,
          new CodecFactoryExposer(dfsConfig), f.getParquetMetadata(), columns);
      TestOutputMutator mutator = new TestOutputMutator(allocator);
      rr.setup(mutator);
      Stopwatch watch = new Stopwatch();
      watch.start();

      int rowCount = 0;
      while ((rowCount = rr.next()) > 0) {
        totalRowCount += rowCount;
      }
      System.out.println(String.format("Time completed: %s. ", watch.elapsed(TimeUnit.MILLISECONDS)));
      rr.cleanup();
    }

    allocator.close();
    System.out.println(String.format("Total row count %s", totalRowCount));
  }
View Full Code Here

  public void runTest(@Injectable final DrillbitContext bitContext,
                      @Injectable UserServer.UserClientConnection connection, Object[] expectedResults, String planPath) throws Throwable {

    new NonStrictExpectations(){{
      bitContext.getMetrics(); result = new MetricRegistry();
      bitContext.getAllocator(); result = new TopLevelAllocator();
      bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c);
      bitContext.getConfig(); result = c;
    }};

    String planString = Resources.toString(Resources.getResource(planPath), Charsets.UTF_8);
View Full Code Here

    if (valueHolder.isSet == 0) {
      return;
    }

      consumer.startField(schema.getFieldName(fieldId), fieldId);
      Decimal38SparseVector tempVec = new Decimal38SparseVector(MaterializedField.create("", TypeProtos.MajorType.getDefaultInstance()), new TopLevelAllocator());
      tempVec.allocateNew(10);
      tempVec.getMutator().setSafe(0, valueHolder);
      byte[] bytes = DecimalUtility.getBigDecimalFromSparse(
              valueHolder.buffer, valueHolder.start, Decimal38SparseHolder.nDecimalDigits, valueHolder.scale).unscaledValue().toByteArray();
      byte[] output = new byte[ParquetTypeHelper.getLengthForMinorType(MinorType.DECIMAL38SPARSE)];
View Full Code Here

  }
  @Override
  public void addDecimal38SparseHolder(int fieldId, Decimal38SparseHolder valueHolder) throws IOException {

      consumer.startField(schema.getFieldName(fieldId), fieldId);
      Decimal38SparseVector tempVec = new Decimal38SparseVector(MaterializedField.create("", TypeProtos.MajorType.getDefaultInstance()), new TopLevelAllocator());
      tempVec.allocateNew(10);
      tempVec.getMutator().setSafe(0, valueHolder);
      byte[] bytes = DecimalUtility.getBigDecimalFromSparse(
              valueHolder.buffer, valueHolder.start, Decimal38SparseHolder.nDecimalDigits, valueHolder.scale).unscaledValue().toByteArray();
      byte[] output = new byte[ParquetTypeHelper.getLengthForMinorType(MinorType.DECIMAL38SPARSE)];
View Full Code Here

    if (valueHolder.isSet == 0) {
      return;
    }

      consumer.startField(schema.getFieldName(fieldId), fieldId);
      Decimal28SparseVector tempVec = new Decimal28SparseVector(MaterializedField.create("", TypeProtos.MajorType.getDefaultInstance()), new TopLevelAllocator());
      tempVec.allocateNew(10);
      tempVec.getMutator().setSafe(0, valueHolder);
      byte[] bytes = DecimalUtility.getBigDecimalFromSparse(
              valueHolder.buffer, valueHolder.start, Decimal28SparseHolder.nDecimalDigits, valueHolder.scale).unscaledValue().toByteArray();
      byte[] output = new byte[ParquetTypeHelper.getLengthForMinorType(MinorType.DECIMAL28SPARSE)];
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.memory.TopLevelAllocator$PreAlloc

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.