/** * Creates a new OperationContext for the Azure Storage operation that has * listeners hooked to it that will update the metrics for this file system. * * @param bindConcurrentOOBIo * - bind to intercept send request call backs to handle OOB I/O. * * @return The OperationContext object to use. */ private OperationContext getInstrumentedContext(boolean bindConcurrentOOBIo) { OperationContext operationContext = new OperationContext(); if (selfThrottlingEnabled) { SelfThrottlingIntercept.hook(operationContext, selfThrottlingReadFactor, selfThrottlingWriteFactor); } if(bandwidthGaugeUpdater != null) { //bandwidthGaugeUpdater is null when we config to skip azure metrics ResponseReceivedMetricUpdater.hook( operationContext, instrumentation, bandwidthGaugeUpdater); } // Bind operation context to receive send request callbacks on this operation. // If reads concurrent to OOB writes are allowed, the interception will reset // the conditional header on all Azure blob storage read requests. if (bindConcurrentOOBIo) { SendRequestIntercept.bind(storageInteractionLayer.getCredentials(), operationContext, true); } if (testHookOperationContext != null) { operationContext = testHookOperationContext.modifyOperationContext(operationContext); } ErrorMetricUpdater.hook(operationContext, instrumentation); // Return the operation context. return operationContext; }
/** * Creates a new OperationContext for the Azure Storage operation that has * listeners hooked to it that will update the metrics for this file system. * * @param bindConcurrentOOBIo * - bind to intercept send request call backs to handle OOB I/O. * * @return The OperationContext object to use. */ private OperationContext getInstrumentedContext(boolean bindConcurrentOOBIo) { OperationContext operationContext = new OperationContext(); if (selfThrottlingEnabled) { SelfThrottlingIntercept.hook(operationContext, selfThrottlingReadFactor, selfThrottlingWriteFactor); } ResponseReceivedMetricUpdater.hook( operationContext, instrumentation, bandwidthGaugeUpdater); // Bind operation context to receive send request callbacks on this operation. // If reads concurrent to OOB writes are allowed, the interception will reset // the conditional header on all Azure blob storage read requests. if (bindConcurrentOOBIo) { SendRequestIntercept.bind(storageInteractionLayer.getCredentials(), operationContext, true); } if (testHookOperationContext != null) { operationContext = testHookOperationContext.modifyOperationContext(operationContext); } ErrorMetricUpdater.hook(operationContext, instrumentation); // Return the operation context. return operationContext; }