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


Java VectorDescriptor類代碼示例

本文整理匯總了Java中org.apache.drill.exec.vector.VectorDescriptor的典型用法代碼示例。如果您正苦於以下問題:Java VectorDescriptor類的具體用法?Java VectorDescriptor怎麽用?Java VectorDescriptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


VectorDescriptor類屬於org.apache.drill.exec.vector包,在下文中一共展示了VectorDescriptor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addOrGetVector

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
  boolean created = false;
  if (vector == DEFAULT_DATA_VECTOR && descriptor.getType().getMinorType() != TypeProtos.MinorType.LATE) {
    final MaterializedField field = descriptor.withName(DATA_VECTOR_NAME).getField();
    vector = TypeHelper.getNewVector(field, allocator);
    // returned vector must have the same field
    assert field.equals(vector.getField());
    getField().addChild(field);
    created = true;
  }

  final TypeProtos.MajorType actual = vector.getField().getType();
  if (!actual.equals(descriptor.getType())) {
    final String msg = String.format("Inner vector type mismatch. Requested type: [%s], actual type: [%s]",
        descriptor.getType(), actual);
    throw new SchemaChangeRuntimeException(msg);
  }

  return new AddOrGetResult<>((T)vector, created);
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:22,代碼來源:BaseRepeatedValueVector.java

示例2: addOrGetVector

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
  boolean created = false;
  if (vector == DEFAULT_DATA_VECTOR && descriptor.getType().getMinorType() != TypeProtos.MinorType.LATE) {
    final MaterializedField field = descriptor.withName(DATA_VECTOR_NAME).getField();
    vector = BasicTypeHelper.getNewVector(field, allocator);
    // returned vector must have the same field
    assert field.equals(vector.getField());
    getField().addChild(field);
    created = true;
  }

  final TypeProtos.MajorType actual = vector.getField().getType();
  if (!actual.equals(descriptor.getType())) {
    final String msg = String.format("Inner vector type mismatch. Requested type: [%s], actual type: [%s]",
        descriptor.getType(), actual);
    throw new SchemaChangeRuntimeException(msg);
  }

  return new AddOrGetResult<>((T)vector, created);
}
 
開發者ID:axbaretto,項目名稱:drill,代碼行數:23,代碼來源:BaseRepeatedValueVector.java

示例3: getWriter

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
protected FieldWriter getWriter(MinorType type) {
  if (state == State.UNION) {
    return writer;
  }
  if (state == State.UNTYPED) {
    if (type == null) {
      return null;
    }
    ValueVector v = listVector.addOrGetVector(new VectorDescriptor(Types.optional(type))).getVector();
    v.allocateNew();
    setWriter(v);
    writer.setPosition(position);
  }
  if (type != this.type) {
    return promoteToUnion();
  }
  return writer;
}
 
開發者ID:axbaretto,項目名稱:drill,代碼行數:19,代碼來源:PromotableWriter.java

示例4: load

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
@Override
public void load(UserBitShared.SerializedField metadata, DrillBuf buffer) {
  final UserBitShared.SerializedField offsetMetadata = metadata.getChild(0);
  offsets.load(offsetMetadata, buffer);

  final int offsetLength = offsetMetadata.getBufferLength();
  final UserBitShared.SerializedField bitMetadata = metadata.getChild(1);
  final int bitLength = bitMetadata.getBufferLength();
  bits.load(bitMetadata, buffer.slice(offsetLength, bitLength));

  final UserBitShared.SerializedField vectorMetadata = metadata.getChild(2);
  if (getDataVector() == DEFAULT_DATA_VECTOR) {
    addOrGetVector(VectorDescriptor.create(vectorMetadata.getMajorType()));
  }

  final int vectorLength = vectorMetadata.getBufferLength();
  vector.load(vectorMetadata, buffer.slice(offsetLength + bitLength, vectorLength));
}
 
開發者ID:axbaretto,項目名稱:drill,代碼行數:19,代碼來源:ListVector.java

示例5: DelegateTransferPair

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
public DelegateTransferPair(DelegateRepeatedVector target) {
  this.target = Preconditions.checkNotNull(target);
  if (target.getDataVector() == DEFAULT_DATA_VECTOR) {
    target.addOrGetVector(VectorDescriptor.create(getDataVector().getField()));
    target.getDataVector().allocateNew();
  }
  this.children = new TransferPair[] {
      getOffsetVector().makeTransferPair(target.getOffsetVector()),
      getDataVector().makeTransferPair(target.getDataVector())
  };
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:12,代碼來源:RepeatedListVector.java

示例6: addOrGetVector

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
  final AddOrGetResult<T> result = delegate.addOrGetVector(descriptor);
  if (result.isCreated() && callBack != null) {
    callBack.doWork();
  }
  return result;
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:9,代碼來源:RepeatedListVector.java

示例7: load

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
@Override
public void load(UserBitShared.SerializedField metadata, DrillBuf buffer) {
  final UserBitShared.SerializedField offsetMetadata = metadata.getChild(0);
  offsets.load(offsetMetadata, buffer);

  final UserBitShared.SerializedField vectorMetadata = metadata.getChild(1);
  if (getDataVector() == DEFAULT_DATA_VECTOR) {
    addOrGetVector(VectorDescriptor.create(vectorMetadata.getMajorType()));
  }

  final int offsetLength = offsetMetadata.getBufferLength();
  final int vectorLength = vectorMetadata.getBufferLength();
  vector.load(vectorMetadata, buffer.slice(offsetLength, vectorLength));
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:15,代碼來源:BaseRepeatedValueVector.java

示例8: addOrGetVector

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
  final AddOrGetResult<T> result = delegate.addOrGetVector(descriptor);
  if (result.isCreated() && callBack != null) {
    callBack.doWork();
  }
  this.field = delegate.getField();
  return result;
}
 
開發者ID:axbaretto,項目名稱:drill,代碼行數:10,代碼來源:RepeatedListVector.java

示例9: transferTo

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
public void transferTo(ListVector target) {
  offsets.makeTransferPair(target.offsets).transfer();
  bits.makeTransferPair(target.bits).transfer();
  if (target.getDataVector() instanceof ZeroVector) {
    target.addOrGetVector(new VectorDescriptor(vector.getField().getType()));
  }
  getDataVector().makeTransferPair(target.getDataVector()).transfer();
}
 
開發者ID:axbaretto,項目名稱:drill,代碼行數:9,代碼來源:ListVector.java

示例10: addOrGet

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
/**
 * @deprecated
 *   prefer using {@link #addOrGetVector(org.apache.drill.exec.vector.VectorDescriptor)} instead.
 */
@Override
public <T extends ValueVector> T addOrGet(String name, MajorType type, Class<T> clazz) {
  final AddOrGetResult<T> result = addOrGetVector(VectorDescriptor.create(type));
  return result.getVector();
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:10,代碼來源:RepeatedListVector.java

示例11: addOrGetVector

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
  throw new UnsupportedOperationException();
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:5,代碼來源:RepeatedMapVector.java

示例12: ListVectorStruct

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
ListVectorStruct(final ListVector vector) {
  super(vector, (field, clazz) -> {
    AddOrGetResult result = vector.addOrGetVector(new VectorDescriptor(field));
    return result.getVector();
  });
}
 
開發者ID:fineoio,項目名稱:drill-dynamo-adapter,代碼行數:7,代碼來源:DynamoRecordReader.java

示例13: TransferImpl

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
public TransferImpl(MaterializedField field, BufferAllocator allocator) {
  to = new ListVector(field, allocator, null);
  to.addOrGetVector(new VectorDescriptor(vector.getField().getType()));
}
 
開發者ID:axbaretto,項目名稱:drill,代碼行數:5,代碼來源:ListVector.java

示例14: addOrGetVector

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
  AddOrGetResult<T> result = super.addOrGetVector(descriptor);
  reader = new UnionListReader(this);
  return result;
}
 
開發者ID:axbaretto,項目名稱:drill,代碼行數:7,代碼來源:ListVector.java

示例15: addOrGetVector

import org.apache.drill.exec.vector.VectorDescriptor; //導入依賴的package包/類
/**
 * Creates and adds a child vector if none with the same name exists, else returns the vector instance.
 *
 * @param  descriptor vector descriptor
 * @return  result of operation wrapping vector corresponding to the given descriptor and whether it's newly created
 * @throws org.apache.drill.common.exceptions.DrillRuntimeException
 *    if schema change is not permissible between the given and existing data vector types.
 */
<T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor);
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:10,代碼來源:ContainerVectorLike.java


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