public StreamWorkSlotQueue createQueue(MonitoredStream stream, boolean isDedicated, int size,
Map<String, Object> properties) {
IWorkSlotStrategy strategy = new SameTopologySlotStrategy(context, stream.getStreamGroup(), mgmtService);
List<WorkSlot> slots = strategy.reserveWorkSlots(size, isDedicated, properties);
if (slots.size() < size) {
LOG.error("allocate stream work queue failed, required size");
return null;
}
StreamWorkSlotQueue queue = new StreamWorkSlotQueue(stream.getStreamGroup(), isDedicated, properties,
slots);
calculateGroupIndexAndCount(queue);
assignQueueSlots(stream, queue);
stream.addQueues(queue);
return queue;
}