Tabnine Logo
ThrottlingException
Code IndexAdd Tabnine to your IDE (free)

How to use
ThrottlingException
in
org.apache.hadoop.hbase.quotas

Best Java code snippets using org.apache.hadoop.hbase.quotas.ThrottlingException (Showing top 20 results out of 315)

origin: apache/hbase

private static void throwThrottlingException(final Type type, final long waitInterval)
  throws ThrottlingException {
 String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + formatTime(waitInterval);
 throw new ThrottlingException(type, waitInterval, msg);
}
origin: apache/hbase

public static void throwNumWriteRequestsExceeded(final long waitInterval)
  throws ThrottlingException {
 throwThrottlingException(Type.NumWriteRequestsExceeded, waitInterval);
}
origin: apache/hbase

public ThrottlingException(String msg) {
 super(msg);
 // Dirty workaround to get the information after
 // ((RemoteException)e.getCause()).unwrapRemoteException()
 for (int i = 0; i < MSG_TYPE.length; ++i) {
  int index = msg.indexOf(MSG_TYPE[i]);
  if (index >= 0) {
   String waitTimeStr = msg.substring(index + MSG_TYPE[i].length() + MSG_WAIT.length());
   type = Type.values()[i];
   waitInterval = timeFromString(waitTimeStr);
   break;
  }
 }
}
origin: harbby/presto-connectors

@Override
public void checkQuota(long writeSize, long readSize) throws ThrottlingException {
 if (!reqsLimiter.canExecute()) {
  ThrottlingException.throwNumRequestsExceeded(reqsLimiter.waitInterval());
 }
 if (!reqSizeLimiter.canExecute(writeSize + readSize)) {
  ThrottlingException.throwRequestSizeExceeded(reqSizeLimiter
    .waitInterval(writeSize + readSize));
 }
 if (writeSize > 0) {
  if (!writeReqsLimiter.canExecute()) {
   ThrottlingException.throwNumWriteRequestsExceeded(writeReqsLimiter.waitInterval());
  }
  if (!writeSizeLimiter.canExecute(writeSize)) {
   ThrottlingException.throwWriteSizeExceeded(writeSizeLimiter.waitInterval(writeSize));
  }
 }
 if (readSize > 0) {
  if (!readReqsLimiter.canExecute()) {
   ThrottlingException.throwNumReadRequestsExceeded(readReqsLimiter.waitInterval());
  }
  if (!readSizeLimiter.canExecute(readSize)) {
   ThrottlingException.throwReadSizeExceeded(readSizeLimiter.waitInterval(readSize));
  }
 }
}
origin: stackoverflow.com

 @Before(pointcut="execution(* com.company.xyz.method())")
public void invoke() throws ThrottlingException {
  if (throttler.isThrottled(throttleKey)) {
    throw new ThrottlingException("Call Throttled");
  }
}
origin: harbby/presto-connectors

LOG.debug("Throttling exception for user=" + ugi.getUserName() + " table=" + table
  + " numWrites=" + numWrites + " numReads=" + numReads + " numScans=" + numScans + ": "
  + e.getMessage());
throw e;
origin: stackoverflow.com

 package de.scrum_master.aspect;

import java.util.Random;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

import de.scrum_master.app.ThrottlingException;

@Aspect
public class ThrottlingInterceptor {
  private static final Random RANDOM = new Random();

  @Before("execution(* doSomething())")
  public void invoke(JoinPoint thisJoinPoint) throws ThrottlingException {
    System.out.println(getClass().getSimpleName() + " -> " + thisJoinPoint);
    if (isThrottled()) {
      throw new ThrottlingException("call throttled");
    }
  }

  private boolean isThrottled() {
    return RANDOM.nextInt(3) > 0;
  }
}
origin: apache/hbase

public static void throwReadSizeExceeded(final long waitInterval)
  throws ThrottlingException {
 throwThrottlingException(Type.ReadSizeExceeded, waitInterval);
}
origin: org.apache.hbase/hbase-client

private static void throwThrottlingException(final Type type, final long waitInterval)
  throws ThrottlingException {
 String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + formatTime(waitInterval);
 throw new ThrottlingException(type, waitInterval, msg);
}
origin: org.apache.hbase/hbase-client

public ThrottlingException(String msg) {
 super(msg);
 // Dirty workaround to get the information after
 // ((RemoteException)e.getCause()).unwrapRemoteException()
 for (int i = 0; i < MSG_TYPE.length; ++i) {
  int index = msg.indexOf(MSG_TYPE[i]);
  if (index >= 0) {
   String waitTimeStr = msg.substring(index + MSG_TYPE[i].length() + MSG_WAIT.length());
   type = Type.values()[i];
   waitInterval = timeFromString(waitTimeStr);
   break;
  }
 }
}
origin: apache/hbase

public static void throwRequestSizeExceeded(final long waitInterval)
  throws ThrottlingException {
 throwThrottlingException(Type.RequestSizeExceeded, waitInterval);
}
origin: harbby/presto-connectors

private static void throwThrottlingException(final Type type, final long waitInterval)
  throws ThrottlingException {
 String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + formatTime(waitInterval);
 throw new ThrottlingException(type, waitInterval, msg);
}
origin: com.aliyun.hbase/alihbase-client

public ThrottlingException(String msg) {
 super(msg);
 // Dirty workaround to get the information after
 // ((RemoteException)e.getCause()).unwrapRemoteException()
 for (int i = 0; i < MSG_TYPE.length; ++i) {
  int index = msg.indexOf(MSG_TYPE[i]);
  if (index >= 0) {
   String waitTimeStr = msg.substring(index + MSG_TYPE[i].length() + MSG_WAIT.length());
   type = Type.values()[i];
   waitInterval = timeFromString(waitTimeStr);
   break;
  }
 }
}
origin: apache/hbase

public static void throwNumRequestsExceeded(final long waitInterval)
  throws ThrottlingException {
 throwThrottlingException(Type.NumRequestsExceeded, waitInterval);
}
origin: com.aliyun.hbase/alihbase-client

private static void throwThrottlingException(final Type type, final long waitInterval)
  throws ThrottlingException {
 String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + formatTime(waitInterval);
 throw new ThrottlingException(type, waitInterval, msg);
}
origin: harbby/presto-connectors

public ThrottlingException(String msg) {
 super(msg);
 // Dirty workaround to get the information after
 // ((RemoteException)e.getCause()).unwrapRemoteException()
 for (int i = 0; i < MSG_TYPE.length; ++i) {
  int index = msg.indexOf(MSG_TYPE[i]);
  if (index >= 0) {
   String waitTimeStr = msg.substring(index + MSG_TYPE[i].length() + MSG_WAIT.length());
   type = Type.values()[i];
   waitInterval = timeFromString(waitTimeStr);
   break;
  }
 }
}
origin: apache/hbase

public static void throwNumReadRequestsExceeded(final long waitInterval)
  throws ThrottlingException {
 throwThrottlingException(Type.NumReadRequestsExceeded, waitInterval);
}
origin: apache/hbase

public static void throwWriteSizeExceeded(final long waitInterval)
  throws ThrottlingException {
 throwThrottlingException(Type.WriteSizeExceeded, waitInterval);
}
origin: org.apache.hbase/hbase-client

public static void throwNumRequestsExceeded(final long waitInterval)
  throws ThrottlingException {
 throwThrottlingException(Type.NumRequestsExceeded, waitInterval);
}
origin: org.apache.hbase/hbase-client

public static void throwRequestSizeExceeded(final long waitInterval)
  throws ThrottlingException {
 throwThrottlingException(Type.RequestSizeExceeded, waitInterval);
}
org.apache.hadoop.hbase.quotasThrottlingException

Javadoc

Describe the throttling result. TODO: At some point this will be handled on the client side to prevent operation to go on the server if the waitInterval is grater than the one got as result of this exception.

Most used methods

  • <init>
  • formatTime
  • throwThrottlingException
  • timeFromString
  • getMessage
  • throwNumReadRequestsExceeded
  • throwNumRequestsExceeded
  • throwNumWriteRequestsExceeded
  • throwReadSizeExceeded
  • throwRequestSizeExceeded
  • throwWriteSizeExceeded
  • throwWriteSizeExceeded

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Menu (java.awt)
  • Kernel (java.awt.image)
  • Collectors (java.util.stream)
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now