/** Wait for a packet with given {@code seqno} to be enqueued to ackQueue */ Packet waitForAckHead(long seqno) throws InterruptedException { synchronized(ackQueue) { while (isRunning() && ackQueue.size() == 0) { if (LOG.isDebugEnabled()) { LOG.debug(myString + ": seqno=" + seqno + " waiting for local datanode to finish write."); } ackQueue.wait(); } return isRunning() ? ackQueue.getFirst() : null; } }
/** * wait for all pending packets to be acked. Then shutdown thread. */ @Override public void close() { synchronized(ackQueue) { while (isRunning() && ackQueue.size() != 0) { try { ackQueue.wait(); } catch (InterruptedException e) { running = false; Thread.currentThread().interrupt(); } } if(LOG.isDebugEnabled()) { LOG.debug(myString + ": closing"); } running = false; ackQueue.notifyAll(); } synchronized(this) { running = false; notifyAll(); } }
boolean lastPacketInBlock = false; final long startTime = ClientTraceLog.isInfoEnabled() ? System.nanoTime() : 0; while (isRunning() && !lastPacketInBlock) { long totalAckTimeNanos = 0; boolean isInterrupted = false; || type == PacketResponderType.LAST_IN_PIPELINE) { pkt = waitForAckHead(seqno); if (!isRunning()) { break;
boolean lastPacketInBlock = false; final long startTime = ClientTraceLog.isInfoEnabled() ? System.nanoTime() : 0; while (isRunning() && !lastPacketInBlock) { long totalAckTimeNanos = 0; boolean isInterrupted = false; || type == PacketResponderType.LAST_IN_PIPELINE) { pkt = waitForAckHead(seqno); if (!isRunning()) { break;
boolean lastPacketInBlock = false; final long startTime = ClientTraceLog.isInfoEnabled() ? System.nanoTime() : 0; while (isRunning() && !lastPacketInBlock) { long totalAckTimeNanos = 0; boolean isInterrupted = false; || type == PacketResponderType.LAST_IN_PIPELINE) { pkt = waitForAckHead(seqno); if (!isRunning()) { break;
/** * wait for all pending packets to be acked. Then shutdown thread. */ @Override public void close() { synchronized(ackQueue) { while (isRunning() && ackQueue.size() != 0) { try { ackQueue.wait(); } catch (InterruptedException e) { running = false; Thread.currentThread().interrupt(); } } if(LOG.isDebugEnabled()) { LOG.debug(myString + ": closing"); } running = false; ackQueue.notifyAll(); } synchronized(this) { running = false; notifyAll(); } }
/** * wait for all pending packets to be acked. Then shutdown thread. */ @Override public void close() { synchronized(ackQueue) { while (isRunning() && ackQueue.size() != 0) { try { ackQueue.wait(); } catch (InterruptedException e) { running = false; Thread.currentThread().interrupt(); } } if(LOG.isDebugEnabled()) { LOG.debug(myString + ": closing"); } running = false; ackQueue.notifyAll(); } synchronized(this) { running = false; notifyAll(); } }
/** Wait for a packet with given {@code seqno} to be enqueued to ackQueue */ Packet waitForAckHead(long seqno) throws InterruptedException { synchronized(ackQueue) { while (isRunning() && ackQueue.size() == 0) { if (LOG.isDebugEnabled()) { LOG.debug(myString + ": seqno=" + seqno + " waiting for local datanode to finish write."); } ackQueue.wait(); } return isRunning() ? ackQueue.getFirst() : null; } }
/** Wait for a packet with given {@code seqno} to be enqueued to ackQueue */ Packet waitForAckHead(long seqno) throws InterruptedException { synchronized(ackQueue) { while (isRunning() && ackQueue.size() == 0) { if (LOG.isDebugEnabled()) { LOG.debug(myString + ": seqno=" + seqno + " waiting for local datanode to finish write."); } ackQueue.wait(); } return isRunning() ? ackQueue.getFirst() : null; } }