HBASE-13645: Rename *column methods in MasterObserver to *columnFamily
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
dd2c60b5bf
commit
d16f349a63
|
@ -178,70 +178,148 @@ public abstract class BaseMasterAndRegionObserver extends BaseRegionObserver
|
|||
List<NamespaceDescriptor> descriptors) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException {
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException {
|
||||
public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preAddColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor column) throws IOException {
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preAddColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postAddColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor column) throws IOException {
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postAddColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor descriptor) throws IOException {
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor descriptor) throws IOException {
|
||||
public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preModifyColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor descriptor) throws IOException {
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preModifyColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postModifyColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor descriptor) throws IOException {
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postModifyColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] c) throws IOException {
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] c) throws IOException {
|
||||
public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preDeleteColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] c) throws IOException {
|
||||
byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preDeleteColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postDeleteColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] c) throws IOException {
|
||||
byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postDeleteColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -171,70 +171,148 @@ public class BaseMasterObserver implements MasterObserver {
|
|||
List<NamespaceDescriptor> descriptors) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException {
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException {
|
||||
public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preAddColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor column) throws IOException {
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preAddColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postAddColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor column) throws IOException {
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postAddColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor descriptor) throws IOException {
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor descriptor) throws IOException {
|
||||
public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preModifyColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor descriptor) throws IOException {
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preModifyColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postModifyColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor descriptor) throws IOException {
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postModifyColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] c) throws IOException {
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] c) throws IOException {
|
||||
public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preDeleteColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] c) throws IOException {
|
||||
byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preDeleteColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postDeleteColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] c) throws IOException {
|
||||
byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postDeleteColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -231,127 +231,361 @@ public interface MasterObserver extends Coprocessor {
|
|||
* add column RPC call.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param column the HColumnDescriptor
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
|
||||
* Use {@link #preAddColumnFamily(ObserverContext, TableName, HColumnDescriptor)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void preAddColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException;
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to adding a new column family to the table. Called as part of
|
||||
* add column RPC call.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #preAddColumn(ObserverContext, TableName, HColumnDescriptor)} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
*/
|
||||
void preAddColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called after the new column family has been created. Called as part of
|
||||
* add column RPC call.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param column the HColumnDescriptor
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
|
||||
* Use {@link #postAddColumnFamily(ObserverContext, TableName, HColumnDescriptor)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void postAddColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException;
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called after the new column family has been created. Called as part of
|
||||
* add column RPC call.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #postAddColumn(ObserverContext, TableName, HColumnDescriptor)} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
*/
|
||||
void postAddColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to adding a new column family to the table. Called as part of
|
||||
* add column handler.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param column the HColumnDescriptor
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>). Use
|
||||
* {@link #preAddColumnFamilyHandler(ObserverContext, TableName, HColumnDescriptor)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void preAddColumnHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException;
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to adding a new column family to the table. Called as part of
|
||||
* add column handler.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #preAddColumnHandler(ObserverContext, TableName, HColumnDescriptor)} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
*/
|
||||
void preAddColumnFamilyHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
|
||||
/**
|
||||
* Called after the new column family has been created. Called as part of
|
||||
* add column handler.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param column the HColumnDescriptor
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>). Use
|
||||
* {@link #postAddColumnFamilyHandler(ObserverContext, TableName, HColumnDescriptor)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void postAddColumnHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException;
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called after the new column family has been created. Called as part of
|
||||
* add column handler.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #postAddColumnHandler(ObserverContext, TableName, HColumnDescriptor)} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
*/
|
||||
void postAddColumnFamilyHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to modifying a column family's attributes. Called as part of
|
||||
* modify column RPC call.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param descriptor the HColumnDescriptor
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
|
||||
* Use {@link #preModifyColumnFamily(ObserverContext, TableName, HColumnDescriptor)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void preModifyColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor descriptor) throws IOException;
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to modifying a column family's attributes. Called as part of
|
||||
* modify column RPC call.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #preModifyColumn(ObserverContext, TableName, HColumnDescriptor)} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
*/
|
||||
void preModifyColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called after the column family has been updated. Called as part of modify
|
||||
* column RPC call.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param descriptor the HColumnDescriptor
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
|
||||
* Use {@link #postModifyColumnFamily(ObserverContext, TableName, HColumnDescriptor)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void postModifyColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor descriptor) throws IOException;
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called after the column family has been updated. Called as part of modify
|
||||
* column RPC call.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #postModifyColumn(ObserverContext, TableName, HColumnDescriptor)} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
*/
|
||||
void postModifyColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to modifying a column family's attributes. Called as part of
|
||||
* modify column handler.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param descriptor the HColumnDescriptor
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
|
||||
* Use {@link #preModifyColumnFamilyHandler(ObserverContext, TableName, HColumnDescriptor)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void preModifyColumnHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor descriptor) throws IOException;
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to modifying a column family's attributes. Called as part of
|
||||
* modify column handler.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #preModifyColumnHandler(ObserverContext, TableName, HColumnDescriptor)} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
*/
|
||||
void preModifyColumnFamilyHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called after the column family has been updated. Called as part of modify
|
||||
* column handler.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param descriptor the HColumnDescriptor
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
|
||||
* Use {@link #postModifyColumnFamilyHandler(ObserverContext, TableName, HColumnDescriptor)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void postModifyColumnHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor descriptor) throws IOException;
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called after the column family has been updated. Called as part of modify
|
||||
* column handler.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #postModifyColumnHandler(ObserverContext, TableName, HColumnDescriptor)} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the HColumnDescriptor
|
||||
*/
|
||||
void postModifyColumnFamilyHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to deleting the entire column family. Called as part of
|
||||
* delete column RPC call.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param c the column
|
||||
* @param columnFamily the column family
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
|
||||
* Use {@link #preDeleteColumnFamily(ObserverContext, TableName, byte[])}.
|
||||
*/
|
||||
@Deprecated
|
||||
void preDeleteColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
final TableName tableName, final byte[] c) throws IOException;
|
||||
final TableName tableName, final byte[] columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to deleting the entire column family. Called as part of
|
||||
* delete column RPC call.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #preDeleteColumn(ObserverContext, TableName, byte[])} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the column
|
||||
*/
|
||||
void preDeleteColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
final TableName tableName, final byte[] columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called after the column family has been deleted. Called as part of delete
|
||||
* column RPC call.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param c the column
|
||||
* @param columnFamily the column family
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
|
||||
* Use {@link #postDeleteColumnFamily(ObserverContext, TableName, byte[])}.
|
||||
*/
|
||||
@Deprecated
|
||||
void postDeleteColumn(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
final TableName tableName, final byte[] c) throws IOException;
|
||||
final TableName tableName, final byte[] columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called after the column family has been deleted. Called as part of delete
|
||||
* column RPC call.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #postDeleteColumn(ObserverContext, TableName, byte[])} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the column family
|
||||
*/
|
||||
void postDeleteColumnFamily(final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
final TableName tableName, final byte[] columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to deleting the entire column family. Called as part of
|
||||
* delete column handler.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param c the column
|
||||
* @param columnFamily the column family
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
|
||||
* Use {@link #preDeleteColumnFamilyHandler(ObserverContext, TableName, byte[])}.
|
||||
*/
|
||||
@Deprecated
|
||||
void preDeleteColumnHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
final TableName tableName, final byte[] c) throws IOException;
|
||||
final TableName tableName, final byte[] columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to deleting the entire column family. Called as part of
|
||||
* delete column handler.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #preDeleteColumnHandler(ObserverContext, TableName, byte[])} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the column family
|
||||
*/
|
||||
void preDeleteColumnFamilyHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
final TableName tableName, final byte[] columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called after the column family has been deleted. Called as part of
|
||||
* delete column handler.
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param c the column
|
||||
* @param columnFamily the column family
|
||||
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
|
||||
* (<a href="https://issues.apache.org/jira/browse/HBASE-13645">HBASE-13645</a>).
|
||||
* Use {@link #postDeleteColumnFamilyHandler(ObserverContext, TableName, byte[])}.
|
||||
*/
|
||||
@Deprecated
|
||||
void postDeleteColumnHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
final TableName tableName, final byte[] c) throws IOException;
|
||||
final TableName tableName, final byte[] columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called after the column family has been deleted. Called as part of
|
||||
* delete column handler.
|
||||
*
|
||||
* Implementation note: This replaces the deprecated
|
||||
* {@link #postDeleteColumnHandler(ObserverContext, TableName, byte[])} method.
|
||||
* Make sure to implement only one of the two as both are called.
|
||||
*
|
||||
* @param ctx the environment to interact with the framework and master
|
||||
* @param tableName the name of the table
|
||||
* @param columnFamily the column family
|
||||
*/
|
||||
void postDeleteColumnFamilyHandler(
|
||||
final ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
final TableName tableName, final byte[] columnFamily) throws IOException;
|
||||
|
||||
/**
|
||||
* Called prior to enabling a table. Called as part of enable table RPC call.
|
||||
|
|
|
@ -374,132 +374,147 @@ public class MasterCoprocessorHost
|
|||
});
|
||||
}
|
||||
|
||||
public boolean preAddColumn(final TableName tableName, final HColumnDescriptor column)
|
||||
public boolean preAddColumn(final TableName tableName, final HColumnDescriptor columnFamily)
|
||||
throws IOException {
|
||||
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.preAddColumn(ctx, tableName, column);
|
||||
oserver.preAddColumn(ctx, tableName, columnFamily);
|
||||
oserver.preAddColumnFamily(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void postAddColumn(final TableName tableName, final HColumnDescriptor column)
|
||||
public void postAddColumn(final TableName tableName, final HColumnDescriptor columnFamily)
|
||||
throws IOException {
|
||||
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.postAddColumn(ctx, tableName, column);
|
||||
oserver.postAddColumn(ctx, tableName, columnFamily);
|
||||
oserver.postAddColumnFamily(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean preAddColumnHandler(final TableName tableName, final HColumnDescriptor column)
|
||||
public boolean preAddColumnHandler(final TableName tableName,
|
||||
final HColumnDescriptor columnFamily)
|
||||
throws IOException {
|
||||
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.preAddColumnHandler(ctx, tableName, column);
|
||||
oserver.preAddColumnHandler(ctx, tableName, columnFamily);
|
||||
oserver.preAddColumnFamilyHandler(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void postAddColumnHandler(final TableName tableName, final HColumnDescriptor column)
|
||||
public void postAddColumnHandler(final TableName tableName, final HColumnDescriptor columnFamily)
|
||||
throws IOException {
|
||||
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.postAddColumnHandler(ctx, tableName, column);
|
||||
oserver.postAddColumnHandler(ctx, tableName, columnFamily);
|
||||
oserver.postAddColumnFamilyHandler(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean preModifyColumn(final TableName tableName, final HColumnDescriptor descriptor)
|
||||
public boolean preModifyColumn(final TableName tableName, final HColumnDescriptor columnFamily)
|
||||
throws IOException {
|
||||
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.preModifyColumn(ctx, tableName, descriptor);
|
||||
oserver.preModifyColumn(ctx, tableName, columnFamily);
|
||||
oserver.preModifyColumnFamily(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void postModifyColumn(final TableName tableName, final HColumnDescriptor descriptor)
|
||||
public void postModifyColumn(final TableName tableName, final HColumnDescriptor columnFamily)
|
||||
throws IOException {
|
||||
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.postModifyColumn(ctx, tableName, descriptor);
|
||||
oserver.postModifyColumn(ctx, tableName, columnFamily);
|
||||
oserver.postModifyColumnFamily(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean preModifyColumnHandler(final TableName tableName,
|
||||
final HColumnDescriptor descriptor) throws IOException {
|
||||
final HColumnDescriptor columnFamily) throws IOException {
|
||||
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.preModifyColumnHandler(ctx, tableName, descriptor);
|
||||
oserver.preModifyColumnHandler(ctx, tableName, columnFamily);
|
||||
oserver.preModifyColumnFamilyHandler(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void postModifyColumnHandler(final TableName tableName,
|
||||
final HColumnDescriptor descriptor) throws IOException {
|
||||
final HColumnDescriptor columnFamily) throws IOException {
|
||||
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.postModifyColumnHandler(ctx, tableName, descriptor);
|
||||
oserver.postModifyColumnHandler(ctx, tableName, columnFamily);
|
||||
oserver.postModifyColumnFamilyHandler(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean preDeleteColumn(final TableName tableName, final byte [] c) throws IOException {
|
||||
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.preDeleteColumn(ctx, tableName, c);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void postDeleteColumn(final TableName tableName, final byte [] c) throws IOException {
|
||||
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.postDeleteColumn(ctx, tableName, c);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean preDeleteColumnHandler(final TableName tableName, final byte[] c)
|
||||
public boolean preDeleteColumn(final TableName tableName, final byte[] columnFamily)
|
||||
throws IOException {
|
||||
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.preDeleteColumnHandler(ctx, tableName, c);
|
||||
oserver.preDeleteColumn(ctx, tableName, columnFamily);
|
||||
oserver.preDeleteColumnFamily(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void postDeleteColumnHandler(final TableName tableName, final byte[] c)
|
||||
public void postDeleteColumn(final TableName tableName, final byte[] columnFamily)
|
||||
throws IOException {
|
||||
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.postDeleteColumnHandler(ctx, tableName, c);
|
||||
oserver.postDeleteColumn(ctx, tableName, columnFamily);
|
||||
oserver.postDeleteColumnFamily(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean preDeleteColumnHandler(final TableName tableName, final byte[] columnFamily)
|
||||
throws IOException {
|
||||
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.preDeleteColumnHandler(ctx, tableName, columnFamily);
|
||||
oserver.preDeleteColumnFamilyHandler(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void postDeleteColumnHandler(final TableName tableName, final byte[] columnFamily)
|
||||
throws IOException {
|
||||
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
|
||||
@Override
|
||||
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
|
||||
throws IOException {
|
||||
oserver.postDeleteColumnHandler(ctx, tableName, columnFamily);
|
||||
oserver.postDeleteColumnFamilyHandler(ctx, tableName, columnFamily);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1119,33 +1119,35 @@ public class AccessController extends BaseMasterAndRegionObserver
|
|||
}
|
||||
|
||||
@Override
|
||||
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName,
|
||||
HColumnDescriptor column) throws IOException {
|
||||
requireTablePermission("addColumn", tableName, column.getName(), null, Action.ADMIN,
|
||||
Action.CREATE);
|
||||
public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily)
|
||||
throws IOException {
|
||||
requireTablePermission("addColumn", tableName, columnFamily.getName(), null, Action.ADMIN,
|
||||
Action.CREATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName,
|
||||
HColumnDescriptor descriptor) throws IOException {
|
||||
requirePermission("modifyColumn", tableName, descriptor.getName(), null, Action.ADMIN,
|
||||
public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily)
|
||||
throws IOException {
|
||||
requirePermission("modifyColumn", tableName, columnFamily.getName(), null, Action.ADMIN,
|
||||
Action.CREATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName,
|
||||
byte[] col) throws IOException {
|
||||
requirePermission("deleteColumn", tableName, col, null, Action.ADMIN, Action.CREATE);
|
||||
public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
requirePermission("deleteColumn", tableName, columnFamily, null, Action.ADMIN, Action.CREATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c,
|
||||
final TableName tableName, final byte[] col) throws IOException {
|
||||
final Configuration conf = c.getEnvironment().getConfiguration();
|
||||
public void postDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
final TableName tableName, final byte[] columnFamily) throws IOException {
|
||||
final Configuration conf = ctx.getEnvironment().getConfiguration();
|
||||
User.runAsLoginUser(new PrivilegedExceptionAction<Void>() {
|
||||
@Override
|
||||
public Void run() throws Exception {
|
||||
AccessControlLists.removeTablePermissions(conf, tableName, col);
|
||||
AccessControlLists.removeTablePermissions(conf, tableName, columnFamily);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -219,8 +219,9 @@ public class VisibilityController extends BaseMasterAndRegionObserver implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor column) throws IOException {
|
||||
public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily)
|
||||
throws IOException {
|
||||
if (!authorizationEnabled) {
|
||||
return;
|
||||
}
|
||||
|
@ -230,8 +231,8 @@ public class VisibilityController extends BaseMasterAndRegionObserver implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor descriptor) throws IOException {
|
||||
public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
if (!authorizationEnabled) {
|
||||
return;
|
||||
}
|
||||
|
@ -241,8 +242,8 @@ public class VisibilityController extends BaseMasterAndRegionObserver implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] c) throws IOException {
|
||||
public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
if (!authorizationEnabled) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -445,21 +445,35 @@ public class TestMasterObserver {
|
|||
return preListNamespaceDescriptorsCalled && !postListNamespaceDescriptorsCalled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> env,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException {
|
||||
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily
|
||||
) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily
|
||||
) throws IOException {
|
||||
if (bypass) {
|
||||
env.bypass();
|
||||
ctx.bypass();
|
||||
}else{
|
||||
env.shouldBypass();
|
||||
ctx.shouldBypass();
|
||||
}
|
||||
|
||||
preAddColumnCalled = true;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> env,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException {
|
||||
public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
postAddColumnCalled = true;
|
||||
}
|
||||
|
||||
|
@ -471,18 +485,30 @@ public class TestMasterObserver {
|
|||
return preAddColumnCalled && !postAddColumnCalled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> env,
|
||||
TableName tableName, HColumnDescriptor descriptor) throws IOException {
|
||||
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
if (bypass) {
|
||||
env.bypass();
|
||||
ctx.bypass();
|
||||
}
|
||||
preModifyColumnCalled = true;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> env,
|
||||
TableName tableName, HColumnDescriptor descriptor) throws IOException {
|
||||
public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
postModifyColumnCalled = true;
|
||||
}
|
||||
|
||||
|
@ -494,21 +520,34 @@ public class TestMasterObserver {
|
|||
return preModifyColumnCalled && !postModifyColumnCalled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> env,
|
||||
TableName tableName, byte[] c) throws IOException {
|
||||
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
if (bypass) {
|
||||
env.bypass();
|
||||
ctx.bypass();
|
||||
}
|
||||
preDeleteColumnCalled = true;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> env,
|
||||
TableName tableName, byte[] c) throws IOException {
|
||||
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
postDeleteColumnCalled = true;
|
||||
}
|
||||
|
||||
|
||||
public boolean wasDeleteColumnCalled() {
|
||||
return preDeleteColumnCalled && postDeleteColumnCalled;
|
||||
}
|
||||
|
@ -938,22 +977,37 @@ public class TestMasterObserver {
|
|||
return preModifyColumnHandlerCalled && !postModifyColumnHandlerCalled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preAddColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> env, TableName tableName,
|
||||
HColumnDescriptor column) throws IOException {
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preAddColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
if (bypass) {
|
||||
env.bypass();
|
||||
ctx.bypass();
|
||||
}
|
||||
preAddColumnHandlerCalled = true;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postAddColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor column) throws IOException {
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postAddColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
postAddColumnHandlerCalled = true;
|
||||
}
|
||||
|
||||
public boolean wasAddColumnHandlerCalled() {
|
||||
return preAddColumnHandlerCalled && postAddColumnHandlerCalled;
|
||||
}
|
||||
|
@ -962,20 +1016,34 @@ public class TestMasterObserver {
|
|||
return preAddColumnHandlerCalled && !postAddColumnHandlerCalled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preModifyColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> env, TableName tableName,
|
||||
HColumnDescriptor descriptor) throws IOException {
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preModifyColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
if (bypass) {
|
||||
env.bypass();
|
||||
ctx.bypass();
|
||||
}
|
||||
preModifyColumnHandlerCalled = true;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postModifyColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor descriptor) throws IOException {
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postModifyColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
HColumnDescriptor columnFamily) throws IOException {
|
||||
postModifyColumnHandlerCalled = true;
|
||||
}
|
||||
|
||||
|
@ -986,20 +1054,35 @@ public class TestMasterObserver {
|
|||
public boolean preModifyColumnHandlerCalledOnly() {
|
||||
return preModifyColumnHandlerCalled && !postModifyColumnHandlerCalled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void preDeleteColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> env, TableName tableName,
|
||||
byte[] c) throws IOException {
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preDeleteColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] columnFamily) throws IOException {
|
||||
if (bypass) {
|
||||
env.bypass();
|
||||
ctx.bypass();
|
||||
}
|
||||
preDeleteColumnHandlerCalled = true;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void postDeleteColumnHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] c) throws IOException {
|
||||
byte[] columnFamily) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postDeleteColumnFamilyHandler(
|
||||
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
|
||||
byte[] columnFamily) throws IOException {
|
||||
postDeleteColumnHandlerCalled = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -105,19 +105,19 @@ public class TestTableLockManager {
|
|||
|
||||
public static class TestLockTimeoutExceptionMasterObserver extends BaseMasterObserver {
|
||||
@Override
|
||||
public void preDeleteColumnHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] c) throws IOException {
|
||||
public void preDeleteColumnFamilyHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
deleteColumn.countDown();
|
||||
}
|
||||
@Override
|
||||
public void postDeleteColumnHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] c) throws IOException {
|
||||
public void postDeleteColumnFamilyHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, byte[] columnFamily) throws IOException {
|
||||
Threads.sleep(10000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preAddColumnHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException {
|
||||
public void preAddColumnFamilyHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
fail("Add column should have timeouted out for acquiring the table lock");
|
||||
}
|
||||
}
|
||||
|
@ -170,15 +170,15 @@ public class TestTableLockManager {
|
|||
|
||||
public static class TestAlterAndDisableMasterObserver extends BaseMasterObserver {
|
||||
@Override
|
||||
public void preAddColumnHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException {
|
||||
public void preAddColumnFamilyHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
LOG.debug("addColumn called");
|
||||
addColumn.countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postAddColumnHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor column) throws IOException {
|
||||
public void postAddColumnFamilyHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
|
||||
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
|
||||
Threads.sleep(6000);
|
||||
try {
|
||||
ctx.getEnvironment().getMasterServices().checkTableModifiable(tableName);
|
||||
|
|
|
@ -370,7 +370,7 @@ public class TestAccessController extends SecureTestUtil {
|
|||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preAddColumn(ObserverContext.createAndPrepare(CP_ENV, null), TEST_TABLE.getTableName(),
|
||||
ACCESS_CONTROLLER.preAddColumnFamily(ObserverContext.createAndPrepare(CP_ENV, null), TEST_TABLE.getTableName(),
|
||||
hcd);
|
||||
return null;
|
||||
}
|
||||
|
@ -387,7 +387,7 @@ public class TestAccessController extends SecureTestUtil {
|
|||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preModifyColumn(ObserverContext.createAndPrepare(CP_ENV, null),
|
||||
ACCESS_CONTROLLER.preModifyColumnFamily(ObserverContext.createAndPrepare(CP_ENV, null),
|
||||
TEST_TABLE.getTableName(), hcd);
|
||||
return null;
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ public class TestAccessController extends SecureTestUtil {
|
|||
AccessTestAction action = new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDeleteColumn(ObserverContext.createAndPrepare(CP_ENV, null),
|
||||
ACCESS_CONTROLLER.preDeleteColumnFamily(ObserverContext.createAndPrepare(CP_ENV, null),
|
||||
TEST_TABLE.getTableName(), TEST_FAMILY);
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -522,33 +522,33 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
|
|||
}
|
||||
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
|
||||
|
||||
// preAddColumn
|
||||
// preAddColumnFamily
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY2);
|
||||
ACCESS_CONTROLLER.preAddColumn(ObserverContext.createAndPrepare(CP_ENV, null),
|
||||
ACCESS_CONTROLLER.preAddColumnFamily(ObserverContext.createAndPrepare(CP_ENV, null),
|
||||
TEST_TABLE.getTableName(), hcd);
|
||||
return null;
|
||||
}
|
||||
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
|
||||
|
||||
// preModifyColumn
|
||||
// preModifyColumnFamily
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY2);
|
||||
ACCESS_CONTROLLER.preModifyColumn(ObserverContext.createAndPrepare(CP_ENV, null),
|
||||
ACCESS_CONTROLLER.preModifyColumnFamily(ObserverContext.createAndPrepare(CP_ENV, null),
|
||||
TEST_TABLE.getTableName(), hcd);
|
||||
return null;
|
||||
}
|
||||
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
|
||||
|
||||
// preDeleteColumn
|
||||
// preDeleteColumnFamily
|
||||
verifyAllowed(new AccessTestAction() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
ACCESS_CONTROLLER.preDeleteColumn(ObserverContext.createAndPrepare(CP_ENV, null),
|
||||
ACCESS_CONTROLLER.preDeleteColumnFamily(ObserverContext.createAndPrepare(CP_ENV, null),
|
||||
TEST_TABLE.getTableName(), TEST_FAMILY2);
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue