in athena-federation-sdk/src/main/java/com/amazonaws/athena/connector/lambda/data/BlockAllocatorImpl.java [98:132]
public synchronized Block createBlock(Schema schema)
{
Block block = null;
VectorSchemaRoot vectorSchemaRoot = null;
List<FieldVector> vectors = new ArrayList();
try {
for (Field next : schema.getFields()) {
vectors.add(next.createVector(rootAllocator));
}
vectorSchemaRoot = new VectorSchemaRoot(schema, vectors, 0);
block = new Block(id, schema, vectorSchemaRoot);
blocks.add(block);
}
catch (Exception ex) {
if (block != null) {
try {
block.close();
}
catch (Exception ex2) {
logger.error("createBlock: error while closing block during previous error.", ex2);
}
}
if (vectorSchemaRoot != null) {
vectorSchemaRoot.close();
}
for (FieldVector next : vectors) {
next.close();
}
throw ex;
}
return block;
}