Examples of JavaDataModel


Examples of org.apache.hadoop.hive.ql.util.JavaDataModel

    }
    aggregationBuffers[row] = bufferSet;
  }

  public void compileAggregationBatchInfo(VectorAggregateExpression[] aggregators) {
    JavaDataModel model = JavaDataModel.get();
    int[] variableSizeAggregators = new int[aggregators.length];
    int indexVariableSizes = 0;

    aggregatorsFixedSize = JavaDataModel.alignUp(
        model.object() +
        model.primitive1()*2 +
        model.ref(),
        model.memoryAlign());

    aggregatorsFixedSize += model.lengthForObjectArrayOfSize(aggregators.length);
    for(int i=0;i<aggregators.length;++i) {
      VectorAggregateExpression aggregator = aggregators[i];
      aggregatorsFixedSize += aggregator.getAggregationBufferFixedSize();
      if (aggregator.hasVariableSize()) {
        variableSizeAggregators[indexVariableSizes] = i;
View Full Code Here

Examples of org.apache.hadoop.hive.ql.util.JavaDataModel

    static class PercentileAggBuf extends AbstractAggregationBuffer {
      NumericHistogram histogram;   // histogram used for quantile approximation
      double[] quantiles;           // the quantiles requested
      @Override
      public int estimate() {
        JavaDataModel model = JavaDataModel.get();
        return model.lengthFor(histogram) +
            model.array() + JavaDataModel.PRIMITIVES2 * quantiles.length;
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.util.JavaDataModel

      public long countTrues;  /* Count of number of true values seen so far */
      public long countFalses; /* Count of number of false values seen so far */
      public long countNulls;  /* Count of number of null values seen so far */
      @Override
      public int estimate() {
        JavaDataModel model = JavaDataModel.get();
        return model.primitive2() * 3 + model.lengthFor(columnType);
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.util.JavaDataModel

      public LongNumDistinctValueEstimator numDV;    /* Distinct value estimator */
      public boolean firstItem;                     /* First item in the aggBuf? */
      public int numBitVectors;
      @Override
      public int estimate() {
        JavaDataModel model = JavaDataModel.get();
        return model.primitive1() * 2 + model.primitive2() * 3 +
            model.lengthFor(columnType) + model.lengthFor(numDV);
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.util.JavaDataModel

      public DoubleNumDistinctValueEstimator numDV;  /* Distinct value estimator */
      public boolean firstItem;                     /* First item in the aggBuf? */
      public int numBitVectors;
      @Override
      public int estimate() {
        JavaDataModel model = JavaDataModel.get();
        return model.primitive1() * 2 + model.primitive2() * 3 +
            model.lengthFor(columnType) + model.lengthFor(numDV);
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.util.JavaDataModel

      public StringNumDistinctValueEstimator numDV;      /* Distinct value estimator */
      public int numBitVectors;
      public boolean firstItem;
      @Override
      public int estimate() {
        JavaDataModel model = JavaDataModel.get();
        return model.primitive1() * 2 + model.primitive2() * 4 +
            model.lengthFor(columnType) + model.lengthFor(numDV);
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.util.JavaDataModel

      public long sumLength;             /* Sum of lengths of all values seen so far */
      public long count;                          /* Count of all values seen so far */
      public long countNulls;          /* Count of number of null values seen so far */
      @Override
      public int estimate() {
        JavaDataModel model = JavaDataModel.get();
        return model.primitive2() * 4 + model.lengthFor(columnType);
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.util.JavaDataModel

      public DecimalNumDistinctValueEstimator numDV;  /* Distinct value estimator */
      public boolean firstItem;                     /* First item in the aggBuf? */
      public int numBitVectors;
      @Override
      public int estimate() {
        JavaDataModel model = JavaDataModel.get();
        return model.primitive1() * 2 + model.primitive2() + model.lengthOfDecimal() * 2 +
            model.lengthFor(columnType) + model.lengthFor(numDV);
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.util.JavaDataModel

    for(int i=0;i<VectorizedRowBatch.DEFAULT_SIZE; ++i) {
      compiledKeyWrapperBatch.vectorHashKeyWrappers[i] =
          compiledKeyWrapperBatch.allocateKeyWrapper();
    }

    JavaDataModel model = JavaDataModel.get();

    // Compute the fixed size overhead for the keys
    // start with the keywrapper itself
    compiledKeyWrapperBatch.keysFixedSize += JavaDataModel.alignUp(
        model.object() +
        model.ref() * MODEL_REFERENCES_COUNT +
        model.primitive1(),
        model.memoryAlign());

    // Now add the key wrapper arrays
    compiledKeyWrapperBatch.keysFixedSize += model.lengthForLongArrayOfSize(longIndicesIndex);
    compiledKeyWrapperBatch.keysFixedSize += model.lengthForDoubleArrayOfSize(doubleIndicesIndex);
    compiledKeyWrapperBatch.keysFixedSize += model.lengthForObjectArrayOfSize(stringIndicesIndex);
    compiledKeyWrapperBatch.keysFixedSize += model.lengthForObjectArrayOfSize(decimalIndicesIndex);
    compiledKeyWrapperBatch.keysFixedSize += model.lengthForIntArrayOfSize(longIndicesIndex) * 2;
    compiledKeyWrapperBatch.keysFixedSize +=
        model.lengthForBooleanArrayOfSize(keyExpressions.length);

    return compiledKeyWrapperBatch;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.util.JavaDataModel

  }

  public int getVariableSize() {
    int variableSize = 0;
    for (int i=0; i<byteLengths.length; ++i) {
      JavaDataModel model = JavaDataModel.get();
      variableSize += model.lengthForByteArrayOfSize(byteLengths[i]);
    }
    return variableSize;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.