public int nextReleased(long now, int none) { //only scan if we know that something is blocked if (0==blockedCount) { return none; } return consumeNextReleased(now, none, untilTimes); }
public void releaseBlocks(long now) { while (-1 != nextReleased(now, -1)) { } }
/** * Returns true if any block will be released in the defined window. * */ public boolean willReleaseInWindow(long limit) { if (0==blockedCount) { return false; } return willReleaseInWindow(limit, untilTimes); }
public final long releaseChannelBlocks(long now) { if (null != channelBlocker) { channelBlocker.releaseBlocks(now); return channelBlocker.durationToNextRelease(now, -1); } else { return -1; //was not init so there are no possible blocked channels. } }
protected void initChannelBlocker(int maxGoPipeId) { channelBlocker = new Blocker(maxGoPipeId+1); }
public final boolean isChannelBlocked(int channelId) { if (null != channelBlocker) { return channelBlocker.isBlocked(channelId); } else { return false; } }
public final void blockChannelUntil(int channelId, long timeInMillis) { channelBlocker.until(channelId, timeInMillis); }
@Override public void startup() { //processing can be very time critical so this thread needs to be on of the highest in priority. Thread.currentThread().setPriority(Thread.MAX_PRIORITY); connectionBlocker = new Blocker(MAX_DEVICES); activeCounts = new int[goPipe.length]; activeBlocks = new int[MAX_DEVICES]; Arrays.fill(activeCounts, -1); //0 indicates, need to ack, -1 indicates done and ready for more Arrays.fill(activeBlocks, -1); startLoopAt = activeCounts.length; rate = (Number)graphManager.getNota(graphManager, this.stageId, GraphManager.SCHEDULE_RATE, null); }
protected boolean isConnectionUnBlocked(int connection) { return !connectionBlocker.isBlocked(connection); }
protected void blockConnectionUntil(int connection, long time) { connectionBlocker.until(connection, time); mostRecentBlockedConnection = connection; }
public int nextReleased(long now, int none) { //only scan if we know that something is blocked if (0==blockedCount) { return none; } return consumeNextReleased(now, none, untilTimes); }
/** * Returns true if any block will be released in the defined window. * */ public boolean willReleaseInWindow(long limit) { if (0==blockedCount) { return false; } return willReleaseInWindow(limit, untilTimes); }
public void releaseBlocks(long now) { while (-1 != nextReleased(now, -1)) { } }
public int nextReleased(long now, int none) { //only scan if we know that something is blocked if (0==blockedCount) { return none; } return consumeNextReleased(now, none, untilTimes); }
/** * Returns true if any block will be released in the defined window. * */ public boolean willReleaseInWindow(long limit) { if (0==blockedCount) { return false; } return willReleaseInWindow(limit, untilTimes); }
public void releaseBlocks(long now) { while (-1 != nextReleased(now, -1)) { } }