private StreamWorkSlotQueue findWorkSlotQueue(MonitoredStream targetdStream, PolicyDefinition def) { StreamWorkSlotQueue targetQueue = null; for (StreamWorkSlotQueue queue : targetdStream.getQueues()) { if (isQueueAvailable(queue, def)) { targetQueue = queue; break; } } if (targetQueue == null) { WorkQueueBuilder builder = new WorkQueueBuilder(context, mgmtService); // TODO : get the properties from policy definiton targetQueue = builder.createQueue(targetdStream, def.isDedicated(), getQueueSize(def.getParallelismHint()), new HashMap<String, Object>()); } return targetQueue; }
WorkQueueBuilder wrb = new WorkQueueBuilder(context, mgmtService); StreamWorkSlotQueue queue = wrb.createQueue(new MonitoredStream(group1), group1.isDedicated(), 2, new HashMap<String, Object>()); print(context.getTopologyUsages().values()); }); StreamWorkSlotQueue queue2 = wrb.createQueue(new MonitoredStream(group2), group2.isDedicated(), 2, new HashMap<String, Object>()); print(context.getTopologyUsages().values()); StreamWorkSlotQueue queue3 = wrb.createQueue(new MonitoredStream(group3), group3.isDedicated(), 2, new HashMap<String, Object>()); print(context.getTopologyUsages().values()); StreamWorkSlotQueue queue4 = wrb.createQueue(new MonitoredStream(group4), group4.isDedicated(), 2, new HashMap<String, Object>()); print(context.getTopologyUsages().values());
WorkQueueBuilder wrb = new WorkQueueBuilder(context, mgmtService); StreamWorkSlotQueue queue = wrb.createQueue(new MonitoredStream(group1), group1.isDedicated(), 2, new HashMap<String, Object>()); print(context.getTopologyUsages().values()); }); StreamWorkSlotQueue queue2 = wrb.createQueue(new MonitoredStream(group2), group2.isDedicated(), 2, new HashMap<String, Object>()); print(context.getTopologyUsages().values()); StreamWorkSlotQueue queue3 = wrb.createQueue(new MonitoredStream(group3), group3.isDedicated(), 2, new HashMap<String, Object>()); print(context.getTopologyUsages().values()); }); StreamWorkSlotQueue queue4 = wrb.createQueue(new MonitoredStream(group4), group4.isDedicated(), 2, new HashMap<String, Object>()); print(context.getTopologyUsages().values());
String bolt1 = null; WorkQueueBuilder wrb = new WorkQueueBuilder(context, mgmtService); StreamWorkSlotQueue queue = wrb.createQueue(ms1, false, 5, new HashMap<String, Object>()); sg2.addStreamPartition(partition2); MonitoredStream ms2 = new MonitoredStream(sg2); queue = wrb.createQueue(ms2, false, 5, new HashMap<String, Object>());