本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}
示例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();
}
示例6: addOrGetVector
import org.apache.drill.exec.vector.AddOrGetResult; //导入依赖的package包/类
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
throw new UnsupportedOperationException();
}
示例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();
});
}
示例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;
}
示例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);