AbfsPerfLoggableAbfsAHCHttpOperation, AbfsHttpOperation.AbfsHttpOperationWithFixedResult, AbfsJdkHttpOperationpublic abstract class AbfsHttpOperation extends java.lang.Object implements AbfsPerfLoggable
For JDK netlib usage, the child class would be AbfsJdkHttpOperation.
For ApacheHttpClient netlib usage, the child class would be AbfsAHCHttpOperation.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
AbfsHttpOperation.AbfsHttpOperationWithFixedResult |
| Modifier | Constructor | Description |
|---|---|---|
protected |
AbfsHttpOperation(java.net.URL url,
java.lang.String method,
int httpStatus) |
Constructor for FixedResult instance, avoiding connection init.
|
|
AbfsHttpOperation(org.slf4j.Logger log,
java.net.URL url,
java.lang.String method,
java.util.List<AbfsHttpHeader> requestHeaders,
java.time.Duration connectionTimeout,
java.time.Duration readTimeout) |
| Modifier and Type | Method | Description |
|---|---|---|
static AbfsHttpOperation |
getAbfsHttpOperationWithFixedResult(java.net.URL url,
java.lang.String method,
int httpStatus) |
|
long |
getBytesReceived() |
|
int |
getBytesSent() |
|
java.lang.String |
getClientRequestId() |
|
protected abstract java.io.InputStream |
getContentInputStream() |
Get the response stream from the connection.
|
protected abstract java.io.InputStream |
getErrorStream() |
Get the error stream from the connection.
|
java.lang.String |
getExpectedAppendPos() |
|
int |
getExpectedBytesToBeSent() |
|
java.lang.String |
getHost() |
|
ListResultSchema |
getListResultSchema() |
|
java.lang.String |
getLogString() |
Gets the string to log to the Abfs Logging API.
|
java.lang.String |
getMaskedEncodedUrl() |
|
java.lang.String |
getMaskedUrl() |
|
java.lang.String |
getMethod() |
|
long |
getRecvLatency() |
|
java.lang.String |
getRequestId() |
|
abstract java.lang.String |
getResponseHeader(java.lang.String httpHeader) |
Get response header value for the given headerKey.
|
long |
getSendLatency() |
|
int |
getStatusCode() |
|
java.lang.String |
getStatusDescription() |
|
java.lang.String |
getStorageErrorCode() |
|
java.lang.String |
getStorageErrorMessage() |
|
abstract java.lang.String |
getTracingContextSuffix() |
Get the suffix to add to the tracing context that defines what http-client is
used to make the network call
|
java.net.URL |
getUrl() |
|
protected boolean |
isConnectionDisconnectedOnError() |
|
abstract void |
processResponse(byte[] buffer,
int offset,
int length) |
Gets and processes the HTTP response.
|
abstract void |
sendPayload(byte[] buffer,
int offset,
int length) |
Sends the HTTP request.
|
protected void |
setBytesSent(int bytesSent) |
Sets byteSent metric.
|
protected void |
setConnectionDisconnectedOnError() |
Marks network error and expect100 failures for send-payload phase.
|
protected void |
setConnectionTimeMs(long connectionTimeMs) |
Sets connection time in milliseconds taken to establish the connection.
|
protected void |
setExpectedBytesToBeSent(int expectedBytesToBeSent) |
Sets expected bytes to be sent.
|
void |
setMaskForSAS() |
|
protected void |
setRecvResponseTimeMs(long recvResponseTimeMs) |
Sets receive response time in milliseconds.
|
protected void |
setRequestId() |
Set x-ms-request-id value from the server call response header.
|
abstract void |
setRequestProperty(java.lang.String key,
java.lang.String value) |
Set request header.
|
protected void |
setSendRequestTimeMs(long sendRequestTimeMs) |
Sets send request time in milliseconds.
|
protected void |
setStatusCode(int statusCode) |
Set response status code for the server call.
|
protected void |
setStatusDescription(java.lang.String statusDescription) |
Sets response status description for the server call.
|
java.lang.String |
toString() |
public AbfsHttpOperation(org.slf4j.Logger log,
java.net.URL url,
java.lang.String method,
java.util.List<AbfsHttpHeader> requestHeaders,
java.time.Duration connectionTimeout,
java.time.Duration readTimeout)
protected AbfsHttpOperation(java.net.URL url,
java.lang.String method,
int httpStatus)
url - request urlmethod - Http methodhttpStatus - HttpStatuspublic static AbfsHttpOperation getAbfsHttpOperationWithFixedResult(java.net.URL url, java.lang.String method, int httpStatus)
public java.lang.String getMethod()
public java.lang.String getHost()
public int getStatusCode()
public java.lang.String getStatusDescription()
public java.lang.String getStorageErrorCode()
public java.lang.String getStorageErrorMessage()
public java.lang.String getClientRequestId()
public java.lang.String getExpectedAppendPos()
public java.lang.String getRequestId()
public void setMaskForSAS()
public int getBytesSent()
public int getExpectedBytesToBeSent()
public long getBytesReceived()
public java.net.URL getUrl()
public ListResultSchema getListResultSchema()
public abstract java.lang.String getResponseHeader(java.lang.String httpHeader)
httpHeader - header key.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getLogString()
AbfsPerfLoggablegetLogString in interface AbfsPerfLoggable@VisibleForTesting public java.lang.String getMaskedUrl()
public final java.lang.String getMaskedEncodedUrl()
public abstract void sendPayload(byte[] buffer,
int offset,
int length)
throws java.io.IOException
buffer - the request entity body.offset - an offset into the buffer where the data beings.length - the length of the data in the buffer.java.io.IOException - if an error occurs.public abstract void processResponse(byte[] buffer,
int offset,
int length)
throws java.io.IOException
buffer - a buffer to hold the response entity bodyoffset - an offset in the buffer where the data will being.length - the number of bytes to be written to the buffer.java.io.IOException - if an error occurs.public abstract void setRequestProperty(java.lang.String key,
java.lang.String value)
key - header key.value - header value.protected abstract java.io.InputStream getContentInputStream()
throws java.io.IOException
java.io.IOException - if the response stream could not be created from the connection.protected abstract java.io.InputStream getErrorStream()
throws java.io.IOException
java.io.IOException - if the error stream could not be created from the response stream.public abstract java.lang.String getTracingContextSuffix()
public final long getSendLatency()
public final long getRecvLatency()
protected void setStatusCode(int statusCode)
statusCode - status code.protected void setStatusDescription(java.lang.String statusDescription)
statusDescription - status description.protected void setRequestId()
protected void setBytesSent(int bytesSent)
bytesSent - bytes sent.protected void setExpectedBytesToBeSent(int expectedBytesToBeSent)
expectedBytesToBeSent - expected bytes to be sent.protected void setConnectionTimeMs(long connectionTimeMs)
connectionTimeMs - connection time in milliseconds.protected void setSendRequestTimeMs(long sendRequestTimeMs)
sendRequestTimeMs - send request time in milliseconds.protected void setRecvResponseTimeMs(long recvResponseTimeMs)
recvResponseTimeMs - receive response time in milliseconds.protected void setConnectionDisconnectedOnError()
protected boolean isConnectionDisconnectedOnError()
connectionDisconnectedOnErrorCopyright © 2008–2025 Apache Software Foundation. All rights reserved.