public abstract class BaseJdkHttpAccessor<K extends EntryKey> extends Loggable
| Modifier and Type | Field and Description |
|---|---|
protected static com.fasterxml.storemate.shared.util.BufferRecycler |
_bufferRecycler
We can reuse read buffers as they are somewhat costly to
allocate, reallocate all the time.
|
protected EntryKeyConverter<K> |
_keyConverter |
protected com.fasterxml.jackson.databind.ObjectMapper |
_mapper |
protected RequestPathStrategy<?> |
_pathFinder |
protected ClusterServerNode |
_server |
protected static int |
CHUNK_SIZE
Not sure what is optimal chunk size, but 16k sounds like
a reasonable starting point.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BaseJdkHttpAccessor(StoreClientConfig<K,?> storeConfig,
ClusterServerNode server) |
| Modifier and Type | Method and Description |
|---|---|
protected static Throwable |
_unwrap(Throwable t) |
protected JdkHttpClientPathBuilder |
addChecksum(JdkHttpClientPathBuilder path,
int checksum) |
protected long |
copy(InputStream in,
OutputStream out,
boolean closeInput) |
protected void |
drain(HttpURLConnection conn,
int statusCode) |
protected void |
drain(InputStream in) |
protected CallFailure |
failFromException(Exception e0,
long startTime) |
protected ContentType |
findContentType(HttpURLConnection conn,
ContentType defaultType) |
protected byte[] |
fromBase64(String b64str) |
protected String |
getExcerpt(HttpURLConnection conn,
int statusCode,
int maxLen) |
protected String |
getExcerpt(InputStream in,
int maxLen) |
protected void |
handleHeaders(ClusterServerNode server,
HttpURLConnection conn,
long requestTime)
Helper method that takes care of processing state based on any
standard headers we might pick up
|
protected HttpURLConnection |
initRequest(String method,
HttpURLConnection conn,
JdkHttpClientPathBuilder path,
long timeoutMsecs) |
protected long |
parseLongHeader(HttpURLConnection conn,
String headerName) |
protected int |
sendRequest(String method,
HttpURLConnection conn,
JdkHttpClientPathBuilder path,
long timeoutMsecs)
Helper method that encapsulates logic of setting various connection
settings, and then forcing sending of the request.
|
protected String |
toBase64(byte[] data) |
protected static final int CHUNK_SIZE
protected static final com.fasterxml.storemate.shared.util.BufferRecycler _bufferRecycler
protected final com.fasterxml.jackson.databind.ObjectMapper _mapper
protected final RequestPathStrategy<?> _pathFinder
protected EntryKeyConverter<K extends EntryKey> _keyConverter
protected final ClusterServerNode _server
protected BaseJdkHttpAccessor(StoreClientConfig<K,?> storeConfig, ClusterServerNode server)
protected long parseLongHeader(HttpURLConnection conn, String headerName)
protected int sendRequest(String method, HttpURLConnection conn, JdkHttpClientPathBuilder path, long timeoutMsecs) throws IOException
IOExceptionprotected HttpURLConnection initRequest(String method, HttpURLConnection conn, JdkHttpClientPathBuilder path, long timeoutMsecs) throws IOException
IOExceptionprotected JdkHttpClientPathBuilder addChecksum(JdkHttpClientPathBuilder path, int checksum)
protected void handleHeaders(ClusterServerNode server, HttpURLConnection conn, long requestTime)
protected ContentType findContentType(HttpURLConnection conn, ContentType defaultType)
protected long copy(InputStream in, OutputStream out, boolean closeInput) throws IOException
IOExceptionprotected void drain(HttpURLConnection conn, int statusCode)
protected void drain(InputStream in)
protected String getExcerpt(HttpURLConnection conn, int statusCode, int maxLen)
protected String getExcerpt(InputStream in, int maxLen) throws IOException
IOExceptionprotected CallFailure failFromException(Exception e0, long startTime)
protected byte[] fromBase64(String b64str)
protected String toBase64(byte[] data)
Copyright © 2012-2014 fasterxml.com. All Rights Reserved.