HBASE-13645: Rename *column methods in MasterObserver to *columnFamily

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Lars Francke 2015-05-09 01:14:55 +02:00 committed by stack
parent dd2c60b5bf
commit d16f349a63
10 changed files with 652 additions and 161 deletions

View File

@ -178,70 +178,148 @@ public abstract class BaseMasterAndRegionObserver extends BaseRegionObserver
List<NamespaceDescriptor> descriptors) throws IOException { List<NamespaceDescriptor> descriptors) throws IOException {
} }
@Deprecated
@Override @Override
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor column) throws IOException { TableName tableName, HColumnDescriptor columnFamily) throws IOException {
} }
@Override @Override
public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor column) throws IOException { 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 @Override
public void preAddColumnHandler( public void preAddColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 @Override
public void postAddColumnHandler( public void postAddColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 @Override
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor descriptor) throws IOException { TableName tableName, HColumnDescriptor columnFamily) throws IOException {
} }
@Override @Override
public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor descriptor) throws IOException { 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 @Override
public void preModifyColumnHandler( public void preModifyColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 @Override
public void postModifyColumnHandler( public void postModifyColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 @Override
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, byte[] c) throws IOException { TableName tableName, byte[] columnFamily) throws IOException {
} }
@Override @Override
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, byte[] c) throws IOException { 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 @Override
public void preDeleteColumnHandler( public void preDeleteColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 @Override
public void postDeleteColumnHandler( public void postDeleteColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 {
} }

View File

@ -171,70 +171,148 @@ public class BaseMasterObserver implements MasterObserver {
List<NamespaceDescriptor> descriptors) throws IOException { List<NamespaceDescriptor> descriptors) throws IOException {
} }
@Deprecated
@Override @Override
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor column) throws IOException { TableName tableName, HColumnDescriptor columnFamily) throws IOException {
} }
@Override @Override
public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor column) throws IOException { 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 @Override
public void preAddColumnHandler( public void preAddColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 @Override
public void postAddColumnHandler( public void postAddColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 @Override
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor descriptor) throws IOException { TableName tableName, HColumnDescriptor columnFamily) throws IOException {
} }
@Override @Override
public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor descriptor) throws IOException { 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 @Override
public void preModifyColumnHandler( public void preModifyColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 @Override
public void postModifyColumnHandler( public void postModifyColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 @Override
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, byte[] c) throws IOException { TableName tableName, byte[] columnFamily) throws IOException {
} }
@Override @Override
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, byte[] c) throws IOException { 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 @Override
public void preDeleteColumnHandler( public void preDeleteColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 @Override
public void postDeleteColumnHandler( public void postDeleteColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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 {
} }

View File

@ -231,127 +231,361 @@ public interface MasterObserver extends Coprocessor {
* add column RPC call. * add column RPC call.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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, 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 * Called after the new column family has been created. Called as part of
* add column RPC call. * add column RPC call.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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, 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 * Called prior to adding a new column family to the table. Called as part of
* add column handler. * add column handler.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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( void preAddColumnHandler(
final ObserverContext<MasterCoprocessorEnvironment> ctx, 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 * Called after the new column family has been created. Called as part of
* add column handler. * add column handler.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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( void postAddColumnHandler(
final ObserverContext<MasterCoprocessorEnvironment> ctx, 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 * Called prior to modifying a column family's attributes. Called as part of
* modify column RPC call. * modify column RPC call.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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, 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 * Called after the column family has been updated. Called as part of modify
* column RPC call. * column RPC call.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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, 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 * Called prior to modifying a column family's attributes. Called as part of
* modify column handler. * modify column handler.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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( void preModifyColumnHandler(
final ObserverContext<MasterCoprocessorEnvironment> ctx, 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 * Called after the column family has been updated. Called as part of modify
* column handler. * column handler.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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( void postModifyColumnHandler(
final ObserverContext<MasterCoprocessorEnvironment> ctx, 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 * Called prior to deleting the entire column family. Called as part of
* delete column RPC call. * delete column RPC call.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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, 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 * Called after the column family has been deleted. Called as part of delete
* column RPC call. * column RPC call.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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, 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 * Called prior to deleting the entire column family. Called as part of
* delete column handler. * delete column handler.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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( void preDeleteColumnHandler(
final ObserverContext<MasterCoprocessorEnvironment> ctx, 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 * Called after the column family has been deleted. Called as part of
* delete column handler. * delete column handler.
* @param ctx the environment to interact with the framework and master * @param ctx the environment to interact with the framework and master
* @param tableName the name of the table * @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( void postDeleteColumnHandler(
final ObserverContext<MasterCoprocessorEnvironment> ctx, 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. * Called prior to enabling a table. Called as part of enable table RPC call.

View File

@ -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 { throws IOException {
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override @Override
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException { 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 { throws IOException {
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override @Override
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException { 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 { throws IOException {
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override @Override
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException { 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 { throws IOException {
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override @Override
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException { 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 { throws IOException {
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override @Override
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException { 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 { throws IOException {
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override @Override
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException { throws IOException {
oserver.postModifyColumn(ctx, tableName, descriptor); oserver.postModifyColumn(ctx, tableName, columnFamily);
oserver.postModifyColumnFamily(ctx, tableName, columnFamily);
} }
}); });
} }
public boolean preModifyColumnHandler(final TableName tableName, public boolean preModifyColumnHandler(final TableName tableName,
final HColumnDescriptor descriptor) throws IOException { final HColumnDescriptor columnFamily) throws IOException {
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override @Override
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException { throws IOException {
oserver.preModifyColumnHandler(ctx, tableName, descriptor); oserver.preModifyColumnHandler(ctx, tableName, columnFamily);
oserver.preModifyColumnFamilyHandler(ctx, tableName, columnFamily);
} }
}); });
} }
public void postModifyColumnHandler(final TableName tableName, public void postModifyColumnHandler(final TableName tableName,
final HColumnDescriptor descriptor) throws IOException { final HColumnDescriptor columnFamily) throws IOException {
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override @Override
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException { 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 { public boolean preDeleteColumn(final TableName tableName, final byte[] columnFamily)
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)
throws IOException { throws IOException {
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override @Override
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException { 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 { throws IOException {
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override @Override
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException { 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);
} }
}); });
} }

View File

@ -1119,33 +1119,35 @@ public class AccessController extends BaseMasterAndRegionObserver
} }
@Override @Override
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
HColumnDescriptor column) throws IOException { TableName tableName, HColumnDescriptor columnFamily)
requireTablePermission("addColumn", tableName, column.getName(), null, Action.ADMIN, throws IOException {
Action.CREATE); requireTablePermission("addColumn", tableName, columnFamily.getName(), null, Action.ADMIN,
Action.CREATE);
} }
@Override @Override
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
HColumnDescriptor descriptor) throws IOException { TableName tableName, HColumnDescriptor columnFamily)
requirePermission("modifyColumn", tableName, descriptor.getName(), null, Action.ADMIN, throws IOException {
requirePermission("modifyColumn", tableName, columnFamily.getName(), null, Action.ADMIN,
Action.CREATE); Action.CREATE);
} }
@Override @Override
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c, TableName tableName, public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] col) throws IOException { TableName tableName, byte[] columnFamily) throws IOException {
requirePermission("deleteColumn", tableName, col, null, Action.ADMIN, Action.CREATE); requirePermission("deleteColumn", tableName, columnFamily, null, Action.ADMIN, Action.CREATE);
} }
@Override @Override
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c, public void postDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
final TableName tableName, final byte[] col) throws IOException { final TableName tableName, final byte[] columnFamily) throws IOException {
final Configuration conf = c.getEnvironment().getConfiguration(); final Configuration conf = ctx.getEnvironment().getConfiguration();
User.runAsLoginUser(new PrivilegedExceptionAction<Void>() { User.runAsLoginUser(new PrivilegedExceptionAction<Void>() {
@Override @Override
public Void run() throws Exception { public Void run() throws Exception {
AccessControlLists.removeTablePermissions(conf, tableName, col); AccessControlLists.removeTablePermissions(conf, tableName, columnFamily);
return null; return null;
} }
}); });

View File

@ -219,8 +219,9 @@ public class VisibilityController extends BaseMasterAndRegionObserver implements
} }
@Override @Override
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
HColumnDescriptor column) throws IOException { TableName tableName, HColumnDescriptor columnFamily)
throws IOException {
if (!authorizationEnabled) { if (!authorizationEnabled) {
return; return;
} }
@ -230,8 +231,8 @@ public class VisibilityController extends BaseMasterAndRegionObserver implements
} }
@Override @Override
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor descriptor) throws IOException { TableName tableName, HColumnDescriptor columnFamily) throws IOException {
if (!authorizationEnabled) { if (!authorizationEnabled) {
return; return;
} }
@ -241,8 +242,8 @@ public class VisibilityController extends BaseMasterAndRegionObserver implements
} }
@Override @Override
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, byte[] c) throws IOException { TableName tableName, byte[] columnFamily) throws IOException {
if (!authorizationEnabled) { if (!authorizationEnabled) {
return; return;
} }

View File

@ -445,21 +445,35 @@ public class TestMasterObserver {
return preListNamespaceDescriptorsCalled && !postListNamespaceDescriptorsCalled; return preListNamespaceDescriptorsCalled && !postListNamespaceDescriptorsCalled;
} }
@Deprecated
@Override @Override
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> env, public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor column) throws IOException { TableName tableName, HColumnDescriptor columnFamily
) throws IOException {
}
@Override
public void preAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor columnFamily
) throws IOException {
if (bypass) { if (bypass) {
env.bypass(); ctx.bypass();
}else{ }else{
env.shouldBypass(); ctx.shouldBypass();
} }
preAddColumnCalled = true; preAddColumnCalled = true;
} }
@Deprecated
@Override @Override
public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> env, public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor column) throws IOException { TableName tableName, HColumnDescriptor columnFamily) throws IOException {
}
@Override
public void postAddColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
postAddColumnCalled = true; postAddColumnCalled = true;
} }
@ -471,18 +485,30 @@ public class TestMasterObserver {
return preAddColumnCalled && !postAddColumnCalled; return preAddColumnCalled && !postAddColumnCalled;
} }
@Deprecated
@Override @Override
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> env, public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor descriptor) throws IOException { TableName tableName, HColumnDescriptor columnFamily) throws IOException {
}
@Override
public void preModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
if (bypass) { if (bypass) {
env.bypass(); ctx.bypass();
} }
preModifyColumnCalled = true; preModifyColumnCalled = true;
} }
@Deprecated
@Override @Override
public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> env, public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor descriptor) throws IOException { TableName tableName, HColumnDescriptor columnFamily) throws IOException {
}
@Override
public void postModifyColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor columnFamily) throws IOException {
postModifyColumnCalled = true; postModifyColumnCalled = true;
} }
@ -494,21 +520,34 @@ public class TestMasterObserver {
return preModifyColumnCalled && !postModifyColumnCalled; return preModifyColumnCalled && !postModifyColumnCalled;
} }
@Deprecated
@Override @Override
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> env, public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, byte[] c) throws IOException { TableName tableName, byte[] columnFamily) throws IOException {
}
@Override
public void preDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, byte[] columnFamily) throws IOException {
if (bypass) { if (bypass) {
env.bypass(); ctx.bypass();
} }
preDeleteColumnCalled = true; preDeleteColumnCalled = true;
} }
@Deprecated
@Override @Override
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> env, public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, byte[] c) throws IOException { TableName tableName, byte[] columnFamily) throws IOException {
}
@Override
public void postDeleteColumnFamily(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, byte[] columnFamily) throws IOException {
postDeleteColumnCalled = true; postDeleteColumnCalled = true;
} }
public boolean wasDeleteColumnCalled() { public boolean wasDeleteColumnCalled() {
return preDeleteColumnCalled && postDeleteColumnCalled; return preDeleteColumnCalled && postDeleteColumnCalled;
} }
@ -938,22 +977,37 @@ public class TestMasterObserver {
return preModifyColumnHandlerCalled && !postModifyColumnHandlerCalled; return preModifyColumnHandlerCalled && !postModifyColumnHandlerCalled;
} }
@Deprecated
@Override @Override
public void preAddColumnHandler( public void preAddColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> env, TableName tableName, 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 {
if (bypass) { if (bypass) {
env.bypass(); ctx.bypass();
} }
preAddColumnHandlerCalled = true; preAddColumnHandlerCalled = true;
} }
@Deprecated
@Override @Override
public void postAddColumnHandler( public void postAddColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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; postAddColumnHandlerCalled = true;
} }
public boolean wasAddColumnHandlerCalled() { public boolean wasAddColumnHandlerCalled() {
return preAddColumnHandlerCalled && postAddColumnHandlerCalled; return preAddColumnHandlerCalled && postAddColumnHandlerCalled;
} }
@ -962,20 +1016,34 @@ public class TestMasterObserver {
return preAddColumnHandlerCalled && !postAddColumnHandlerCalled; return preAddColumnHandlerCalled && !postAddColumnHandlerCalled;
} }
@Deprecated
@Override @Override
public void preModifyColumnHandler( public void preModifyColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> env, TableName tableName, 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 {
if (bypass) { if (bypass) {
env.bypass(); ctx.bypass();
} }
preModifyColumnHandlerCalled = true; preModifyColumnHandlerCalled = true;
} }
@Deprecated
@Override @Override
public void postModifyColumnHandler( public void postModifyColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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; postModifyColumnHandlerCalled = true;
} }
@ -986,20 +1054,35 @@ public class TestMasterObserver {
public boolean preModifyColumnHandlerCalledOnly() { public boolean preModifyColumnHandlerCalledOnly() {
return preModifyColumnHandlerCalled && !postModifyColumnHandlerCalled; return preModifyColumnHandlerCalled && !postModifyColumnHandlerCalled;
} }
@Deprecated
@Override @Override
public void preDeleteColumnHandler( public void preDeleteColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> env, TableName tableName, 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 {
if (bypass) { if (bypass) {
env.bypass(); ctx.bypass();
} }
preDeleteColumnHandlerCalled = true; preDeleteColumnHandlerCalled = true;
} }
@Deprecated
@Override @Override
public void postDeleteColumnHandler( public void postDeleteColumnHandler(
ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName, 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; postDeleteColumnHandlerCalled = true;
} }

View File

@ -105,19 +105,19 @@ public class TestTableLockManager {
public static class TestLockTimeoutExceptionMasterObserver extends BaseMasterObserver { public static class TestLockTimeoutExceptionMasterObserver extends BaseMasterObserver {
@Override @Override
public void preDeleteColumnHandler(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preDeleteColumnFamilyHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, byte[] c) throws IOException { TableName tableName, byte[] columnFamily) throws IOException {
deleteColumn.countDown(); deleteColumn.countDown();
} }
@Override @Override
public void postDeleteColumnHandler(ObserverContext<MasterCoprocessorEnvironment> ctx, public void postDeleteColumnFamilyHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, byte[] c) throws IOException { TableName tableName, byte[] columnFamily) throws IOException {
Threads.sleep(10000); Threads.sleep(10000);
} }
@Override @Override
public void preAddColumnHandler(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preAddColumnFamilyHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor column) throws IOException { TableName tableName, HColumnDescriptor columnFamily) throws IOException {
fail("Add column should have timeouted out for acquiring the table lock"); 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 { public static class TestAlterAndDisableMasterObserver extends BaseMasterObserver {
@Override @Override
public void preAddColumnHandler(ObserverContext<MasterCoprocessorEnvironment> ctx, public void preAddColumnFamilyHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor column) throws IOException { TableName tableName, HColumnDescriptor columnFamily) throws IOException {
LOG.debug("addColumn called"); LOG.debug("addColumn called");
addColumn.countDown(); addColumn.countDown();
} }
@Override @Override
public void postAddColumnHandler(ObserverContext<MasterCoprocessorEnvironment> ctx, public void postAddColumnFamilyHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName, HColumnDescriptor column) throws IOException { TableName tableName, HColumnDescriptor columnFamily) throws IOException {
Threads.sleep(6000); Threads.sleep(6000);
try { try {
ctx.getEnvironment().getMasterServices().checkTableModifiable(tableName); ctx.getEnvironment().getMasterServices().checkTableModifiable(tableName);

View File

@ -370,7 +370,7 @@ public class TestAccessController extends SecureTestUtil {
AccessTestAction action = new AccessTestAction() { AccessTestAction action = new AccessTestAction() {
@Override @Override
public Object run() throws Exception { 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); hcd);
return null; return null;
} }
@ -387,7 +387,7 @@ public class TestAccessController extends SecureTestUtil {
AccessTestAction action = new AccessTestAction() { AccessTestAction action = new AccessTestAction() {
@Override @Override
public Object run() throws Exception { 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); TEST_TABLE.getTableName(), hcd);
return null; return null;
} }
@ -402,7 +402,7 @@ public class TestAccessController extends SecureTestUtil {
AccessTestAction action = new AccessTestAction() { AccessTestAction action = new AccessTestAction() {
@Override @Override
public Object run() throws Exception { 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); TEST_TABLE.getTableName(), TEST_FAMILY);
return null; return null;
} }

View File

@ -522,33 +522,33 @@ public class TestWithDisabledAuthorization extends SecureTestUtil {
} }
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE); }, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
// preAddColumn // preAddColumnFamily
verifyAllowed(new AccessTestAction() { verifyAllowed(new AccessTestAction() {
@Override @Override
public Object run() throws Exception { public Object run() throws Exception {
HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY2); 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); TEST_TABLE.getTableName(), hcd);
return null; return null;
} }
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE); }, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
// preModifyColumn // preModifyColumnFamily
verifyAllowed(new AccessTestAction() { verifyAllowed(new AccessTestAction() {
@Override @Override
public Object run() throws Exception { public Object run() throws Exception {
HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY2); 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); TEST_TABLE.getTableName(), hcd);
return null; return null;
} }
}, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE); }, SUPERUSER, USER_ADMIN, USER_RW, USER_RO, USER_OWNER, USER_CREATE, USER_QUAL, USER_NONE);
// preDeleteColumn // preDeleteColumnFamily
verifyAllowed(new AccessTestAction() { verifyAllowed(new AccessTestAction() {
@Override @Override
public Object run() throws Exception { 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); TEST_TABLE.getTableName(), TEST_FAMILY2);
return null; return null;
} }