congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.apache.hadoop.hbase.quotas
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: apache/hbase

public void stop() {
 if (isQuotaEnabled()) {
  quotaCache.stop("shutdown");
 }
}
origin: apache/hbase

/**
 * Returns the correct instance of {@link FileArchiverNotifier} for the given table name.
 *
 * @param tn The table name
 * @return A {@link FileArchiverNotifier} instance
 */
FileArchiverNotifier getNotifierForTable(TableName tn) {
 return FileArchiverNotifierFactoryImpl.getInstance().get(conn, conf, fs, tn);
}
origin: apache/hbase

/**
 * Returns the limiter associated to the specified table.
 *
 * @param table the table to limit
 * @return the limiter associated to the specified table
 */
public QuotaLimiter getTableLimiter(final TableName table) {
 return getQuotaState(this.tableQuotaCache, table).getGlobalLimiter();
}
origin: apache/hbase

 @Override
 public boolean evaluate() throws Exception {
  ActivePolicyEnforcement enforcements = manager.getActiveEnforcements();
  SpaceViolationPolicyEnforcement enforcement = enforcements.getPolicyEnforcement(tn);
  // Signifies that we're waiting on the quota snapshot to be fetched
  if (enforcement instanceof MissingSnapshotViolationPolicyEnforcement) {
   return false;
  }
  return enforcement.getQuotaSnapshot().getQuotaStatus().isInViolation();
 }
});
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

/**
 * Checks if the given <code>snapshot</code> is in violation, allowing the snapshot to be null.
 * If the snapshot is null, this is interpreted as no snapshot which implies not in violation.
 *
 * @param snapshot The snapshot to operate on.
 * @return true if the snapshot is in violation, false otherwise.
 */
boolean isInViolation(SpaceQuotaSnapshot snapshot) {
 if (snapshot == null) {
  return false;
 }
 return snapshot.getQuotaStatus().isInViolation();
}
origin: apache/hbase

/**
 * Creates an object well-suited for the RegionServer to use in verifying active policies.
 */
public ActivePolicyEnforcement getActiveEnforcements() {
 return new ActivePolicyEnforcement(copyActiveEnforcements(), copyQuotaSnapshots(), rsServices);
}
origin: apache/hbase

 @Override
 protected QuotaGlobalsSettingsBypass merge(QuotaSettings newSettings) throws IOException {
  if (newSettings instanceof QuotaGlobalsSettingsBypass) {
   QuotaGlobalsSettingsBypass other = (QuotaGlobalsSettingsBypass) newSettings;
   validateQuotaTarget(other);
   if (getBypass() != other.getBypass()) {
    return other;
   }
  }
  return this;
 }
}
origin: apache/hbase

@Override
public void addScanResult(final List<Result> results) {
 operationSize[OperationType.SCAN.ordinal()] += QuotaUtil.calculateResultSize(results);
}
origin: apache/hbase

@Override
public void addMutation(final Mutation mutation) {
 operationSize[OperationType.MUTATE.ordinal()] += QuotaUtil.calculateMutationSize(mutation);
}
origin: apache/hbase

/**
 * Remove the throttling for the specified user on the specified table.
 *
 * @param userName the user
 * @param tableName the table
 * @return the quota settings
 */
public static QuotaSettings unthrottleUser(final String userName, final TableName tableName) {
 return throttle(userName, tableName, null, null, null, 0, null);
}
origin: apache/hbase

 @Override
 public boolean evaluate(SpaceQuotaSnapshot snapshot) throws Exception {
  return snapshot.getUsage() >= finalSize;
 }
});
origin: apache/hbase

public synchronized void stop() {
 if (spaceQuotaRefresher != null) {
  spaceQuotaRefresher.cancel();
  spaceQuotaRefresher = null;
 }
 if (regionSizeReporter != null) {
  regionSizeReporter.cancel();
  regionSizeReporter = null;
 }
 started = false;
}
origin: apache/hbase

 @Override
 public Void call() throws Exception {
  try (Connection conn = getConnection()) {
   helper.writeData(tn, 3L * SpaceQuotaHelperForTests.ONE_MEGABYTE);
   return null;
  }
 }
});
origin: apache/hbase

/**
 * Returns the limiter associated to the specified namespace.
 *
 * @param namespace the namespace to limit
 * @return the limiter associated to the specified namespace
 */
public QuotaLimiter getNamespaceLimiter(final String namespace) {
 return getQuotaState(this.namespaceQuotaCache, namespace).getGlobalLimiter();
}
origin: apache/hbase

@Override
public void addGetResult(final Result result) {
 operationSize[OperationType.GET.ordinal()] += QuotaUtil.calculateResultSize(result);
}
origin: apache/hbase

/**
 * Remove the throttling for the specified user on the specified namespace.
 *
 * @param userName the user
 * @param namespace the namespace
 * @return the quota settings
 */
public static QuotaSettings unthrottleUser(final String userName, final String namespace) {
 return throttle(userName, null, namespace, null, null, 0, null);
}
origin: apache/hbase

 @Override
 public Void call() throws Exception {
  try (Connection conn = getConnection()) {
   helper.writeData(tn, 3L * SpaceQuotaHelperForTests.ONE_MEGABYTE);
   return null;
  }
 }
});
origin: apache/hbase

/**
 * Returns the limiter associated to the specified region server.
 *
 * @param regionServer the region server to limit
 * @return the limiter associated to the specified region server
 */
public QuotaLimiter getRegionServerQuotaLimiter(final String regionServer) {
 return getQuotaState(this.regionServerQuotaCache, regionServer).getGlobalLimiter();
}
origin: apache/hbase

/**
 * Remove the throttling for the specified region server.
 *
 * @param regionServer the region Server
 * @return the quota settings
 */
public static QuotaSettings unthrottleRegionServer(final String regionServer) {
 return throttle(null, null, null, regionServer, null, 0, null);
}
org.apache.hadoop.hbase.quotas

Most used classes

  • QuotaSettingsFactory
  • QuotaFilter
    Filter to use to filter the QuotaRetriever results.
  • QuotaSettings
  • QuotaRetriever
    Scanner to iterate over the quota settings.
  • QuotaSettingsFactory$QuotaGlobalsSettingsBypass
  • SpaceLimitSettings,
  • ThrottleSettings,
  • RpcThrottlingException,
  • SpaceQuotaSnapshot$SpaceQuotaStatus,
  • SpaceQuotaSnapshot,
  • SpaceViolationPolicy,
  • ThrottlingException,
  • AverageIntervalRateLimiter,
  • FixedIntervalRateLimiter,
  • MasterQuotaManager,
  • NoopQuotaLimiter,
  • QuotaCache,
  • QuotaLimiter,
  • QuotaRetriever$Iter
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