use of org.apache.hyracks.api.comm.IChannelInterfaceFactory in project asterixdb by apache.
the class ChannelSet method createChannel.
private ChannelControlBlock createChannel(int idx) throws NetException {
if (idx > MuxDemuxCommand.MAX_CHANNEL_ID) {
throw new NetException("Channel Id > " + MuxDemuxCommand.MAX_CHANNEL_ID + " being opened");
}
if (idx >= ccbArray.length) {
expand(idx);
}
if (ccbArray[idx] != null) {
assert ccbArray[idx].completelyClosed() : ccbArray[idx].toString();
if (ccbArray[idx].completelyClosed()) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Cleaning free channel: " + ccbArray[idx]);
}
freeChannel(ccbArray[idx]);
}
}
assert idx < ccbArray.length;
assert !allocationBitmap.get(idx);
IChannelInterfaceFactory channelInterfaceFactory = mConn.getChannelInterfaceFactory();
ChannelControlBlock channel = new ChannelControlBlock(this, idx, channelInterfaceFactory);
ccbArray[idx] = channel;
allocationBitmap.set(idx);
++openChannelCount;
return channel;
}
Aggregations