本文整理汇总了Java中com.microsoft.azure.storage.RequestResult类的典型用法代码示例。如果您正苦于以下问题:Java RequestResult类的具体用法?Java RequestResult怎么用?Java RequestResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RequestResult类属于com.microsoft.azure.storage包,在下文中一共展示了RequestResult类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: responseReceived
import com.microsoft.azure.storage.RequestResult; //导入依赖的package包/类
public void responseReceived(ResponseReceivedEvent event) {
RequestResult result = event.getRequestResult();
Date startDate = result.getStartDate();
Date stopDate = result.getStopDate();
long elapsed = stopDate.getTime() - startDate.getTime();
synchronized (this) {
this.lastE2Elatency = elapsed;
}
if (LOG.isDebugEnabled()) {
int statusCode = result.getStatusCode();
String etag = result.getEtag();
HttpURLConnection urlConnection = (HttpURLConnection) event
.getConnectionObject();
int contentLength = urlConnection.getContentLength();
String requestMethod = urlConnection.getRequestMethod();
long threadId = Thread.currentThread().getId();
LOG.debug(String
.format(
"SelfThrottlingIntercept:: ResponseReceived: threadId=%d, Status=%d, Elapsed(ms)=%d, ETAG=%s, contentLength=%d, requestMethod=%s",
threadId, statusCode, elapsed, etag, contentLength, requestMethod));
}
}
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:SelfThrottlingIntercept.java
示例2: eventOccurred
import com.microsoft.azure.storage.RequestResult; //导入依赖的package包/类
@Override
public void eventOccurred(ResponseReceivedEvent eventArg) {
RequestResult currentResult = operationContext.getLastResult();
int statusCode = currentResult.getStatusCode();
// Check if it's a client-side error: a 4xx status
// We exclude 404 because it happens frequently during the normal
// course of operation (each call to exists() would generate that
// if it's not found).
if (statusCode >= HTTP_BAD_REQUEST && statusCode < HTTP_INTERNAL_ERROR
&& statusCode != HTTP_NOT_FOUND) {
instrumentation.clientErrorEncountered();
} else if (statusCode >= HTTP_INTERNAL_ERROR) {
// It's a server error: a 5xx status. Could be an Azure Storage
// bug or (more likely) throttling.
instrumentation.serverErrorEncountered();
}
}
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:ErrorMetricUpdater.java
示例3: initialize
import com.microsoft.azure.storage.RequestResult; //导入依赖的package包/类
/**
* Resets the operation status flags between operations.
*/
protected final void initialize(OperationContext opContext) {
RequestResult currResult = new RequestResult();
this.setResult(currResult);
opContext.appendRequestResult(currResult);
this.setException(null);
this.setNonExceptionedRetryableFailure(false);
this.setIsSent(false);
}
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:13,代码来源:StorageRequest.java
示例4: fireSendingRequestEvent
import com.microsoft.azure.storage.RequestResult; //导入依赖的package包/类
/**
* Fires events representing that a request will be sent.
*/
private static void fireSendingRequestEvent(OperationContext opContext, HttpURLConnection request,
RequestResult result) {
if (opContext.getSendingRequestEventHandler().hasListeners()
|| OperationContext.getGlobalSendingRequestEventHandler().hasListeners()) {
SendingRequestEvent event = new SendingRequestEvent(opContext, request, result);
opContext.getSendingRequestEventHandler().fireEvent(event);
OperationContext.getGlobalSendingRequestEventHandler().fireEvent(event);
}
}
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:13,代码来源:ExecutionEngine.java
示例5: fireResponseReceivedEvent
import com.microsoft.azure.storage.RequestResult; //导入依赖的package包/类
/**
* Fires events representing that a response has been received.
*/
private static void fireResponseReceivedEvent(OperationContext opContext, HttpURLConnection request,
RequestResult result) {
if (opContext.getResponseReceivedEventHandler().hasListeners()
|| OperationContext.getGlobalResponseReceivedEventHandler().hasListeners()) {
ResponseReceivedEvent event = new ResponseReceivedEvent(opContext, request, result);
opContext.getResponseReceivedEventHandler().fireEvent(event);
OperationContext.getGlobalResponseReceivedEventHandler().fireEvent(event);
}
}
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:13,代码来源:ExecutionEngine.java
示例6: fireRequestCompletedEvent
import com.microsoft.azure.storage.RequestResult; //导入依赖的package包/类
/**
* Fires events representing that a response received from the service is fully processed.
*/
private static void fireRequestCompletedEvent(OperationContext opContext, HttpURLConnection request,
RequestResult result) {
if (opContext.getRequestCompletedEventHandler().hasListeners()
|| OperationContext.getGlobalRequestCompletedEventHandler().hasListeners()) {
RequestCompletedEvent event = new RequestCompletedEvent(opContext, request, result);
opContext.getRequestCompletedEventHandler().fireEvent(event);
OperationContext.getGlobalRequestCompletedEventHandler().fireEvent(event);
}
}
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:13,代码来源:ExecutionEngine.java
示例7: fireRetryingEvent
import com.microsoft.azure.storage.RequestResult; //导入依赖的package包/类
/**
* Fires events representing that a request will be retried.
*/
private static void fireRetryingEvent(OperationContext opContext, HttpURLConnection request, RequestResult result,
RetryContext retryContext) {
if (opContext.getRetryingEventHandler().hasListeners()
|| OperationContext.getGlobalRetryingEventHandler().hasListeners()) {
RetryingEvent event = new RetryingEvent(opContext, request, result, retryContext);
opContext.getRetryingEventHandler().fireEvent(event);
OperationContext.getGlobalRetryingEventHandler().fireEvent(event);
}
}
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:13,代码来源:ExecutionEngine.java
示例8: getResult
import com.microsoft.azure.storage.RequestResult; //导入依赖的package包/类
/**
* @return the result
*/
public final RequestResult getResult() {
return this.result;
}
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:7,代码来源:StorageRequest.java
示例9: generateTableServiceException
import com.microsoft.azure.storage.RequestResult; //导入依赖的package包/类
/**
* Reserved for internal use. A static factory method to create a {@link TableServiceException} instance using
* the specified parameters.
*
* @param retryable
* <code>true</code> if the table operation can be retried; otherwise, <code>false</code>.
* @param res
* A {@link RequestResult} containing the result of the table storage service operation.
* @param op
* The {@link TableOperation} representing the table operation that caused the exception.
* @param inStream
* The <code>java.io.InputStream</code> of the error response from the table operation request.
* @param format
* The {@link TablePayloadFormat} to use for parsing
* @return
* A {@link TableServiceException} instance initialized with values from the input parameters.
*/
protected static TableServiceException generateTableServiceException(boolean retryable, RequestResult res,
TableOperation op, InputStream inStream, TablePayloadFormat format) {
TableServiceException retryableException = new TableServiceException(res.getStatusCode(),
res.getStatusMessage(), op, new InputStreamReader(inStream), format);
retryableException.retryable = retryable;
return retryableException;
}
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:26,代码来源:TableServiceException.java
示例10: setResult
import com.microsoft.azure.storage.RequestResult; //导入依赖的package包/类
/**
* @param result
* the result to set
*/
public final void setResult(final RequestResult result) {
this.result = result;
}
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:8,代码来源:StorageRequest.java
示例11: generateTableServiceException
import com.microsoft.azure.storage.RequestResult; //导入依赖的package包/类
/**
* Reserved for internal use. A static factory method to create a {@link TableServiceException} instance using
* the specified parameters.
* @param res
* A {@link RequestResult} containing the result of the table storage service operation.
* @param op
* The {@link TableOperation} representing the table operation that caused the exception.
* @param inStream
* The <code>java.io.InputStream</code> of the error response from the table operation request.
* @param format
* The {@link TablePayloadFormat} to use for parsing
*
* @return
* A {@link TableServiceException} instance initialized with values from the input parameters.
*/
protected static TableServiceException generateTableServiceException(RequestResult res, TableOperation op,
InputStream inStream, TablePayloadFormat format) {
return new TableServiceException(res.getStatusCode(), res.getStatusMessage(), op,
new InputStreamReader(inStream), format);
}
开发者ID:Azure,项目名称:azure-storage-android,代码行数:21,代码来源:TableServiceException.java
注:本文中的com.microsoft.azure.storage.RequestResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论