Package org.apache.hadoop.hbase
Class ConnectionRule
java.lang.Object
org.junit.rules.ExternalResource
org.apache.hadoop.hbase.ConnectionRule
- All Implemented Interfaces:
org.junit.rules.TestRule
Deprecated.
A
Rule that manages the lifecycle of an instance of AsyncConnection. Can be used
in either the Rule or ClassRule positions.
Use in combination with MiniClusterRule, for example:
{
@code
public class TestMyClass {
private static final MiniClusterRule miniClusterRule = MiniClusterRule.newBuilder().build();
private static final ConnectionRule connectionRule =
ConnectionRule.createAsyncConnectionRule(miniClusterRule::createConnection);
@ClassRule
public static final TestRule rule =
RuleChain.outerRule(miniClusterRule).around(connectionRule);
}
}
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.client.AsyncConnectionDeprecated.private final Supplier<CompletableFuture<org.apache.hadoop.hbase.client.AsyncConnection>>Deprecated.private org.apache.hadoop.hbase.client.ConnectionDeprecated.private final Supplier<org.apache.hadoop.hbase.client.Connection>Deprecated. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConnectionRule(Supplier<org.apache.hadoop.hbase.client.Connection> connectionSupplier, Supplier<CompletableFuture<org.apache.hadoop.hbase.client.AsyncConnection>> asyncConnectionSupplier) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafter()Deprecated.protected voidbefore()Deprecated.static ConnectionRulecreateAsyncConnectionRule(Supplier<CompletableFuture<org.apache.hadoop.hbase.client.AsyncConnection>> asyncConnectionSupplier) Deprecated.static ConnectionRulecreateConnectionRule(Supplier<org.apache.hadoop.hbase.client.Connection> connectionSupplier) Deprecated.static ConnectionRulecreateConnectionRule(Supplier<org.apache.hadoop.hbase.client.Connection> connectionSupplier, Supplier<CompletableFuture<org.apache.hadoop.hbase.client.AsyncConnection>> asyncConnectionSupplier) Deprecated.org.apache.hadoop.hbase.client.AsyncConnectionDeprecated.org.apache.hadoop.hbase.client.ConnectionDeprecated.Methods inherited from class org.junit.rules.ExternalResource
apply
-
Field Details
-
connectionSupplier
Deprecated. -
asyncConnectionSupplier
private final Supplier<CompletableFuture<org.apache.hadoop.hbase.client.AsyncConnection>> asyncConnectionSupplierDeprecated. -
connection
Deprecated. -
asyncConnection
Deprecated.
-
-
Constructor Details
-
ConnectionRule
private ConnectionRule(Supplier<org.apache.hadoop.hbase.client.Connection> connectionSupplier, Supplier<CompletableFuture<org.apache.hadoop.hbase.client.AsyncConnection>> asyncConnectionSupplier) Deprecated.
-
-
Method Details
-
createConnectionRule
public static ConnectionRule createConnectionRule(Supplier<org.apache.hadoop.hbase.client.Connection> connectionSupplier) Deprecated. -
createAsyncConnectionRule
public static ConnectionRule createAsyncConnectionRule(Supplier<CompletableFuture<org.apache.hadoop.hbase.client.AsyncConnection>> asyncConnectionSupplier) Deprecated. -
createConnectionRule
public static ConnectionRule createConnectionRule(Supplier<org.apache.hadoop.hbase.client.Connection> connectionSupplier, Supplier<CompletableFuture<org.apache.hadoop.hbase.client.AsyncConnection>> asyncConnectionSupplier) Deprecated. -
getConnection
Deprecated. -
getAsyncConnection
Deprecated. -
before
Deprecated.- Overrides:
beforein classorg.junit.rules.ExternalResource- Throws:
Throwable
-
after
Deprecated.- Overrides:
afterin classorg.junit.rules.ExternalResource
-
ConnectionExtensioninstead, once we finish the migration of JUnit5, which means we do not needConnectionRuleany more, we can remove these dependencies, see HBASE-23671 for more details.