code: func (w *RateLimitedDirectoryWrapper) SetMaxWriteMBPerSec(mbPerSec float64, context int) {
  	if !w.isOpen {
  		panic("this Directory is closed")
  	}
  	if context == 0 {
  		panic("Context must not be nil")
  	}
  	ord := context - 1
  	limiter := w.contextRateLimiters[ord]
  	if mbPerSec <= 0 {
  		if limiter != nil {
  			limiter.SetMbPerSec(math.MaxFloat64)
  			w.contextRateLimiters[ord] = nil
  			// atomic.StorePointer(&(w.contextRateLimiters[ord]), nil)
  		}
  	} else if limiter != nil {
  		limiter.SetMbPerSec(mbPerSec)
  		// atomic.StorePointer(&(w.contextRateLimiters[ord]), limiter) // cross the mem barrier again
  	} else {
  		w.contextRateLimiters[ord] = newSimpleRateLimiter(mbPerSec)
  		// atomic.StorePointer(&(w.contextRateLimiters[ord]), newSimpleRateLimiter(mbPerSec))
  	}
  }
docs: /*
  Sets the maximum (approx) MB/sec allowed by all write IO performed by
  IndexOutput created with the given context. Pass non-positve value to
  have no limit.
  
  NOTE: For already created IndexOutput instances there is no guarantee
  this new rate will apply to them; it will only be guaranteed to apply
  for new created IndexOutput instances.
  
  NOTE: this is an optional operation and might not be respected by all
  Directory implementations. Currently only buffered Directory
  implementations use rate-limiting.
  */