@InterfaceAudience.Private public class SpaceQuotaHelperForTests extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
SpaceQuotaHelperForTests.NoFilesToDischarge
Predicate that waits for all store files in a table to have no compacted files.
|
(package private) static class |
SpaceQuotaHelperForTests.SpaceQuotaSnapshotPredicate
Abstraction to simplify the case where a test needs to verify a certain state
on a
SpaceQuotaSnapshot . |
Modifier and Type | Field and Description |
---|---|
private AtomicLong |
counter |
static String |
F1 |
private static org.slf4j.Logger |
LOG |
private static int |
NUM_RETRIES |
static long |
ONE_GIGABYTE |
static long |
ONE_KILOBYTE |
static long |
ONE_MEGABYTE |
static int |
SIZE_PER_VALUE |
private org.junit.rules.TestName |
testName |
private HBaseTestingUtility |
testUtil |
Constructor and Description |
---|
SpaceQuotaHelperForTests(HBaseTestingUtility testUtil,
org.junit.rules.TestName testName,
AtomicLong counter) |
Modifier and Type | Method and Description |
---|---|
(package private) org.apache.hadoop.hbase.NamespaceDescriptor |
createNamespace() |
(package private) org.apache.hadoop.hbase.NamespaceDescriptor |
createNamespace(String namespace) |
(package private) org.apache.hadoop.hbase.TableName |
createTable() |
(package private) org.apache.hadoop.hbase.TableName |
createTableInNamespace(org.apache.hadoop.hbase.NamespaceDescriptor nd) |
(package private) org.apache.hbase.thirdparty.com.google.common.collect.Multimap<org.apache.hadoop.hbase.TableName,org.apache.hadoop.hbase.quotas.QuotaSettings> |
createTablesWithSpaceQuotas() |
(package private) org.apache.hadoop.hbase.TableName |
createTableWithRegions(org.apache.hadoop.hbase.client.Admin admin,
int numRegions) |
(package private) org.apache.hadoop.hbase.TableName |
createTableWithRegions(org.apache.hadoop.hbase.client.Admin admin,
String namespace,
int numRegions,
int numberOfReplicas) |
(package private) org.apache.hadoop.hbase.TableName |
createTableWithRegions(int numRegions) |
(package private) org.apache.hadoop.hbase.TableName |
createTableWithRegions(String namespace,
int numRegions) |
(package private) org.apache.hadoop.hbase.client.ClientServiceCallable<Void> |
generateFileToLoad(org.apache.hadoop.hbase.TableName tn,
int numFiles,
int numRowsPerFile) |
(package private) org.apache.hadoop.hbase.TableName |
getNextTableName() |
(package private) org.apache.hadoop.hbase.TableName |
getNextTableName(String namespace) |
(package private) org.apache.hadoop.hbase.quotas.QuotaSettings |
getTableSpaceQuota(org.apache.hadoop.hbase.client.Connection conn,
org.apache.hadoop.hbase.TableName tn) |
(package private) long |
listNumDefinedQuotas(org.apache.hadoop.hbase.client.Connection conn)
Returns the number of quotas defined in the HBase quota table.
|
(package private) void |
partitionTablesByQuotaTarget(org.apache.hbase.thirdparty.com.google.common.collect.Multimap<org.apache.hadoop.hbase.TableName,org.apache.hadoop.hbase.quotas.QuotaSettings> quotas,
Set<org.apache.hadoop.hbase.TableName> tablesWithTableQuota,
Set<org.apache.hadoop.hbase.TableName> tablesWithNamespaceQuota) |
(package private) void |
removeAllQuotas()
Removes all quotas defined in the HBase quota table.
|
(package private) void |
removeAllQuotas(org.apache.hadoop.hbase.client.Connection conn)
Removes all quotas defined in the HBase quota table.
|
(package private) void |
removeQuotaFromNamespace(String ns)
Removes the space quota from the given namespace
|
(package private) void |
removeQuotaFromtable(org.apache.hadoop.hbase.TableName tn)
Removes the space quota from the given table
|
(package private) void |
setQuotaLimit(String ns,
org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policy,
long sizeInMBs)
Sets the given quota (policy & limit) on the passed namespace.
|
(package private) void |
setQuotaLimit(org.apache.hadoop.hbase.TableName tn,
org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policy,
long sizeInMBs)
Sets the given quota (policy & limit) on the passed table.
|
(package private) static void |
updateConfigForQuotas(org.apache.hadoop.conf.Configuration conf) |
(package private) void |
verifyNoViolation(org.apache.hadoop.hbase.TableName tn,
org.apache.hadoop.hbase.client.Mutation m)
Verifies that no policy has been violated on the given table
|
(package private) void |
verifyTableUsageSnapshotForSpaceQuotaExist(org.apache.hadoop.hbase.TableName tn)
Verifies that table usage snapshot exists for the table
|
(package private) void |
verifyViolation(org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policyToViolate,
org.apache.hadoop.hbase.TableName tn,
org.apache.hadoop.hbase.client.Mutation m)
Verifies that the given policy on the given table has been violated
|
void |
waitForQuotaTable(org.apache.hadoop.hbase.client.Connection conn)
Waits 30seconds for the HBase quota table to exist.
|
void |
waitForQuotaTable(org.apache.hadoop.hbase.client.Connection conn,
long timeout)
Waits
timeout milliseconds for the HBase quota table to exist. |
(package private) void |
writeData(org.apache.hadoop.hbase.client.Connection conn,
org.apache.hadoop.hbase.TableName tn,
long sizeInBytes) |
(package private) void |
writeData(org.apache.hadoop.hbase.TableName tn,
long sizeInBytes) |
(package private) void |
writeData(org.apache.hadoop.hbase.TableName tn,
long sizeInBytes,
byte[] qual) |
(package private) void |
writeData(org.apache.hadoop.hbase.TableName tn,
long sizeInBytes,
String qual) |
(package private) org.apache.hadoop.hbase.TableName |
writeUntilViolation(org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policyToViolate)
Writes the given mutation into a table until it violates the given policy.
|
(package private) org.apache.hadoop.hbase.TableName |
writeUntilViolationAndVerifyViolation(org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policyToViolate,
org.apache.hadoop.hbase.client.Mutation m)
Writes the given mutation into a table until it violates the given policy.
|
(package private) org.apache.hadoop.hbase.TableName |
writeUntilViolationAndVerifyViolationInNamespace(String ns,
org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policyToViolate,
org.apache.hadoop.hbase.client.Mutation m) |
(package private) org.apache.hadoop.hbase.TableName |
writeUntilViolationInNamespace(String ns,
org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policyToViolate) |
private static final org.slf4j.Logger LOG
public static final int SIZE_PER_VALUE
public static final String F1
public static final long ONE_KILOBYTE
public static final long ONE_MEGABYTE
public static final long ONE_GIGABYTE
private final HBaseTestingUtility testUtil
private final org.junit.rules.TestName testName
private final AtomicLong counter
private static final int NUM_RETRIES
public SpaceQuotaHelperForTests(HBaseTestingUtility testUtil, org.junit.rules.TestName testName, AtomicLong counter)
static void updateConfigForQuotas(org.apache.hadoop.conf.Configuration conf)
long listNumDefinedQuotas(org.apache.hadoop.hbase.client.Connection conn) throws IOException
IOException
org.apache.hadoop.hbase.TableName writeUntilViolationAndVerifyViolation(org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policyToViolate, org.apache.hadoop.hbase.client.Mutation m) throws Exception
Exception
org.apache.hadoop.hbase.TableName writeUntilViolation(org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policyToViolate) throws Exception
Exception
org.apache.hadoop.hbase.TableName writeUntilViolationAndVerifyViolationInNamespace(String ns, org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policyToViolate, org.apache.hadoop.hbase.client.Mutation m) throws Exception
Exception
org.apache.hadoop.hbase.TableName writeUntilViolationInNamespace(String ns, org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policyToViolate) throws Exception
Exception
void verifyViolation(org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policyToViolate, org.apache.hadoop.hbase.TableName tn, org.apache.hadoop.hbase.client.Mutation m) throws Exception
Exception
void verifyNoViolation(org.apache.hadoop.hbase.TableName tn, org.apache.hadoop.hbase.client.Mutation m) throws Exception
Exception
void verifyTableUsageSnapshotForSpaceQuotaExist(org.apache.hadoop.hbase.TableName tn) throws Exception
Exception
void setQuotaLimit(org.apache.hadoop.hbase.TableName tn, org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policy, long sizeInMBs) throws Exception
Exception
void setQuotaLimit(String ns, org.apache.hadoop.hbase.quotas.SpaceViolationPolicy policy, long sizeInMBs) throws Exception
Exception
void removeQuotaFromtable(org.apache.hadoop.hbase.TableName tn) throws Exception
Exception
org.apache.hadoop.hbase.client.ClientServiceCallable<Void> generateFileToLoad(org.apache.hadoop.hbase.TableName tn, int numFiles, int numRowsPerFile) throws Exception
tn
- the tablenamenumFiles
- number of filesnumRowsPerFile
- number of rows per fileException
- when failed to get connection, table or preparation of the bulk loadvoid removeQuotaFromNamespace(String ns) throws Exception
Exception
void removeAllQuotas() throws Exception
Exception
void removeAllQuotas(org.apache.hadoop.hbase.client.Connection conn) throws IOException
IOException
org.apache.hadoop.hbase.quotas.QuotaSettings getTableSpaceQuota(org.apache.hadoop.hbase.client.Connection conn, org.apache.hadoop.hbase.TableName tn) throws IOException
IOException
public void waitForQuotaTable(org.apache.hadoop.hbase.client.Connection conn) throws IOException
IOException
public void waitForQuotaTable(org.apache.hadoop.hbase.client.Connection conn, long timeout) throws IOException
timeout
milliseconds for the HBase quota table to exist.IOException
void writeData(org.apache.hadoop.hbase.TableName tn, long sizeInBytes) throws IOException
IOException
void writeData(org.apache.hadoop.hbase.client.Connection conn, org.apache.hadoop.hbase.TableName tn, long sizeInBytes) throws IOException
IOException
void writeData(org.apache.hadoop.hbase.TableName tn, long sizeInBytes, String qual) throws IOException
IOException
void writeData(org.apache.hadoop.hbase.TableName tn, long sizeInBytes, byte[] qual) throws IOException
IOException
org.apache.hadoop.hbase.NamespaceDescriptor createNamespace() throws Exception
Exception
org.apache.hadoop.hbase.NamespaceDescriptor createNamespace(String namespace) throws Exception
Exception
org.apache.hbase.thirdparty.com.google.common.collect.Multimap<org.apache.hadoop.hbase.TableName,org.apache.hadoop.hbase.quotas.QuotaSettings> createTablesWithSpaceQuotas() throws Exception
Exception
org.apache.hadoop.hbase.TableName getNextTableName()
org.apache.hadoop.hbase.TableName getNextTableName(String namespace)
org.apache.hadoop.hbase.TableName createTable() throws Exception
Exception
org.apache.hadoop.hbase.TableName createTableWithRegions(int numRegions) throws Exception
Exception
org.apache.hadoop.hbase.TableName createTableWithRegions(org.apache.hadoop.hbase.client.Admin admin, int numRegions) throws Exception
Exception
org.apache.hadoop.hbase.TableName createTableWithRegions(String namespace, int numRegions) throws Exception
Exception
org.apache.hadoop.hbase.TableName createTableWithRegions(org.apache.hadoop.hbase.client.Admin admin, String namespace, int numRegions, int numberOfReplicas) throws Exception
Exception
org.apache.hadoop.hbase.TableName createTableInNamespace(org.apache.hadoop.hbase.NamespaceDescriptor nd) throws Exception
Exception
void partitionTablesByQuotaTarget(org.apache.hbase.thirdparty.com.google.common.collect.Multimap<org.apache.hadoop.hbase.TableName,org.apache.hadoop.hbase.quotas.QuotaSettings> quotas, Set<org.apache.hadoop.hbase.TableName> tablesWithTableQuota, Set<org.apache.hadoop.hbase.TableName> tablesWithNamespaceQuota)
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.