本文整理汇总了Java中org.apache.drill.exec.vector.AllocationHelper.allocate方法的典型用法代码示例。如果您正苦于以下问题:Java AllocationHelper.allocate方法的具体用法?Java AllocationHelper.allocate怎么用?Java AllocationHelper.allocate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.drill.exec.vector.AllocationHelper
的用法示例。
在下文中一共展示了AllocationHelper.allocate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copyRecords
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
@Override
public int copyRecords(int index, int recordCount){
for(VectorWrapper<?> out : outgoing){
MajorType type = out.getField().getType();
if (!Types.isFixedWidthType(type) || Types.isRepeated(type)) {
out.getValueVector().allocateNew();
} else {
AllocationHelper.allocate(out.getValueVector(), recordCount, 1);
}
}
int outgoingPosition = 0;
for(int svIndex = index; svIndex < index + recordCount; svIndex++, outgoingPosition++){
int deRefIndex = sv4.get(svIndex);
doEval(deRefIndex, outgoingPosition);
}
return outgoingPosition;
}
示例2: copyRecords
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
@Override
public int copyRecords(int index, int recordCount){
for(VectorWrapper<?> out : outgoing){
MajorType type = out.getField().getType();
if (!Types.isFixedWidthType(type) || Types.isRepeated(type)) {
out.getValueVector().allocateNew();
} else {
AllocationHelper.allocate(out.getValueVector(), recordCount, 1);
}
}
int outgoingPosition = 0;
for(int svIndex = index; svIndex < index + recordCount; svIndex++, outgoingPosition++){
doEval(sv2.getIndex(svIndex), outgoingPosition);
}
return outgoingPosition;
}
示例3: addOutputContainerData
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
private void addOutputContainerData() {
final VarCharVector fragmentIdVector = (VarCharVector) container.getValueAccessorById(
VarCharVector.class,
container.getValueVectorId(SchemaPath.getSimplePath("Fragment")).getFieldIds())
.getValueVector();
AllocationHelper.allocate(fragmentIdVector, 1, 50);
final BigIntVector summaryVector = (BigIntVector) container.getValueAccessorById(BigIntVector.class,
container.getValueVectorId(SchemaPath.getSimplePath("Number of records written")).getFieldIds())
.getValueVector();
AllocationHelper.allocate(summaryVector, 1, 8);
fragmentIdVector.getMutator().setSafe(0, fragmentUniqueId.getBytes());
fragmentIdVector.getMutator().setValueCount(1);
summaryVector.getMutator().setSafe(0, counter);
summaryVector.getMutator().setValueCount(1);
container.setRecordCount(1);
}
示例4: populatePartitionVectors
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
private void populatePartitionVectors() {
for (int index = 0; index < selectedPartitionColumns.size(); index++) {
final int i = selectedPartitionColumns.get(index);
final NullableVarCharVector v = (NullableVarCharVector) partitionVectors.get(index);
if (partitionValues.length > i) {
final String val = partitionValues[i];
AllocationHelper.allocate(v, recordCount, val.length());
final byte[] bytes = val.getBytes();
for (int j = 0; j < recordCount; j++) {
v.getMutator().setSafe(j, bytes, 0, bytes.length);
}
v.getMutator().setValueCount(recordCount);
} else {
AllocationHelper.allocate(v, recordCount, 0);
v.getMutator().setValueCount(recordCount);
}
}
}
示例5: copyRecords
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
@Override
public int copyRecords(int index, int recordCount) throws SchemaChangeException {
for(VectorWrapper<?> out : outgoing){
MajorType type = out.getField().getType();
if (!Types.isFixedWidthType(type) || Types.isRepeated(type)) {
out.getValueVector().allocateNew();
} else {
AllocationHelper.allocate(out.getValueVector(), recordCount, 1);
}
}
int outgoingPosition = 0;
for(int svIndex = index; svIndex < index + recordCount; svIndex++, outgoingPosition++){
int deRefIndex = sv4.get(svIndex);
doEval(deRefIndex, outgoingPosition);
}
return outgoingPosition;
}
示例6: copyRecords
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
@Override
public int copyRecords(int index, int recordCount) throws SchemaChangeException {
for(VectorWrapper<?> out : outgoing){
MajorType type = out.getField().getType();
if (!Types.isFixedWidthType(type) || Types.isRepeated(type)) {
out.getValueVector().allocateNew();
} else {
AllocationHelper.allocate(out.getValueVector(), recordCount, 1);
}
}
int outgoingPosition = 0;
for(int svIndex = index; svIndex < index + recordCount; svIndex++, outgoingPosition++){
doEval(sv2.getIndex(svIndex), outgoingPosition);
}
return outgoingPosition;
}
示例7: addOutputContainerData
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
private void addOutputContainerData() {
@SuppressWarnings("resource")
final VarCharVector fragmentIdVector = (VarCharVector) container.getValueAccessorById(
VarCharVector.class,
container.getValueVectorId(SchemaPath.getSimplePath("Fragment")).getFieldIds())
.getValueVector();
AllocationHelper.allocate(fragmentIdVector, 1, 50);
@SuppressWarnings("resource")
final BigIntVector summaryVector = (BigIntVector) container.getValueAccessorById(BigIntVector.class,
container.getValueVectorId(SchemaPath.getSimplePath("Number of records written")).getFieldIds())
.getValueVector();
AllocationHelper.allocate(summaryVector, 1, 8);
fragmentIdVector.getMutator().setSafe(0, fragmentUniqueId.getBytes());
fragmentIdVector.getMutator().setValueCount(1);
summaryVector.getMutator().setSafe(0, counter);
summaryVector.getMutator().setValueCount(1);
container.setRecordCount(1);
}
示例8: populateImplicitVectors
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
private void populateImplicitVectors(Map<String, String> implicitValues, int recordCount) {
if (implicitValues != null) {
for (Map.Entry<String, String> entry : implicitValues.entrySet()) {
@SuppressWarnings("resource")
final NullableVarCharVector v = (NullableVarCharVector) implicitFieldVectorMap.get(entry.getKey());
String val;
if ((val = entry.getValue()) != null) {
AllocationHelper.allocate(v, recordCount, val.length());
final byte[] bytes = val.getBytes();
for (int j = 0; j < recordCount; j++) {
v.getMutator().setSafe(j, bytes, 0, bytes.length);
}
v.getMutator().setValueCount(recordCount);
} else {
AllocationHelper.allocate(v, recordCount, 0);
v.getMutator().setValueCount(recordCount);
}
}
}
}
示例9: allocateOutgoing
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
private void allocateOutgoing() {
for (final VectorWrapper w : outgoingContainer) {
final ValueVector v = w.getValueVector();
if (v instanceof FixedWidthVector) {
AllocationHelper.allocate(v, OUTGOING_BATCH_SIZE, 1);
} else {
v.allocateNewSafe();
}
}
}
示例10: doWork
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
protected void doWork(VectorAccessible batch) {
int recordCount = batch.getRecordCount();
AllocationHelper.allocate(partitionKeyVector, recordCount, 50);
projector.projectRecords(recordCount, 0);
for (VectorWrapper<?> v : container) {
ValueVector.Mutator m = v.getValueVector().getMutator();
m.setValueCount(recordCount);
}
}
示例11: allocate
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
@Override
public void allocate(Map<Key, ValueVector> vectorMap) throws OutOfMemoryException {
try {
for (final ValueVector v : vectorMap.values()) {
AllocationHelper.allocate(v, Character.MAX_VALUE, 50, 10);
}
} catch (NullPointerException e) {
throw new OutOfMemoryException();
}
}
示例12: allocate
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
@Override
public void allocate(Map<Key, ValueVector> vectorMap) throws OutOfMemoryException {
try {
for (final ValueVector v : vectorMap.values()) {
AllocationHelper.allocate(v, recordsPerBatch, 50, 10);
}
} catch (NullPointerException e) {
throw new OutOfMemoryException();
}
}
示例13: allocateVector
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
private void allocateVector(ValueVector vector, int recordCount, AllocationHint hint) {
if (hint == null) {
// Use hard-coded values. Same as ScanBatch
AllocationHelper.allocate(vector, recordCount, 50, 10);
} else {
AllocationHelper.allocate(vector, recordCount, hint.entryWidth, hint.elementCount);
}
}
示例14: allocateOutgoing
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
private void allocateOutgoing() {
for (final VectorWrapper<?> w : outgoingContainer) {
@SuppressWarnings("resource")
final ValueVector v = w.getValueVector();
if (v instanceof FixedWidthVector) {
AllocationHelper.allocate(v, OUTGOING_BATCH_SIZE, 1);
} else {
v.allocateNewSafe();
}
}
}
示例15: allocate
import org.apache.drill.exec.vector.AllocationHelper; //导入方法依赖的package包/类
@Override
public void allocate(Map<String, ValueVector> vectorMap) throws OutOfMemoryException {
try {
for (final ValueVector v : vectorMap.values()) {
AllocationHelper.allocate(v, Character.MAX_VALUE, 50, 10);
}
} catch (NullPointerException e) {
throw new OutOfMemoryException();
}
}