当前位置: 首页>>代码示例>>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;未经允许,请勿转载。