Revert "HBASE-25713 Make an hbase-wal module"
This reverts commit e58f1b24a6c1f3aaa511a71b2ac77280921fa210.
This commit is contained in:
parent
d90d0c2231
commit
b051ad5594
@ -72,10 +72,6 @@
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-coprocessor</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-common</artifactId>
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
/**
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
@ -22,8 +23,10 @@ import org.apache.yetus.audience.InterfaceAudience;
|
||||
/**
|
||||
* Interface to support the aborting of a given server or client.
|
||||
* <p>
|
||||
* This is used primarily when we could get an unexpected and fatal exception; abort is called to
|
||||
* exit the hosting process.
|
||||
* This is used primarily for ZooKeeper usage when we could get an unexpected
|
||||
* and fatal exception, requiring an abort.
|
||||
* <p>
|
||||
* Implemented by the Master, RegionServer, and TableServers (client).
|
||||
*/
|
||||
@InterfaceAudience.Private
|
||||
public interface Abortable {
|
@ -18,9 +18,11 @@
|
||||
*/
|
||||
|
||||
package org.apache.hadoop.hbase;
|
||||
import com.google.protobuf.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
|
||||
import com.google.protobuf.Service;
|
||||
import org.apache.yetus.audience.InterfaceAudience;
|
||||
import org.apache.yetus.audience.InterfaceStability;
|
||||
|
||||
@ -95,8 +97,8 @@ public interface Coprocessor {
|
||||
|
||||
/**
|
||||
* Coprocessor endpoints providing protobuf services should override this method.
|
||||
* @return Iterable of {@link Service}s or empty collection; implementations should not return
|
||||
* null.
|
||||
* @return Iterable of {@link Service}s or empty collection. Implementations should never
|
||||
* return null.
|
||||
*/
|
||||
default Iterable<Service> getServices() {
|
||||
return Collections.EMPTY_SET;
|
@ -1,4 +1,5 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
@ -20,7 +21,8 @@ package org.apache.hadoop.hbase;
|
||||
import org.apache.yetus.audience.InterfaceAudience;
|
||||
|
||||
/**
|
||||
* Subclass if exception is not meant to be retried.
|
||||
* Subclass if exception is not meant to be retried: e.g.
|
||||
* {@link org.apache.hadoop.hbase.UnknownScannerException}
|
||||
*/
|
||||
@InterfaceAudience.Public
|
||||
public class DoNotRetryIOException extends HBaseIOException {
|
@ -1,4 +1,5 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
@ -25,6 +26,8 @@ import org.apache.yetus.audience.InterfaceAudience;
|
||||
*/
|
||||
@InterfaceAudience.Public
|
||||
public class CoprocessorException extends DoNotRetryIOException {
|
||||
private static final long serialVersionUID = 4357922136679804887L;
|
||||
|
||||
/** Default Constructor */
|
||||
public CoprocessorException() {
|
||||
super();
|
||||
@ -32,15 +35,19 @@ public class CoprocessorException extends DoNotRetryIOException {
|
||||
|
||||
/**
|
||||
* Constructor with a Class object and exception message.
|
||||
* @param clazz
|
||||
* @param s
|
||||
*/
|
||||
public CoprocessorException(Class<?> clazz, String s) {
|
||||
super("Coprocessor [" + clazz.getName() + "]: " + s);
|
||||
super( "Coprocessor [" + clazz.getName() + "]: " + s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the exception and supplies a string as the message
|
||||
* @param s - message
|
||||
*/
|
||||
public CoprocessorException(String s) {
|
||||
super(s);
|
||||
}
|
||||
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<!--
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>hbase-build-configuration</artifactId>
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<version>2.5.0-SNAPSHOT</version>
|
||||
<relativePath>../hbase-build-configuration</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>hbase-coprocessor</artifactId>
|
||||
<name>Apache HBase - Coprocessor</name>
|
||||
<description>Base Coprocessor Types</description>
|
||||
|
||||
<build>
|
||||
<testResources>
|
||||
<testResource>
|
||||
<directory>src/test/resources</directory>
|
||||
<includes>
|
||||
<include>log4j.properties</include>
|
||||
</includes>
|
||||
</testResource>
|
||||
</testResources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<!--Make it so assembly:single does nothing in here -->
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<skipAssembly>true</skipAssembly>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Make a jar and put the sources in the jar -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>net.revelc.code</groupId>
|
||||
<artifactId>warbucks-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-annotations</artifactId>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-common</artifactId>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -256,10 +256,6 @@
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-coprocessor</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-http</artifactId>
|
||||
|
@ -1,4 +1,5 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
@ -18,7 +19,6 @@
|
||||
|
||||
package org.apache.hadoop.hbase.coprocessor;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.hbase.Coprocessor;
|
||||
import org.apache.hadoop.hbase.CoprocessorEnvironment;
|
||||
@ -27,6 +27,8 @@ import org.apache.yetus.audience.InterfaceAudience;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Encapsulation of the environment of each coprocessor
|
||||
*/
|
||||
@ -35,21 +37,21 @@ public class BaseEnvironment<C extends Coprocessor> implements CoprocessorEnviro
|
||||
private static final Logger LOG = LoggerFactory.getLogger(BaseEnvironment.class);
|
||||
|
||||
/** The coprocessor */
|
||||
protected final C impl;
|
||||
public C impl;
|
||||
/** Chaining priority */
|
||||
protected int priority = Coprocessor.PRIORITY_USER;
|
||||
/** Current coprocessor state */
|
||||
Coprocessor.State state = Coprocessor.State.UNINSTALLED;
|
||||
private final int seq;
|
||||
private final Configuration conf;
|
||||
private final ClassLoader classLoader;
|
||||
private int seq;
|
||||
private Configuration conf;
|
||||
private ClassLoader classLoader;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param impl the coprocessor instance
|
||||
* @param priority chaining priority
|
||||
*/
|
||||
public BaseEnvironment(C impl, final int priority, int seq, Configuration conf) {
|
||||
public BaseEnvironment(final C impl, final int priority, final int seq, final Configuration conf) {
|
||||
this.impl = impl;
|
||||
this.classLoader = impl.getClass().getClassLoader();
|
||||
this.priority = priority;
|
@ -31,6 +31,10 @@ import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.apache.yetus.audience.InterfaceAudience;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.hadoop.hbase.Abortable;
|
||||
@ -38,18 +42,17 @@ import org.apache.hadoop.hbase.Coprocessor;
|
||||
import org.apache.hadoop.hbase.CoprocessorEnvironment;
|
||||
import org.apache.hadoop.hbase.DoNotRetryIOException;
|
||||
import org.apache.hadoop.hbase.HConstants;
|
||||
import org.apache.hadoop.hbase.ipc.RpcServer;
|
||||
import org.apache.hadoop.hbase.security.User;
|
||||
import org.apache.hadoop.hbase.util.CoprocessorClassLoader;
|
||||
import org.apache.hadoop.hbase.util.SortedList;
|
||||
import org.apache.yetus.audience.InterfaceAudience;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Provides the common setup framework and runtime services for coprocessor
|
||||
* invocation from HBase services.
|
||||
* @param <C> type of specific coprocessor this host will handle
|
||||
* @param <E> type of specific coprocessor environment this host requires.
|
||||
* provides
|
||||
*/
|
||||
@InterfaceAudience.Private
|
||||
public abstract class CoprocessorHost<C extends Coprocessor, E extends CoprocessorEnvironment<C>> {
|
||||
@ -97,7 +100,8 @@ public abstract class CoprocessorHost<C extends Coprocessor, E extends Coprocess
|
||||
* the intention is to preserve a history of all loaded coprocessors for
|
||||
* diagnosis in case of server crash (HBASE-4014).
|
||||
*/
|
||||
private static final Set<String> coprocessorNames = Collections.synchronizedSet(new HashSet<>());
|
||||
private static Set<String> coprocessorNames =
|
||||
Collections.synchronizedSet(new HashSet<String>());
|
||||
|
||||
public static Set<String> getLoadedCoprocessors() {
|
||||
synchronized (coprocessorNames) {
|
||||
@ -135,9 +139,8 @@ public abstract class CoprocessorHost<C extends Coprocessor, E extends Coprocess
|
||||
|
||||
// load default coprocessors from configure file
|
||||
String[] defaultCPClasses = conf.getStrings(confKey);
|
||||
if (defaultCPClasses == null || defaultCPClasses.length == 0) {
|
||||
if (defaultCPClasses == null || defaultCPClasses.length == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
int currentSystemPriority = Coprocessor.PRIORITY_SYSTEM;
|
||||
for (String className : defaultCPClasses) {
|
||||
@ -451,8 +454,15 @@ public abstract class CoprocessorHost<C extends Coprocessor, E extends Coprocess
|
||||
// server is configured to abort.
|
||||
abortServer(env, e);
|
||||
} else {
|
||||
// env will print the Region toString if a RegionCoprocessorEnvironment which includes table.
|
||||
LOG.error("Removing coprocessor '" + env.toString() + "' from " + "environment", e);
|
||||
// If available, pull a table name out of the environment
|
||||
if(env instanceof RegionCoprocessorEnvironment) {
|
||||
String tableName = ((RegionCoprocessorEnvironment)env).getRegionInfo().getTable().getNameAsString();
|
||||
LOG.error("Removing coprocessor '" + env.toString() + "' from table '"+ tableName + "'", e);
|
||||
} else {
|
||||
LOG.error("Removing coprocessor '" + env.toString() + "' from " +
|
||||
"environment",e);
|
||||
}
|
||||
|
||||
coprocEnvironments.remove(env);
|
||||
try {
|
||||
shutdown(env);
|
||||
@ -470,13 +480,16 @@ public abstract class CoprocessorHost<C extends Coprocessor, E extends Coprocess
|
||||
* Used to limit legacy handling to once per Coprocessor class per classloader.
|
||||
*/
|
||||
private static final Set<Class<? extends Coprocessor>> legacyWarning =
|
||||
new ConcurrentSkipListSet<>(new Comparator<Class<? extends Coprocessor>>() {
|
||||
@Override
|
||||
public int compare(Class<? extends Coprocessor> c1, Class<? extends Coprocessor> c2) {
|
||||
return c1.equals(c2) ? 0 : c1.getName().compareTo(c2.getName());
|
||||
}
|
||||
}
|
||||
);
|
||||
new ConcurrentSkipListSet<>(
|
||||
new Comparator<Class<? extends Coprocessor>>() {
|
||||
@Override
|
||||
public int compare(Class<? extends Coprocessor> c1, Class<? extends Coprocessor> c2) {
|
||||
if (c1.equals(c2)) {
|
||||
return 0;
|
||||
}
|
||||
return c1.getName().compareTo(c2.getName());
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Implementations defined function to get an observer of type {@code O} from a coprocessor of
|
||||
@ -505,8 +518,7 @@ public abstract class CoprocessorHost<C extends Coprocessor, E extends Coprocess
|
||||
}
|
||||
|
||||
ObserverOperation(ObserverGetter<C, O> observerGetter, User user, boolean bypassable) {
|
||||
// Used to get user from RpcServer if null -- removed.
|
||||
super(user, bypassable);
|
||||
super(user != null? user: RpcServer.getRequestUser().orElse(null), bypassable);
|
||||
this.observerGetter = observerGetter;
|
||||
}
|
||||
|
||||
@ -534,7 +546,7 @@ public abstract class CoprocessorHost<C extends Coprocessor, E extends Coprocess
|
||||
}
|
||||
|
||||
/**
|
||||
* In case of coprocessors which have many kinds of observers (e.g. RegionCoprocessor
|
||||
* In case of coprocessors which have many kinds of observers (for eg, {@link RegionCoprocessor}
|
||||
* has BulkLoadObserver, RegionObserver, etc), some implementations may not need all
|
||||
* observers, in which case they will return null for that observer's getter.
|
||||
* We simply ignore such cases.
|
||||
@ -602,7 +614,7 @@ public abstract class CoprocessorHost<C extends Coprocessor, E extends Coprocess
|
||||
|
||||
/**
|
||||
* @return True if we are to bypass (Can only be <code>true</code> if
|
||||
* ObserverOperation#isBypassable()).
|
||||
* ObserverOperation#isBypassable().
|
||||
*/
|
||||
protected <O> boolean execOperation(final ObserverOperation<O> observerOperation)
|
||||
throws IOException {
|
||||
@ -645,12 +657,11 @@ public abstract class CoprocessorHost<C extends Coprocessor, E extends Coprocess
|
||||
* master/regionserver stop or cluster shutdown. (Refer:
|
||||
* <a href="https://issues.apache.org/jira/browse/HBASE-16663">HBASE-16663</a>
|
||||
* @return true if bypaas coprocessor execution, false if not.
|
||||
* @throws IOException
|
||||
*/
|
||||
protected <O> boolean execShutdown(final ObserverOperation<O> observerOperation)
|
||||
throws IOException {
|
||||
if (observerOperation == null) {
|
||||
return false;
|
||||
}
|
||||
if (observerOperation == null) return false;
|
||||
boolean bypass = false;
|
||||
List<E> envs = coprocEnvironments.get();
|
||||
// Iterate the coprocessors and execute ObserverOperation's call()
|
@ -1,4 +1,5 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
@ -18,6 +19,7 @@
|
||||
package org.apache.hadoop.hbase.coprocessor;
|
||||
|
||||
import org.apache.yetus.audience.InterfaceAudience;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
@ -17,18 +17,20 @@
|
||||
*/
|
||||
package org.apache.hadoop.hbase.coprocessor;
|
||||
|
||||
import java.util.Optional;
|
||||
import org.apache.hadoop.hbase.CoprocessorEnvironment;
|
||||
import org.apache.hadoop.hbase.HBaseInterfaceAudience;
|
||||
import org.apache.hadoop.hbase.security.User;
|
||||
import org.apache.yetus.audience.InterfaceAudience;
|
||||
import org.apache.yetus.audience.InterfaceStability;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Carries the execution state for a given invocation of an Observer coprocessor method. The same
|
||||
* ObserverContext instance is passed sequentially to all loaded coprocessors for a given Observer
|
||||
* method trigger, with the <code>CoprocessorEnvironment</code> reference set appropriately for each
|
||||
* Coprocessor type:
|
||||
* Carries the execution state for a given invocation of an Observer coprocessor
|
||||
* ({@link RegionObserver}, {@link MasterObserver}, or {@link WALObserver})
|
||||
* method. The same ObserverContext instance is passed sequentially to all loaded
|
||||
* coprocessors for a given Observer method trigger, with the
|
||||
* <code>CoprocessorEnvironment</code> reference set appropriately for each Coprocessor type:
|
||||
* e.g. the RegionCoprocessorEnvironment is passed to RegionCoprocessors, and so on.
|
||||
* @param <E> The {@link CoprocessorEnvironment} subclass applicable to the
|
||||
* revelant Observer interface.
|
||||
@ -67,6 +69,7 @@ public interface ObserverContext<E extends CoprocessorEnvironment> {
|
||||
*/
|
||||
void bypass();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the active user for the coprocessor call. If an explicit {@code User} instance was
|
||||
* provided to the constructor, that will be returned, otherwise if we are in the context of an
|
@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.coprocessor;
|
||||
|
||||
import java.util.Optional;
|
||||
import org.apache.hadoop.hbase.CoprocessorEnvironment;
|
||||
import org.apache.hadoop.hbase.ipc.RpcServer;
|
||||
import org.apache.hadoop.hbase.security.User;
|
||||
import org.apache.yetus.audience.InterfaceAudience;
|
||||
|
||||
@ -41,9 +42,6 @@ public class ObserverContextImpl<E extends CoprocessorEnvironment> implements Ob
|
||||
}
|
||||
|
||||
public ObserverContextImpl(User caller, boolean bypassable) {
|
||||
// Used to do RpcServer.getRequestUser().orElse(null) if null but removed so no dependence on
|
||||
// RPCServer.
|
||||
assert caller != null;
|
||||
this.caller = caller;
|
||||
this.bypassable = bypassable;
|
||||
}
|
||||
@ -89,5 +87,19 @@ public class ObserverContextImpl<E extends CoprocessorEnvironment> implements Ob
|
||||
return Optional.ofNullable(caller);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new ObserverContext instance if the passed reference is <code>null</code> and
|
||||
* sets the environment in the new or existing instance. This allows deferring the instantiation
|
||||
* of a ObserverContext until it is actually needed.
|
||||
* @param <E> The environment type for the context
|
||||
* @param env The coprocessor environment to set
|
||||
* @return An instance of <code>ObserverContext</code> with the environment set
|
||||
*/
|
||||
@Deprecated
|
||||
// TODO: Remove this method, ObserverContext should not depend on RpcServer
|
||||
public static <E extends CoprocessorEnvironment> ObserverContext<E> createAndPrepare(E env) {
|
||||
ObserverContextImpl<E> ctx = new ObserverContextImpl<>(RpcServer.getRequestUser().orElse(null));
|
||||
ctx.prepare(env);
|
||||
return ctx;
|
||||
}
|
||||
}
|
@ -34,6 +34,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.yetus.audience.InterfaceAudience;
|
@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.coprocessor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.hbase.CoprocessorEnvironment;
|
||||
import org.apache.hadoop.hbase.HBaseInterfaceAudience;
|
||||
|
@ -1689,9 +1689,4 @@ public class RegionCoprocessorHost
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RegionCoprocessorHost{region=" + region + "} " + super.toString();
|
||||
}
|
||||
}
|
||||
|
@ -90,10 +90,6 @@ public class WALCoprocessorHost
|
||||
super.shutdown();
|
||||
MetricsCoprocessor.removeRegistry(this.metricRegistry);
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return "WALEnvironment{wal=" + wal + '}';
|
||||
}
|
||||
}
|
||||
|
||||
private final WAL wal;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
@ -22,20 +22,25 @@ import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.RegionServerTests;
|
||||
import org.apache.hadoop.hbase.testclassification.SmallTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.TestName;
|
||||
|
||||
@Category({ RegionServerTests.class, SmallTests.class })
|
||||
public class TestReadOnlyConfiguration {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestReadOnlyConfiguration.class);
|
||||
HBaseClassTestRule.forClass(TestReadOnlyConfiguration.class);
|
||||
|
||||
@Test (expected = UnsupportedOperationException.class)
|
||||
@Rule
|
||||
public TestName name = new TestName();
|
||||
|
||||
@Test
|
||||
public void testAddDefaultResource() {
|
||||
Configuration configuration = new Configuration();
|
||||
Configuration readOnlyConf = new ReadOnlyConfiguration(configuration);
|
||||
readOnlyConf.addDefaultResource("abc.xml");
|
||||
readOnlyConf.setInt("any.old.config", 1);
|
||||
configuration.addDefaultResource("abc.xml");
|
||||
}
|
||||
}
|
@ -24,6 +24,7 @@ import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import com.google.protobuf.BlockingRpcChannel;
|
||||
import com.google.protobuf.RpcCallback;
|
||||
import com.google.protobuf.RpcController;
|
||||
@ -38,6 +39,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.fs.CommonConfigurationKeys;
|
||||
import org.apache.hadoop.fs.FileStatus;
|
||||
@ -79,9 +81,9 @@ import org.apache.hadoop.hbase.client.SnapshotDescription;
|
||||
import org.apache.hadoop.hbase.client.Table;
|
||||
import org.apache.hadoop.hbase.client.TableState;
|
||||
import org.apache.hadoop.hbase.client.security.SecurityCapability;
|
||||
|
||||
import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
|
||||
import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
|
||||
import org.apache.hadoop.hbase.coprocessor.ObserverContext;
|
||||
import org.apache.hadoop.hbase.coprocessor.ObserverContextImpl;
|
||||
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor;
|
||||
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
|
||||
@ -102,7 +104,6 @@ import org.apache.hadoop.hbase.io.hfile.CacheConfig;
|
||||
import org.apache.hadoop.hbase.io.hfile.HFile;
|
||||
import org.apache.hadoop.hbase.io.hfile.HFileContext;
|
||||
import org.apache.hadoop.hbase.io.hfile.HFileContextBuilder;
|
||||
import org.apache.hadoop.hbase.ipc.RpcServer;
|
||||
import org.apache.hadoop.hbase.master.HMaster;
|
||||
import org.apache.hadoop.hbase.master.MasterCoprocessorHost;
|
||||
import org.apache.hadoop.hbase.master.RegionState;
|
||||
@ -444,7 +445,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
public Object run() throws Exception {
|
||||
HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
|
||||
htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
|
||||
ACCESS_CONTROLLER.preCreateTable(createAndPrepare(CP_ENV), htd, null);
|
||||
ACCESS_CONTROLLER.preCreateTable(ObserverContextImpl.createAndPrepare(CP_ENV), htd, null);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -465,7 +466,8 @@ public class TestAccessController extends SecureTestUtil {
|
||||
HTableDescriptor htd = new HTableDescriptor(TEST_TABLE);
|
||||
htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
|
||||
htd.addFamily(new HColumnDescriptor("fam_" + User.getCurrent().getShortName()));
|
||||
ACCESS_CONTROLLER.preModifyTable(createAndPrepare(CP_ENV), TEST_TABLE, null, htd);
|
||||
ACCESS_CONTROLLER.preModifyTable(ObserverContextImpl.createAndPrepare(CP_ENV), TEST_TABLE,
|
||||
null, htd);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -481,7 +483,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER
|
||||
.preDeleteTable(createAndPrepare(CP_ENV), TEST_TABLE);
|
||||
.preDeleteTable(ObserverContextImpl.createAndPrepare(CP_ENV), TEST_TABLE);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -496,7 +498,9 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction truncateTable = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preTruncateTable(createAndPrepare(CP_ENV), TEST_TABLE);
|
||||
ACCESS_CONTROLLER
|
||||
.preTruncateTable(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
TEST_TABLE);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -511,7 +515,8 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction disableTable = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDisableTable(createAndPrepare(CP_ENV), TEST_TABLE);
|
||||
ACCESS_CONTROLLER.preDisableTable(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
TEST_TABLE);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -519,7 +524,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction disableAclTable = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDisableTable(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preDisableTable(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
PermissionStorage.ACL_TABLE_NAME);
|
||||
return null;
|
||||
}
|
||||
@ -539,7 +544,8 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction enableTable = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preEnableTable(createAndPrepare(CP_ENV), TEST_TABLE);
|
||||
ACCESS_CONTROLLER
|
||||
.preEnableTable(ObserverContextImpl.createAndPrepare(CP_ENV), TEST_TABLE);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -614,8 +620,8 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction abortProcedureAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preAbortProcedure(createAndPrepare(CP_ENV), procId);
|
||||
return null;
|
||||
ACCESS_CONTROLLER.preAbortProcedure(ObserverContextImpl.createAndPrepare(CP_ENV), procId);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
@ -635,7 +641,8 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction getProceduresAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.postGetProcedures(createAndPrepare(CP_ENV));
|
||||
ACCESS_CONTROLLER
|
||||
.postGetProcedures(ObserverContextImpl.createAndPrepare(CP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -651,7 +658,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preGetLocks(createAndPrepare(CP_ENV));
|
||||
ACCESS_CONTROLLER.preGetLocks(ObserverContextImpl.createAndPrepare(CP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -673,7 +680,8 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preMove(createAndPrepare(CP_ENV), hri, server, server);
|
||||
ACCESS_CONTROLLER.preMove(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
hri, server, server);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -694,7 +702,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preAssign(createAndPrepare(CP_ENV), hri);
|
||||
ACCESS_CONTROLLER.preAssign(ObserverContextImpl.createAndPrepare(CP_ENV), hri);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -715,7 +723,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preUnassign(createAndPrepare(CP_ENV), hri);
|
||||
ACCESS_CONTROLLER.preUnassign(ObserverContextImpl.createAndPrepare(CP_ENV), hri);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -736,7 +744,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preRegionOffline(createAndPrepare(CP_ENV), hri);
|
||||
ACCESS_CONTROLLER.preRegionOffline(ObserverContextImpl.createAndPrepare(CP_ENV), hri);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -751,7 +759,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSetSplitOrMergeEnabled(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSetSplitOrMergeEnabled(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
true, MasterSwitchType.MERGE);
|
||||
return null;
|
||||
}
|
||||
@ -767,7 +775,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preBalance(createAndPrepare(CP_ENV));
|
||||
ACCESS_CONTROLLER.preBalance(ObserverContextImpl.createAndPrepare(CP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -782,7 +790,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preBalanceSwitch(createAndPrepare(CP_ENV), true);
|
||||
ACCESS_CONTROLLER.preBalanceSwitch(ObserverContextImpl.createAndPrepare(CP_ENV), true);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -797,7 +805,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preShutdown(createAndPrepare(CP_ENV));
|
||||
ACCESS_CONTROLLER.preShutdown(ObserverContextImpl.createAndPrepare(CP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -812,7 +820,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preStopMaster(createAndPrepare(CP_ENV));
|
||||
ACCESS_CONTROLLER.preStopMaster(ObserverContextImpl.createAndPrepare(CP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -835,7 +843,10 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSplitRegion(createAndPrepare(CP_ENV), tableName, TEST_ROW);
|
||||
ACCESS_CONTROLLER.preSplitRegion(
|
||||
ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
tableName,
|
||||
TEST_ROW);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -850,7 +861,8 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preFlush(createAndPrepare(RCP_ENV), FlushLifeCycleTracker.DUMMY);
|
||||
ACCESS_CONTROLLER.preFlush(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
FlushLifeCycleTracker.DUMMY);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -865,7 +877,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preCompact(createAndPrepare(RCP_ENV), null, null,
|
||||
ACCESS_CONTROLLER.preCompact(ObserverContextImpl.createAndPrepare(RCP_ENV), null, null,
|
||||
ScanType.COMPACT_RETAIN_DELETES, null, null);
|
||||
return null;
|
||||
}
|
||||
@ -907,7 +919,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
|
||||
// action for scanning
|
||||
AccessTestAction scanAction = new AccessTestAction() {
|
||||
@SuppressWarnings("checkstyle:EmptyStatement") @Override
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
Scan s = new Scan();
|
||||
s.addFamily(TEST_FAMILY);
|
||||
@ -916,7 +928,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
ResultScanner scanner = table.getScanner(s);
|
||||
try {
|
||||
for (Result r = scanner.next(); r != null; r = scanner.next()) {
|
||||
; // do nothing
|
||||
// do nothing
|
||||
}
|
||||
} finally {
|
||||
scanner.close();
|
||||
@ -1249,7 +1261,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction preGrantAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preGrant(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preGrant(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
new UserPermission(USER_RO.getShortName(), Permission.newBuilder(TEST_TABLE)
|
||||
.withFamily(TEST_FAMILY).withActions(Action.READ).build()),
|
||||
false);
|
||||
@ -1260,7 +1272,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction preRevokeAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preRevoke(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preRevoke(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
new UserPermission(USER_RO.getShortName(), Permission.newBuilder(TEST_TABLE)
|
||||
.withFamily(TEST_FAMILY).withActions(Action.READ).build()));
|
||||
return null;
|
||||
@ -1581,12 +1593,11 @@ public class TestAccessController extends SecureTestUtil {
|
||||
}
|
||||
|
||||
private boolean hasFoundUserPermission(List<UserPermission> userPermissions,
|
||||
List<UserPermission> perms) {
|
||||
List<UserPermission> perms) {
|
||||
return perms.containsAll(userPermissions);
|
||||
}
|
||||
|
||||
private boolean hasFoundUserPermission(UserPermission userPermission,
|
||||
List<UserPermission> perms) {
|
||||
private boolean hasFoundUserPermission(UserPermission userPermission, List<UserPermission> perms) {
|
||||
return perms.contains(userPermission);
|
||||
}
|
||||
|
||||
@ -1980,7 +1991,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preStopRegionServer(createAndPrepare(RSCP_ENV));
|
||||
ACCESS_CONTROLLER.preStopRegionServer(ObserverContextImpl.createAndPrepare(RSCP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -1995,7 +2006,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preRollWALWriterRequest(createAndPrepare(RSCP_ENV));
|
||||
ACCESS_CONTROLLER.preRollWALWriterRequest(ObserverContextImpl.createAndPrepare(RSCP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -2010,7 +2021,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preOpen(createAndPrepare(RCP_ENV));
|
||||
ACCESS_CONTROLLER.preOpen(ObserverContextImpl.createAndPrepare(RCP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -2025,7 +2036,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preClose(createAndPrepare(RCP_ENV), false);
|
||||
ACCESS_CONTROLLER.preClose(ObserverContextImpl.createAndPrepare(RCP_ENV), false);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -2044,7 +2055,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction snapshotAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSnapshot(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot, htd);
|
||||
return null;
|
||||
}
|
||||
@ -2053,7 +2064,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction deleteAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDeleteSnapshot(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preDeleteSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot);
|
||||
return null;
|
||||
}
|
||||
@ -2062,7 +2073,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction restoreAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preRestoreSnapshot(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preRestoreSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot, htd);
|
||||
return null;
|
||||
}
|
||||
@ -2071,7 +2082,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction cloneAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preCloneSnapshot(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preCloneSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot, null);
|
||||
return null;
|
||||
}
|
||||
@ -2104,7 +2115,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction snapshotAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSnapshot(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot, htd);
|
||||
return null;
|
||||
}
|
||||
@ -2116,7 +2127,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction deleteAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDeleteSnapshot(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preDeleteSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot);
|
||||
return null;
|
||||
}
|
||||
@ -2128,7 +2139,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction restoreAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preRestoreSnapshot(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preRestoreSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot, htd);
|
||||
return null;
|
||||
}
|
||||
@ -2140,7 +2151,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction cloneAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preCloneSnapshot(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preCloneSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot, htd);
|
||||
return null;
|
||||
}
|
||||
@ -2285,8 +2296,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
createTestTable(tableName);
|
||||
|
||||
// Grant TABLE ADMIN privs
|
||||
grantOnTable(TEST_UTIL, TABLE_ADMIN.getShortName(), tableName, null, null,
|
||||
Permission.Action.ADMIN);
|
||||
grantOnTable(TEST_UTIL, TABLE_ADMIN.getShortName(), tableName, null, null, Permission.Action.ADMIN);
|
||||
|
||||
AccessTestAction deleteTableAction = new AccessTestAction() {
|
||||
@Override
|
||||
@ -2514,8 +2524,8 @@ public class TestAccessController extends SecureTestUtil {
|
||||
|
||||
// Revoke table READ & WRITE permission to testGrantRevoke.
|
||||
try {
|
||||
revokeFromTableUsingAccessControlClient(TEST_UTIL, systemUserConnection, userName, TEST_TABLE,
|
||||
null, null, Permission.Action.READ, Permission.Action.WRITE);
|
||||
revokeFromTableUsingAccessControlClient(TEST_UTIL, systemUserConnection, userName, TEST_TABLE, null, null,
|
||||
Permission.Action.READ, Permission.Action.WRITE);
|
||||
} catch (Throwable e) {
|
||||
LOG.error("error during call of AccessControlClient.revoke ", e);
|
||||
}
|
||||
@ -2700,7 +2710,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction setUserQuotaAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSetUserQuota(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSetUserQuota(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
null, null);
|
||||
return null;
|
||||
}
|
||||
@ -2709,7 +2719,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction setUserTableQuotaAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSetUserQuota(createAndPrepare(CP_ENV), null,
|
||||
ACCESS_CONTROLLER.preSetUserQuota(ObserverContextImpl.createAndPrepare(CP_ENV), null,
|
||||
TEST_TABLE, null);
|
||||
return null;
|
||||
}
|
||||
@ -2718,7 +2728,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction setUserNamespaceQuotaAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSetUserQuota(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSetUserQuota(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
null, (String)null, null);
|
||||
return null;
|
||||
}
|
||||
@ -2727,7 +2737,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction setTableQuotaAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSetTableQuota(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSetTableQuota(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
TEST_TABLE, null);
|
||||
return null;
|
||||
}
|
||||
@ -2736,7 +2746,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction setNamespaceQuotaAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSetNamespaceQuota(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSetNamespaceQuota(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
null, null);
|
||||
return null;
|
||||
}
|
||||
@ -2745,7 +2755,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction setRegionServerQuotaAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSetRegionServerQuota(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSetRegionServerQuota(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
null, null);
|
||||
return null;
|
||||
}
|
||||
@ -2797,8 +2807,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
/**
|
||||
* List all user permissions match the given regular expression for namespace
|
||||
* and verify each of them.
|
||||
* @param namespaceRegexWithoutPrefix the regualar expression for namespace, without
|
||||
* NAMESPACE_PREFIX
|
||||
* @param namespaceRegexWithoutPrefix the regualar expression for namespace, without NAMESPACE_PREFIX
|
||||
* @param expectedAmount the expected amount of user permissions returned
|
||||
* @param expectedNamespace the expected namespace of each user permission returned
|
||||
* @throws HBaseException in the case of any HBase exception when accessing hbase:acl table
|
||||
@ -2935,14 +2944,14 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction prepareBulkLoadAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.prePrepareBulkLoad(createAndPrepare(RCP_ENV));
|
||||
ACCESS_CONTROLLER.prePrepareBulkLoad(ObserverContextImpl.createAndPrepare(RCP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
AccessTestAction cleanupBulkLoadAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preCleanupBulkLoad(createAndPrepare(RCP_ENV));
|
||||
ACCESS_CONTROLLER.preCleanupBulkLoad(ObserverContextImpl.createAndPrepare(RCP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -2955,8 +2964,8 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction replicateLogEntriesAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preReplicateLogEntries(createAndPrepare(RSCP_ENV));
|
||||
ACCESS_CONTROLLER.postReplicateLogEntries(createAndPrepare(RSCP_ENV));
|
||||
ACCESS_CONTROLLER.preReplicateLogEntries(ObserverContextImpl.createAndPrepare(RSCP_ENV));
|
||||
ACCESS_CONTROLLER.postReplicateLogEntries(ObserverContextImpl.createAndPrepare(RSCP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -2971,7 +2980,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preAddReplicationPeer(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preAddReplicationPeer(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
"test", null);
|
||||
return null;
|
||||
}
|
||||
@ -2986,7 +2995,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preRemoveReplicationPeer(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preRemoveReplicationPeer(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
"test");
|
||||
return null;
|
||||
}
|
||||
@ -3001,7 +3010,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preEnableReplicationPeer(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preEnableReplicationPeer(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
"test");
|
||||
return null;
|
||||
}
|
||||
@ -3016,7 +3025,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDisableReplicationPeer(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preDisableReplicationPeer(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
"test");
|
||||
return null;
|
||||
}
|
||||
@ -3032,7 +3041,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preGetReplicationPeerConfig(
|
||||
createAndPrepare(CP_ENV), "test");
|
||||
ObserverContextImpl.createAndPrepare(CP_ENV), "test");
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -3047,7 +3056,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preUpdateReplicationPeerConfig(
|
||||
createAndPrepare(CP_ENV), "test", new ReplicationPeerConfig());
|
||||
ObserverContextImpl.createAndPrepare(CP_ENV), "test", new ReplicationPeerConfig());
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -3061,7 +3070,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preListReplicationPeers(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preListReplicationPeers(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
"test");
|
||||
return null;
|
||||
}
|
||||
@ -3092,7 +3101,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
|
||||
AccessTestAction namespaceLockAction = new AccessTestAction() {
|
||||
@Override public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preRequestLock(createAndPrepare(CP_ENV), namespace,
|
||||
ACCESS_CONTROLLER.preRequestLock(ObserverContextImpl.createAndPrepare(CP_ENV), namespace,
|
||||
null, null, null);
|
||||
return null;
|
||||
}
|
||||
@ -3106,7 +3115,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
|
||||
AccessTestAction tableLockAction = new AccessTestAction() {
|
||||
@Override public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preRequestLock(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preRequestLock(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
null, tableName, null, null);
|
||||
return null;
|
||||
}
|
||||
@ -3128,7 +3137,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
|
||||
AccessTestAction regionsLockAction = new AccessTestAction() {
|
||||
@Override public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preRequestLock(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preRequestLock(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
null, null, regionInfos, null);
|
||||
return null;
|
||||
}
|
||||
@ -3142,7 +3151,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
LockProcedure proc = new LockProcedure(conf, tableName, LockType.EXCLUSIVE, "test", null);
|
||||
AccessTestAction regionLockHeartbeatAction = new AccessTestAction() {
|
||||
@Override public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preLockHeartbeat(createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preLockHeartbeat(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
proc.getTableName(), proc.getDescription());
|
||||
return null;
|
||||
}
|
||||
@ -3192,7 +3201,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preGetClusterMetrics(createAndPrepare(CP_ENV));
|
||||
ACCESS_CONTROLLER.preGetClusterMetrics(ObserverContextImpl.createAndPrepare(CP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -3206,7 +3215,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preExecuteProcedures(createAndPrepare(RSCP_ENV));
|
||||
ACCESS_CONTROLLER.preExecuteProcedures(ObserverContextImpl.createAndPrepare(RSCP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -3487,7 +3496,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSwitchRpcThrottle(createAndPrepare(CP_ENV), true);
|
||||
ACCESS_CONTROLLER.preSwitchRpcThrottle(ObserverContextImpl.createAndPrepare(CP_ENV), true);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -3500,7 +3509,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preIsRpcThrottleEnabled(createAndPrepare(CP_ENV));
|
||||
ACCESS_CONTROLLER.preIsRpcThrottleEnabled(ObserverContextImpl.createAndPrepare(CP_ENV));
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -3513,7 +3522,8 @@ public class TestAccessController extends SecureTestUtil {
|
||||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSwitchExceedThrottleQuota(createAndPrepare(CP_ENV), true);
|
||||
ACCESS_CONTROLLER.preSwitchExceedThrottleQuota(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
true);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@ -3733,18 +3743,4 @@ public class TestAccessController extends SecureTestUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new ObserverContext instance if the passed reference is <code>null</code> and
|
||||
* sets the environment in the new or existing instance. This allows deferring the instantiation
|
||||
* of a ObserverContext until it is actually needed.
|
||||
* @param <E> The environment type for the context
|
||||
* @param env The coprocessor environment to set
|
||||
* @return An instance of <code>ObserverContext</code> with the environment set
|
||||
*/
|
||||
static <E extends CoprocessorEnvironment> ObserverContext<E> createAndPrepare(E env) {
|
||||
ObserverContextImpl<E> ctx = new ObserverContextImpl<>(RpcServer.getRequestUser().orElse(null));
|
||||
ctx.prepare(env);
|
||||
return ctx;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
@ -32,6 +32,7 @@ import org.apache.hadoop.hbase.TableNotFoundException;
|
||||
import org.apache.hadoop.hbase.client.Connection;
|
||||
import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
|
||||
import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
|
||||
import org.apache.hadoop.hbase.coprocessor.ObserverContextImpl;
|
||||
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
|
||||
import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment;
|
||||
import org.apache.hadoop.hbase.master.MasterCoprocessorHost;
|
||||
@ -43,6 +44,7 @@ import org.apache.hadoop.hbase.security.User;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.apache.hadoop.hbase.testclassification.SecurityTests;
|
||||
import org.apache.hadoop.hbase.util.Bytes;
|
||||
import org.apache.hadoop.hbase.util.JVMClusterUtil;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.ClassRule;
|
||||
@ -109,7 +111,7 @@ public class TestAccessController3 extends SecureTestUtil {
|
||||
// https://hbase.apache.org/book/appendix_acl_matrix.html
|
||||
// creating all Scope x Permission combinations
|
||||
|
||||
private static final byte[] TEST_FAMILY = Bytes.toBytes("f1");
|
||||
private static byte[] TEST_FAMILY = Bytes.toBytes("f1");
|
||||
|
||||
private static MasterCoprocessorEnvironment CP_ENV;
|
||||
private static AccessController ACCESS_CONTROLLER;
|
||||
@ -279,8 +281,7 @@ public class TestAccessController3 extends SecureTestUtil {
|
||||
public Object run() throws Exception {
|
||||
HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
|
||||
htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
|
||||
ACCESS_CONTROLLER.preCreateTable(TestAccessController.
|
||||
createAndPrepare(CP_ENV), htd, null);
|
||||
ACCESS_CONTROLLER.preCreateTable(ObserverContextImpl.createAndPrepare(CP_ENV), htd, null);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
@ -248,7 +248,7 @@ public class TestNamespaceCommands extends SecureTestUtil {
|
||||
AccessTestAction modifyNamespace = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preModifyNamespace(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preModifyNamespace(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
NamespaceDescriptor.create(TEST_NAMESPACE).addConfiguration("abc", "156").build());
|
||||
return null;
|
||||
}
|
||||
@ -266,7 +266,7 @@ public class TestNamespaceCommands extends SecureTestUtil {
|
||||
AccessTestAction createNamespace = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preCreateNamespace(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preCreateNamespace(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
NamespaceDescriptor.create(TEST_NAMESPACE2).build());
|
||||
return null;
|
||||
}
|
||||
@ -275,7 +275,7 @@ public class TestNamespaceCommands extends SecureTestUtil {
|
||||
AccessTestAction deleteNamespace = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDeleteNamespace(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preDeleteNamespace(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
TEST_NAMESPACE2);
|
||||
return null;
|
||||
}
|
||||
@ -300,7 +300,7 @@ public class TestNamespaceCommands extends SecureTestUtil {
|
||||
AccessTestAction getNamespaceAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preGetNamespaceDescriptor(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preGetNamespaceDescriptor(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
TEST_NAMESPACE);
|
||||
return null;
|
||||
}
|
||||
@ -422,7 +422,7 @@ public class TestNamespaceCommands extends SecureTestUtil {
|
||||
AccessTestAction preGrantAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preGrant(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preGrant(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
new UserPermission(testUser,
|
||||
Permission.newBuilder(TEST_NAMESPACE).withActions(Action.WRITE).build()),
|
||||
false);
|
||||
@ -432,7 +432,7 @@ public class TestNamespaceCommands extends SecureTestUtil {
|
||||
AccessTestAction preRevokeAction = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preRevoke(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preRevoke(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
new UserPermission(testUser,
|
||||
Permission.newBuilder(TEST_NAMESPACE).withActions(Action.WRITE).build()));
|
||||
return null;
|
||||
@ -518,7 +518,7 @@ public class TestNamespaceCommands extends SecureTestUtil {
|
||||
public Object run() throws Exception {
|
||||
HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TEST_TABLE));
|
||||
htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
|
||||
ACCESS_CONTROLLER.preCreateTable(TestAccessController.createAndPrepare(CP_ENV), htd, null);
|
||||
ACCESS_CONTROLLER.preCreateTable(ObserverContextImpl.createAndPrepare(CP_ENV), htd, null);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
@ -472,7 +472,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
public Object run() throws Exception {
|
||||
HTableDescriptor htd = new HTableDescriptor(testTable.getTableName());
|
||||
htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
|
||||
ACCESS_CONTROLLER.preCreateTable(TestAccessController.createAndPrepare(CP_ENV), htd,
|
||||
ACCESS_CONTROLLER.preCreateTable(ObserverContextImpl.createAndPrepare(CP_ENV), htd,
|
||||
null);
|
||||
return null;
|
||||
}
|
||||
@ -485,7 +485,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
HTableDescriptor htd = new HTableDescriptor(testTable.getTableName());
|
||||
htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
|
||||
htd.addFamily(new HColumnDescriptor(TEST_FAMILY2));
|
||||
ACCESS_CONTROLLER.preModifyTable(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preModifyTable(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
testTable.getTableName(), htd);
|
||||
return null;
|
||||
}
|
||||
@ -495,7 +495,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDeleteTable(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preDeleteTable(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
testTable.getTableName());
|
||||
return null;
|
||||
}
|
||||
@ -505,7 +505,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preTruncateTable(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preTruncateTable(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
testTable.getTableName());
|
||||
return null;
|
||||
}
|
||||
@ -515,7 +515,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preEnableTable(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preEnableTable(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
testTable.getTableName());
|
||||
return null;
|
||||
}
|
||||
@ -525,7 +525,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDisableTable(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preDisableTable(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
testTable.getTableName());
|
||||
return null;
|
||||
}
|
||||
@ -538,7 +538,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
HRegionInfo region = new HRegionInfo(testTable.getTableName());
|
||||
ServerName srcServer = ServerName.valueOf("1.1.1.1", 1, 0);
|
||||
ServerName destServer = ServerName.valueOf("2.2.2.2", 2, 0);
|
||||
ACCESS_CONTROLLER.preMove(TestAccessController.createAndPrepare(CP_ENV), region,
|
||||
ACCESS_CONTROLLER.preMove(ObserverContextImpl.createAndPrepare(CP_ENV), region,
|
||||
srcServer, destServer);
|
||||
return null;
|
||||
}
|
||||
@ -549,7 +549,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
HRegionInfo region = new HRegionInfo(testTable.getTableName());
|
||||
ACCESS_CONTROLLER.preAssign(TestAccessController.createAndPrepare(CP_ENV), region);
|
||||
ACCESS_CONTROLLER.preAssign(ObserverContextImpl.createAndPrepare(CP_ENV), region);
|
||||
return null;
|
||||
}
|
||||
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
|
||||
@ -559,7 +559,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
HRegionInfo region = new HRegionInfo(testTable.getTableName());
|
||||
ACCESS_CONTROLLER.preUnassign(TestAccessController.createAndPrepare(CP_ENV), region);
|
||||
ACCESS_CONTROLLER.preUnassign(ObserverContextImpl.createAndPrepare(CP_ENV), region);
|
||||
return null;
|
||||
}
|
||||
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
|
||||
@ -568,7 +568,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preBalance(TestAccessController.createAndPrepare(CP_ENV));
|
||||
ACCESS_CONTROLLER.preBalance(ObserverContextImpl.createAndPrepare(CP_ENV));
|
||||
return null;
|
||||
}
|
||||
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
|
||||
@ -577,7 +577,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preBalanceSwitch(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preBalanceSwitch(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
true);
|
||||
return null;
|
||||
}
|
||||
@ -589,7 +589,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
public Object run() throws Exception {
|
||||
SnapshotDescription snapshot = new SnapshotDescription("foo");
|
||||
HTableDescriptor htd = new HTableDescriptor(testTable.getTableName());
|
||||
ACCESS_CONTROLLER.preSnapshot(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot, htd);
|
||||
return null;
|
||||
}
|
||||
@ -600,7 +600,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
SnapshotDescription snapshot = new SnapshotDescription("foo");
|
||||
ACCESS_CONTROLLER.preListSnapshot(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preListSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot);
|
||||
return null;
|
||||
}
|
||||
@ -612,7 +612,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
public Object run() throws Exception {
|
||||
SnapshotDescription snapshot = new SnapshotDescription("foo");
|
||||
HTableDescriptor htd = new HTableDescriptor(testTable.getTableName());
|
||||
ACCESS_CONTROLLER.preCloneSnapshot(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preCloneSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot, htd);
|
||||
return null;
|
||||
}
|
||||
@ -624,7 +624,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
public Object run() throws Exception {
|
||||
SnapshotDescription snapshot = new SnapshotDescription("foo");
|
||||
HTableDescriptor htd = new HTableDescriptor(testTable.getTableName());
|
||||
ACCESS_CONTROLLER.preRestoreSnapshot(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preRestoreSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot, htd);
|
||||
return null;
|
||||
}
|
||||
@ -635,7 +635,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
SnapshotDescription snapshot = new SnapshotDescription("foo");
|
||||
ACCESS_CONTROLLER.preDeleteSnapshot(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preDeleteSnapshot(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
snapshot);
|
||||
return null;
|
||||
}
|
||||
@ -648,7 +648,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
List<TableName> tableNamesList = Lists.newArrayList();
|
||||
tableNamesList.add(testTable.getTableName());
|
||||
List<TableDescriptor> descriptors = Lists.newArrayList();
|
||||
ACCESS_CONTROLLER.preGetTableDescriptors(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preGetTableDescriptors(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
tableNamesList, descriptors, ".+");
|
||||
return null;
|
||||
}
|
||||
@ -659,7 +659,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
List<TableDescriptor> descriptors = Lists.newArrayList();
|
||||
ACCESS_CONTROLLER.preGetTableNames(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preGetTableNames(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
descriptors, ".+");
|
||||
return null;
|
||||
}
|
||||
@ -670,7 +670,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
NamespaceDescriptor ns = NamespaceDescriptor.create("test").build();
|
||||
ACCESS_CONTROLLER.preCreateNamespace(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preCreateNamespace(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
ns);
|
||||
return null;
|
||||
}
|
||||
@ -680,7 +680,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDeleteNamespace(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preDeleteNamespace(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
"test");
|
||||
return null;
|
||||
}
|
||||
@ -691,7 +691,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
NamespaceDescriptor ns = NamespaceDescriptor.create("test").build();
|
||||
ACCESS_CONTROLLER.preModifyNamespace(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preModifyNamespace(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
ns);
|
||||
return null;
|
||||
}
|
||||
@ -701,7 +701,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preGetNamespaceDescriptor(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preGetNamespaceDescriptor(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
"test");
|
||||
return null;
|
||||
}
|
||||
@ -712,7 +712,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
List<NamespaceDescriptor> descriptors = Lists.newArrayList();
|
||||
ACCESS_CONTROLLER.preListNamespaceDescriptors(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preListNamespaceDescriptors(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
descriptors);
|
||||
return null;
|
||||
}
|
||||
@ -723,7 +723,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSplitRegion(
|
||||
TestAccessController.createAndPrepare(CP_ENV),
|
||||
ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
testTable.getTableName(),
|
||||
Bytes.toBytes("ss"));
|
||||
return null;
|
||||
@ -734,7 +734,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSetUserQuota(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSetUserQuota(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
"testuser", null);
|
||||
return null;
|
||||
}
|
||||
@ -744,7 +744,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSetTableQuota(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSetTableQuota(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
testTable.getTableName(), null);
|
||||
return null;
|
||||
}
|
||||
@ -754,7 +754,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preSetNamespaceQuota(TestAccessController.createAndPrepare(CP_ENV),
|
||||
ACCESS_CONTROLLER.preSetNamespaceQuota(ObserverContextImpl.createAndPrepare(CP_ENV),
|
||||
"test", null);
|
||||
return null;
|
||||
}
|
||||
@ -769,7 +769,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preStopRegionServer(TestAccessController.createAndPrepare(RSCP_ENV));
|
||||
ACCESS_CONTROLLER.preStopRegionServer(ObserverContextImpl.createAndPrepare(RSCP_ENV));
|
||||
return null;
|
||||
}
|
||||
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
|
||||
@ -778,7 +778,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preRollWALWriterRequest(TestAccessController.createAndPrepare(RSCP_ENV));
|
||||
ACCESS_CONTROLLER.preRollWALWriterRequest(ObserverContextImpl.createAndPrepare(RSCP_ENV));
|
||||
return null;
|
||||
}
|
||||
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
|
||||
@ -793,7 +793,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preOpen(TestAccessController.createAndPrepare(RCP_ENV));
|
||||
ACCESS_CONTROLLER.preOpen(ObserverContextImpl.createAndPrepare(RCP_ENV));
|
||||
return null;
|
||||
}
|
||||
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
|
||||
@ -802,7 +802,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preFlush(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.preFlush(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
FlushLifeCycleTracker.DUMMY);
|
||||
return null;
|
||||
}
|
||||
@ -813,7 +813,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
List<Cell> cells = Lists.newArrayList();
|
||||
ACCESS_CONTROLLER.preGetOp(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.preGetOp(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
new Get(TEST_ROW), cells);
|
||||
return null;
|
||||
}
|
||||
@ -823,7 +823,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preExists(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.preExists(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
new Get(TEST_ROW), true);
|
||||
return null;
|
||||
}
|
||||
@ -833,7 +833,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.prePut(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.prePut(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
new Put(TEST_ROW), new WALEdit(), Durability.USE_DEFAULT);
|
||||
return null;
|
||||
}
|
||||
@ -843,7 +843,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDelete(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.preDelete(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
new Delete(TEST_ROW), new WALEdit(), Durability.USE_DEFAULT);
|
||||
return null;
|
||||
}
|
||||
@ -853,7 +853,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preBatchMutate(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.preBatchMutate(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
new MiniBatchOperationInProgress<>(null, null, null, 0, 0, 0));
|
||||
return null;
|
||||
}
|
||||
@ -863,7 +863,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preCheckAndPut(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.preCheckAndPut(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
TEST_ROW, TEST_FAMILY, TEST_Q1, CompareOperator.EQUAL,
|
||||
new BinaryComparator("foo".getBytes()), new Put(TEST_ROW), true);
|
||||
return null;
|
||||
@ -874,7 +874,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preCheckAndDelete(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.preCheckAndDelete(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
TEST_ROW, TEST_FAMILY, TEST_Q1, CompareOperator.EQUAL,
|
||||
new BinaryComparator("foo".getBytes()), new Delete(TEST_ROW), true);
|
||||
return null;
|
||||
@ -885,7 +885,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preAppend(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.preAppend(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
new Append(TEST_ROW));
|
||||
return null;
|
||||
}
|
||||
@ -895,7 +895,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preIncrement(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.preIncrement(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
new Increment(TEST_ROW));
|
||||
return null;
|
||||
}
|
||||
@ -905,7 +905,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preScannerOpen(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.preScannerOpen(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
new Scan());
|
||||
return null;
|
||||
}
|
||||
@ -916,7 +916,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
List<Pair<byte[], String>> paths = Lists.newArrayList();
|
||||
ACCESS_CONTROLLER.preBulkLoadHFile(TestAccessController.createAndPrepare(RCP_ENV),
|
||||
ACCESS_CONTROLLER.preBulkLoadHFile(ObserverContextImpl.createAndPrepare(RCP_ENV),
|
||||
paths);
|
||||
return null;
|
||||
}
|
||||
|
13
pom.xml
13
pom.xml
@ -92,7 +92,6 @@
|
||||
<module>hbase-hbtop</module>
|
||||
<module>hbase-asyncfs</module>
|
||||
<module>hbase-logging</module>
|
||||
<module>hbase-coprocessor</module>
|
||||
</modules>
|
||||
<scm>
|
||||
<connection>scm:git:git://gitbox.apache.org/repos/asf/hbase.git</connection>
|
||||
@ -1628,18 +1627,6 @@
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-coprocessor</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-coprocessor</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-protocol-shaded</artifactId>
|
||||
|
Loading…
x
Reference in New Issue
Block a user