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


Java AddOrGetResult類代碼示例

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


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

示例1: addOrGetVector

import org.apache.drill.exec.vector.AddOrGetResult; //導入依賴的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.AddOrGetResult; //導入依賴的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: addOrGetVector

import org.apache.drill.exec.vector.AddOrGetResult; //導入依賴的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

示例4: addOrGetVector

import org.apache.drill.exec.vector.AddOrGetResult; //導入依賴的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

示例5: addOrGet

import org.apache.drill.exec.vector.AddOrGetResult; //導入依賴的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

示例6: addOrGetVector

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

示例7: ListVectorStruct

import org.apache.drill.exec.vector.AddOrGetResult; //導入依賴的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

示例8: addOrGetVector

import org.apache.drill.exec.vector.AddOrGetResult; //導入依賴的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

示例9: addOrGetVector

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