public class OutputContext extends Object
MemcachedServer class to simulate network
slowness.| Constructor and Description |
|---|
OutputContext(List<ByteBuffer> origBufs)
Create a new OuputContext
|
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer[] |
getIov()
Get an array of buffers representing all the active chunks
|
OutputContext |
getSlice(int limit)
Get an OutputBuffer containing a subset of the current one
|
boolean |
hasRemaining()
Check if there are unsent chunks
|
List<ByteBuffer> |
releaseRemaining()
Truncate the output.
|
String |
toString() |
void |
updateBytesSent(long num)
Indicate that some data has been flushed to the network
|
public OutputContext(List<ByteBuffer> origBufs)
origBufs - A list of buffers which should be set as the initial buffers. If empty, additional buffers
will be created as neededpublic ByteBuffer[] getIov()
public boolean hasRemaining()
public OutputContext getSlice(int limit)
limit - How many bytes should be availablepublic void updateBytesSent(long num)
num - ignored for now. This is because each individual ByteBuffer keeps track
of how many of its bytes were sentpublic List<ByteBuffer> releaseRemaining()
Copyright © 2017. All rights reserved.