use of org.apache.drill.exec.work.filter.RuntimeFilterWritable in project drill by apache.
the class FragmentContextImpl method closeNotConsumedRFWs.
private void closeNotConsumedRFWs() {
for (RuntimeFilterWritable runtimeFilterWritable : rfIdentifier2RFW.values()) {
long rfIdentifier = runtimeFilterWritable.getRuntimeFilterBDef().getRfIdentifier();
boolean fetchedByOperator = rfIdentifier2fetched.get(rfIdentifier);
if (!fetchedByOperator) {
// if the RF hasn't been consumed by the operator, we have to released it one more time.
runtimeFilterWritable.close();
}
}
}
use of org.apache.drill.exec.work.filter.RuntimeFilterWritable in project drill by apache.
the class DataServerRequestHandler method handleRuntimeFilterRequest.
private void handleRuntimeFilterRequest(ByteBuf pBody, ByteBuf dBody, ResponseSender sender) throws RpcException {
BitData.RuntimeFilterBDef runtimeFilterBDef = RpcBus.get(pBody, BitData.RuntimeFilterBDef.PARSER);
if (dBody == null) {
return;
}
List<Integer> bfSizeInBytes = runtimeFilterBDef.getBloomFilterSizeInBytesList();
int boomFilterNum = bfSizeInBytes.size();
DrillBuf data = (DrillBuf) dBody;
DrillBuf[] bufs = new DrillBuf[boomFilterNum];
int index = 0;
for (int i = 0; i < boomFilterNum; i++) {
int length = bfSizeInBytes.get(i);
bufs[i] = data.slice(index, length);
index = index + length;
}
RuntimeFilterWritable runtimeFilterWritable = new RuntimeFilterWritable(runtimeFilterBDef, bufs);
AckSender ackSender = new AckSender(sender);
ackSender.increment();
try {
// hand to WorkerBee to solve the received RuntimeFilter, the receiver maybe Foreman or a scan node.
bee.receiveRuntimeFilter(runtimeFilterWritable);
} catch (Exception e) {
logger.error("error to solve received runtime filter, {}", QueryIdHelper.getQueryId(runtimeFilterBDef.getQueryId()), e);
ackSender.clear();
ackSender.sendFail();
} finally {
ackSender.sendOk();
}
}
Aggregations