Class IOThread
- java.lang.Object
-
- com.yahoo.vespa.http.client.core.communication.IOThread
-
- All Implemented Interfaces:
AutoCloseable
,Runnable
public class IOThread extends Object implements Runnable, AutoCloseable
Thread which feeds document operations asynchronously and processes the results.- Author:
- Einar M R Rosenvinge
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IOThread.ConnectionStats
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
GatewayConnection
currentConnection()
For testing.IOThread.ConnectionStats
getConnectionStats()
Returns a snapshot of counters.Endpoint
getEndpoint()
List<GatewayConnection>
oldConnections()
For testing.void
post(Document document)
For testing onlycom.yahoo.vespa.http.client.core.communication.EndpointResultQueue
resultQueue()
For testingvoid
run()
void
tick()
Do one iteration of work.String
toString()
-
-
-
Method Detail
-
getEndpoint
public Endpoint getEndpoint()
-
getConnectionStats
public IOThread.ConnectionStats getConnectionStats()
Returns a snapshot of counters. Threadsafe.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
post
public void post(Document document) throws InterruptedException
For testing only- Throws:
InterruptedException
-
tick
public void tick()
Do one iteration of work. Should be called from the single worker thread of this.
-
currentConnection
public GatewayConnection currentConnection()
For testing. Returns the current connection of this. Not thread safe.
-
oldConnections
public List<GatewayConnection> oldConnections()
For testing. Returns a snapshot of the old connections of this.
-
resultQueue
public com.yahoo.vespa.http.client.core.communication.EndpointResultQueue resultQueue()
For testing
-
-