當前位置: 首頁>>代碼示例>>Java>>正文


Java VectorWrapper.clear方法代碼示例

本文整理匯總了Java中org.apache.drill.exec.record.VectorWrapper.clear方法的典型用法代碼示例。如果您正苦於以下問題:Java VectorWrapper.clear方法的具體用法?Java VectorWrapper.clear怎麽用?Java VectorWrapper.clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.drill.exec.record.VectorWrapper的用法示例。


在下文中一共展示了VectorWrapper.clear方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleRemainder

import org.apache.drill.exec.record.VectorWrapper; //導入方法依賴的package包/類
private void handleRemainder() {
  final int remainingRecordCount = incoming.getRecordCount() - remainderIndex;
  if (!doAlloc()) {
    outOfMemory = true;
    return;
  }
  final int projRecords = projector.projectRecords(remainderIndex, remainingRecordCount, 0);
  if (projRecords < remainingRecordCount) {
    setValueCount(projRecords);
    this.recordCount = projRecords;
    remainderIndex += projRecords;
  } else {
    setValueCount(remainingRecordCount);
    hasRemainder = false;
    remainderIndex = 0;
    for (final VectorWrapper<?> v : incoming) {
      v.clear();
    }
    this.recordCount = remainingRecordCount;
  }
  // In case of complex writer expression, vectors would be added to batch run-time.
  // We have to re-build the schema.
  if (complexWriters != null) {
    container.buildSchema(SelectionVectorMode.NONE);
  }
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:27,代碼來源:ProjectRecordBatch.java

示例2: doWork

import org.apache.drill.exec.record.VectorWrapper; //導入方法依賴的package包/類
@Override
protected IterOutcome doWork() {
  int incomingRecordCount = incoming.getRecordCount();

  if (!doAlloc()) {
    outOfMemory = true;
    return IterOutcome.OUT_OF_MEMORY;
  }

  // we call this in setupSchema, but we also need to call it here so we have a reference to the appropriate vector
  // inside of the the flattener for the current batch
  setFlattenVector();

  int childCount = incomingRecordCount == 0 ? 0 : flattener.getFlattenField().getAccessor().getInnerValueCount();
  int outputRecords = flattener.flattenRecords(incomingRecordCount, 0, monitor);
  // TODO - change this to be based on the repeated vector length
  if (outputRecords < childCount) {
    setValueCount(outputRecords);
    hasRemainder = true;
    remainderIndex = outputRecords;
    this.recordCount = remainderIndex;
  } else {
    setValueCount(outputRecords);
    flattener.resetGroupIndex();
    for(VectorWrapper<?> v: incoming) {
      v.clear();
    }
    this.recordCount = outputRecords;
  }
  // In case of complex writer expression, vectors would be added to batch run-time.
  // We have to re-build the schema.
  if (complexWriters != null) {
    container.buildSchema(SelectionVectorMode.NONE);
  }

  return IterOutcome.OK;
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:38,代碼來源:FlattenRecordBatch.java

示例3: handleRemainder

import org.apache.drill.exec.record.VectorWrapper; //導入方法依賴的package包/類
private void handleRemainder() {
  int remainingRecordCount = flattener.getFlattenField().getAccessor().getInnerValueCount() - remainderIndex;
  if (!doAlloc()) {
    outOfMemory = true;
    return;
  }

  int projRecords = flattener.flattenRecords(remainingRecordCount, 0, monitor);
  if (projRecords < remainingRecordCount) {
    setValueCount(projRecords);
    this.recordCount = projRecords;
    remainderIndex += projRecords;
  } else {
    setValueCount(remainingRecordCount);
    hasRemainder = false;
    remainderIndex = 0;
    for (VectorWrapper<?> v : incoming) {
      v.clear();
    }
    flattener.resetGroupIndex();
    this.recordCount = remainingRecordCount;
  }
  // In case of complex writer expression, vectors would be added to batch run-time.
  // We have to re-build the schema.
  if (complexWriters != null) {
    container.buildSchema(SelectionVectorMode.NONE);
  }
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:29,代碼來源:FlattenRecordBatch.java

示例4: releaseData

import org.apache.drill.exec.record.VectorWrapper; //導入方法依賴的package包/類
private void releaseData(RecordBatch b) {
  for (VectorWrapper<?> v : b) {
    v.clear();
  }
  if (b.getSchema().getSelectionVectorMode() == SelectionVectorMode.TWO_BYTE) {
    b.getSelectionVector2().clear();
  }
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:9,代碼來源:JoinStatus.java

示例5: doWork

import org.apache.drill.exec.record.VectorWrapper; //導入方法依賴的package包/類
@Override
protected IterOutcome doWork() {
  int incomingRecordCount = incoming.getRecordCount();

  if (first && incomingRecordCount == 0) {
    if (complexWriters != null) {
      IterOutcome next = null;
      while (incomingRecordCount == 0) {
        next = next(incoming);
        if (next == IterOutcome.OUT_OF_MEMORY) {
          outOfMemory = true;
          return next;
        } else if (next != IterOutcome.OK && next != IterOutcome.OK_NEW_SCHEMA) {
          return next;
        }
        incomingRecordCount = incoming.getRecordCount();
      }
      if (next == IterOutcome.OK_NEW_SCHEMA) {
        try {
          setupNewSchema();
        } catch (final SchemaChangeException e) {
          throw new RuntimeException(e);
        }
      }
    }
  }
  first = false;

  container.zeroVectors();

  if (!doAlloc()) {
    outOfMemory = true;
    return IterOutcome.OUT_OF_MEMORY;
  }

  final int outputRecords = projector.projectRecords(0, incomingRecordCount, 0);
  if (outputRecords < incomingRecordCount) {
    setValueCount(outputRecords);
    hasRemainder = true;
    remainderIndex = outputRecords;
    this.recordCount = remainderIndex;
  } else {
    setValueCount(incomingRecordCount);
    for(final VectorWrapper<?> v: incoming) {
      v.clear();
    }
    this.recordCount = outputRecords;
  }
  // In case of complex writer expression, vectors would be added to batch run-time.
  // We have to re-build the schema.
  if (complexWriters != null) {
    container.buildSchema(SelectionVectorMode.NONE);
  }

  return IterOutcome.OK;
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:57,代碼來源:ProjectRecordBatch.java

示例6: clearCurrentRecordBatch

import org.apache.drill.exec.record.VectorWrapper; //導入方法依賴的package包/類
private void clearCurrentRecordBatch() {
  for(VectorWrapper<?> v: current) {
    v.clear();
  }
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:6,代碼來源:UnionAllRecordBatch.java


注:本文中的org.apache.drill.exec.record.VectorWrapper.clear方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。