private void blacklist(KestrelClientInfo info, Throwable t) { // this case can happen when it fails to connect to Kestrel (and so // never stores the connection) info.closeClient(); info.blacklistTillTimeMs = System.currentTimeMillis() + BLACKLIST_TIME_MS; final int index = _kestrels.indexOf(info); // we just closed the connection, so all open reliable reads will be // aborted. empty buffers. for (final Iterator<EmitItem> i = _emitBuffer.iterator(); i.hasNext();) { final EmitItem item = i.next(); if (item.sourceId.index == index) i.remove(); } }
private void blacklist(KestrelClientInfo info, Throwable t) { // this case can happen when it fails to connect to Kestrel (and so // never stores the connection) info.closeClient(); info.blacklistTillTimeMs = System.currentTimeMillis() + BLACKLIST_TIME_MS; final int index = _kestrels.indexOf(info); // we just closed the connection, so all open reliable reads will be // aborted. empty buffers. for (final Iterator<EmitItem> i = _emitBuffer.iterator(); i.hasNext();) { final EmitItem item = i.next(); if (item.sourceId.index == index) i.remove(); } }
@Override public void close() { for (final KestrelClientInfo info : _kestrels) info.closeClient(); // Closing the client connection causes all the open reliable reads to // be aborted. // Thus, clear our local buffer of these reliable reads. _emitBuffer.clear(); _kestrels.clear(); }
@Override public void close() { for (final KestrelClientInfo info : _kestrels) info.closeClient(); // Closing the client connection causes all the open reliable reads to // be aborted. // Thus, clear our local buffer of these reliable reads. _emitBuffer.clear(); _kestrels.clear(); }