diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java index 4e373e7..f36b49d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java @@ -55,7 +55,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param desc the HTableDescriptor for the table * @param regions the initial regions created for the table - * @throws IOException + * @throws IOException if an IO error occurs */ void preCreateTable(final ObserverContext ctx, HTableDescriptor desc, HRegionInfo[] regions) throws IOException; @@ -66,7 +66,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param desc the HTableDescriptor for the table * @param regions the initial regions created for the table - * @throws IOException + * @throws IOException if an IO error occurs */ void postCreateTable(final ObserverContext ctx, HTableDescriptor desc, HRegionInfo[] regions) throws IOException; @@ -78,7 +78,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param desc the HTableDescriptor for the table * @param regions the initial regions created for the table - * @throws IOException + * @throws IOException if an IO error occurs */ void preCreateTableHandler(final ObserverContext ctx, HTableDescriptor desc, HRegionInfo[] regions) throws IOException; @@ -90,7 +90,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param desc the HTableDescriptor for the table * @param regions the initial regions created for the table - * @throws IOException + * @throws IOException if an IO error occurs */ void postCreateTableHandler(final ObserverContext ctx, HTableDescriptor desc, HRegionInfo[] regions) throws IOException; @@ -101,6 +101,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void preDeleteTable(final ObserverContext ctx, TableName tableName) throws IOException; @@ -110,6 +111,7 @@ public interface MasterObserver extends Coprocessor { * of delete table RPC call. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void postDeleteTable(final ObserverContext ctx, TableName tableName) throws IOException; @@ -121,6 +123,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void preDeleteTableHandler( final ObserverContext ctx, TableName tableName) @@ -133,6 +136,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void postDeleteTableHandler( final ObserverContext ctx, TableName tableName) @@ -145,6 +149,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void preTruncateTable(final ObserverContext ctx, TableName tableName) throws IOException; @@ -156,6 +161,7 @@ public interface MasterObserver extends Coprocessor { * truncate operation is terminated. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void postTruncateTable(final ObserverContext ctx, TableName tableName) throws IOException; @@ -167,6 +173,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void preTruncateTableHandler( final ObserverContext ctx, TableName tableName) @@ -179,6 +186,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void postTruncateTableHandler( final ObserverContext ctx, TableName tableName) @@ -191,6 +199,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param htd the HTableDescriptor + * @throws IOException if an IO error occurs */ void preModifyTable(final ObserverContext ctx, final TableName tableName, HTableDescriptor htd) throws IOException; @@ -201,6 +210,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param htd the HTableDescriptor + * @throws IOException if an IO error occurs */ void postModifyTable(final ObserverContext ctx, final TableName tableName, HTableDescriptor htd) throws IOException; @@ -212,6 +222,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param htd the HTableDescriptor + * @throws IOException if an IO error occurs */ void preModifyTableHandler( final ObserverContext ctx, @@ -224,6 +235,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param htd the HTableDescriptor + * @throws IOException if an IO error occurs */ void postModifyTableHandler( final ObserverContext ctx, @@ -235,6 +247,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param column the HColumnDescriptor + * @throws IOException if an IO error occurs */ void preAddColumn(final ObserverContext ctx, TableName tableName, HColumnDescriptor column) throws IOException; @@ -245,6 +258,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param column the HColumnDescriptor + * @throws IOException if an IO error occurs */ void postAddColumn(final ObserverContext ctx, TableName tableName, HColumnDescriptor column) throws IOException; @@ -255,6 +269,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param column the HColumnDescriptor + * @throws IOException if an IO error occurs */ void preAddColumnHandler( final ObserverContext ctx, @@ -266,6 +281,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param column the HColumnDescriptor + * @throws IOException if an IO error occurs */ void postAddColumnHandler( final ObserverContext ctx, @@ -277,6 +293,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param descriptor the HColumnDescriptor + * @throws IOException if an IO error occurs */ void preModifyColumn(final ObserverContext ctx, TableName tableName, HColumnDescriptor descriptor) throws IOException; @@ -287,6 +304,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param descriptor the HColumnDescriptor + * @throws IOException if an IO error occurs */ void postModifyColumn(final ObserverContext ctx, TableName tableName, HColumnDescriptor descriptor) throws IOException; @@ -297,6 +315,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param descriptor the HColumnDescriptor + * @throws IOException if an IO error occurs */ void preModifyColumnHandler( final ObserverContext ctx, @@ -308,6 +327,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param descriptor the HColumnDescriptor + * @throws IOException if an IO error occurs */ void postModifyColumnHandler( final ObserverContext ctx, @@ -320,6 +340,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param c the column + * @throws IOException if an IO error occurs */ void preDeleteColumn(final ObserverContext ctx, final TableName tableName, final byte[] c) throws IOException; @@ -330,6 +351,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param c the column + * @throws IOException if an IO error occurs */ void postDeleteColumn(final ObserverContext ctx, final TableName tableName, final byte[] c) throws IOException; @@ -340,6 +362,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param c the column + * @throws IOException if an IO error occurs */ void preDeleteColumnHandler( final ObserverContext ctx, @@ -351,6 +374,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param c the column + * @throws IOException if an IO error occurs */ void postDeleteColumnHandler( final ObserverContext ctx, @@ -361,6 +385,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void preEnableTable(final ObserverContext ctx, final TableName tableName) throws IOException; @@ -370,6 +395,7 @@ public interface MasterObserver extends Coprocessor { * of enable table RPC call. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void postEnableTable(final ObserverContext ctx, final TableName tableName) throws IOException; @@ -380,6 +406,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void preEnableTableHandler( final ObserverContext ctx, @@ -390,6 +417,7 @@ public interface MasterObserver extends Coprocessor { * of enable table handler and it is async to the enable table RPC call. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void postEnableTableHandler( final ObserverContext ctx, @@ -401,6 +429,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void preDisableTable(final ObserverContext ctx, final TableName tableName) throws IOException; @@ -410,6 +439,7 @@ public interface MasterObserver extends Coprocessor { * of disable table RPC call. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void postDisableTable(final ObserverContext ctx, final TableName tableName) throws IOException; @@ -420,6 +450,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void preDisableTableHandler( final ObserverContext ctx, @@ -430,6 +461,7 @@ public interface MasterObserver extends Coprocessor { * of disable table handler and it is asyn to the disable table RPC call. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table + * @throws IOException if an IO error occurs */ void postDisableTableHandler( final ObserverContext ctx, @@ -441,6 +473,7 @@ public interface MasterObserver extends Coprocessor { * @param region the HRegionInfo * @param srcServer the source ServerName * @param destServer the destination ServerName + * @throws IOException if an IO error occurs */ void preMove(final ObserverContext ctx, final HRegionInfo region, final ServerName srcServer, @@ -453,6 +486,7 @@ public interface MasterObserver extends Coprocessor { * @param region the HRegionInfo * @param srcServer the source ServerName * @param destServer the destination ServerName + * @throws IOException if an IO error occurs */ void postMove(final ObserverContext ctx, final HRegionInfo region, final ServerName srcServer, @@ -462,7 +496,7 @@ public interface MasterObserver extends Coprocessor { /** * Called before a abortProcedure request has been processed. * @param ctx the environment to interact with the framework and master - * @throws IOException + * @throws IOException if an IO error occurs */ public void preAbortProcedure( ObserverContext ctx, @@ -472,6 +506,7 @@ public interface MasterObserver extends Coprocessor { /** * Called after a abortProcedure request has been processed. * @param ctx the environment to interact with the framework and master + * @throws IOException if an IO error occurs */ public void postAbortProcedure(ObserverContext ctx) throws IOException; @@ -479,7 +514,7 @@ public interface MasterObserver extends Coprocessor { /** * Called before a listProcedures request has been processed. * @param ctx the environment to interact with the framework and master - * @throws IOException + * @throws IOException if an IO error occurs */ void preListProcedures(ObserverContext ctx) throws IOException; @@ -488,6 +523,7 @@ public interface MasterObserver extends Coprocessor { * Called after a listProcedures request has been processed. * @param ctx the environment to interact with the framework and master * @param procInfoList the list of procedures about to be returned + * @throws IOException if an IO error occurs */ void postListProcedures( ObserverContext ctx, @@ -497,6 +533,7 @@ public interface MasterObserver extends Coprocessor { * Called prior to assigning a specific region. * @param ctx the environment to interact with the framework and master * @param regionInfo the regionInfo of the region + * @throws IOException if an IO error occurs */ void preAssign(final ObserverContext ctx, final HRegionInfo regionInfo) throws IOException; @@ -505,6 +542,7 @@ public interface MasterObserver extends Coprocessor { * Called after the region assignment has been requested. * @param ctx the environment to interact with the framework and master * @param regionInfo the regionInfo of the region + * @throws IOException if an IO error occurs */ void postAssign(final ObserverContext ctx, final HRegionInfo regionInfo) throws IOException; @@ -514,6 +552,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param regionInfo * @param force whether to force unassignment or not + * @throws IOException if an IO error occurs */ void preUnassign(final ObserverContext ctx, final HRegionInfo regionInfo, final boolean force) throws IOException; @@ -523,6 +562,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param regionInfo * @param force whether to force unassignment or not + * @throws IOException if an IO error occurs */ void postUnassign(final ObserverContext ctx, final HRegionInfo regionInfo, final boolean force) throws IOException; @@ -532,6 +572,7 @@ public interface MasterObserver extends Coprocessor { * impact on this hook. * @param ctx the environment to interact with the framework and master * @param regionInfo + * @throws IOException if an IO error occurs */ void preRegionOffline(final ObserverContext ctx, final HRegionInfo regionInfo) throws IOException; @@ -540,6 +581,7 @@ public interface MasterObserver extends Coprocessor { * Called after the region has been marked offline. * @param ctx the environment to interact with the framework and master * @param regionInfo + * @throws IOException if an IO error occurs */ void postRegionOffline(final ObserverContext ctx, final HRegionInfo regionInfo) throws IOException; @@ -548,6 +590,7 @@ public interface MasterObserver extends Coprocessor { * Called prior to requesting rebalancing of the cluster regions, though after * the initial checks for regions in transition and the balance switch flag. * @param ctx the environment to interact with the framework and master + * @throws IOException if an IO error occurs */ void preBalance(final ObserverContext ctx) throws IOException; @@ -558,6 +601,7 @@ public interface MasterObserver extends Coprocessor { * @param plans the RegionPlans which master has executed. RegionPlan serves as hint * as for the final destination for the underlying region but may not represent the * final state of assignment + * @throws IOException if an IO error occurs */ void postBalance(final ObserverContext ctx, List plans) throws IOException; @@ -566,6 +610,7 @@ public interface MasterObserver extends Coprocessor { * Called prior to modifying the flag used to enable/disable region balancing. * @param ctx the coprocessor instance's environment * @param newValue the new flag value submitted in the call + * @throws IOException if an IO error occurs */ boolean preBalanceSwitch(final ObserverContext ctx, final boolean newValue) throws IOException; @@ -575,6 +620,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the coprocessor instance's environment * @param oldValue the previously set balanceSwitch value * @param newValue the newly set balanceSwitch value + * @throws IOException if an IO error occurs */ void postBalanceSwitch(final ObserverContext ctx, final boolean oldValue, final boolean newValue) throws IOException; @@ -582,6 +628,8 @@ public interface MasterObserver extends Coprocessor { /** * Called prior to shutting down the full HBase cluster, including this * {@link org.apache.hadoop.hbase.master.HMaster} process. + * @param ctx the coprocessor instance's environment + * @throws IOException if an IO error occurs */ void preShutdown(final ObserverContext ctx) throws IOException; @@ -590,6 +638,8 @@ public interface MasterObserver extends Coprocessor { /** * Called immediately prior to stopping this * {@link org.apache.hadoop.hbase.master.HMaster} process. + * @param ctx the coprocessor instance's environment + * @throws IOException if an IO error occurs */ void preStopMaster(final ObserverContext ctx) throws IOException; @@ -598,6 +648,8 @@ public interface MasterObserver extends Coprocessor { * Called immediately after an active master instance has completed * initialization. Will not be called on standby master instances unless * they take over the active role. + * @param ctx the coprocessor instance's environment + * @throws IOException if an IO error occurs */ void postStartMaster(final ObserverContext ctx) throws IOException; @@ -605,6 +657,8 @@ public interface MasterObserver extends Coprocessor { /** * Call before the master initialization is set to true. * {@link org.apache.hadoop.hbase.master.HMaster} process. + * @param ctx the coprocessor instance's environment + * @throws IOException if an IO error occurs */ void preMasterInitialization(final ObserverContext ctx) throws IOException; @@ -616,7 +670,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot * @param hTableDescriptor the hTableDescriptor of the table to snapshot - * @throws IOException + * @throws IOException if an IO error occurs */ void preSnapshot(final ObserverContext ctx, final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) @@ -628,7 +682,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot * @param hTableDescriptor the hTableDescriptor of the table to snapshot - * @throws IOException + * @throws IOException if an IO error occurs */ void postSnapshot(final ObserverContext ctx, final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) @@ -639,7 +693,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor of the snapshot to list - * @throws IOException + * @throws IOException if an IO error occurs */ void preListSnapshot(final ObserverContext ctx, final SnapshotDescription snapshot) throws IOException; @@ -649,7 +703,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor of the snapshot to list - * @throws IOException + * @throws IOException if an IO error occurs */ void postListSnapshot(final ObserverContext ctx, final SnapshotDescription snapshot) throws IOException; @@ -661,7 +715,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot * @param hTableDescriptor the hTableDescriptor of the table to create - * @throws IOException + * @throws IOException if an IO error occurs */ void preCloneSnapshot(final ObserverContext ctx, final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) @@ -673,7 +727,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot * @param hTableDescriptor the hTableDescriptor of the table to create - * @throws IOException + * @throws IOException if an IO error occurs */ void postCloneSnapshot(final ObserverContext ctx, final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) @@ -686,7 +740,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot * @param hTableDescriptor the hTableDescriptor of the table to restore - * @throws IOException + * @throws IOException if an IO error occurs */ void preRestoreSnapshot(final ObserverContext ctx, final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) @@ -698,7 +752,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot * @param hTableDescriptor the hTableDescriptor of the table to restore - * @throws IOException + * @throws IOException if an IO error occurs */ void postRestoreSnapshot(final ObserverContext ctx, final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) @@ -710,7 +764,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor of the snapshot to delete - * @throws IOException + * @throws IOException if an IO error occurs */ void preDeleteSnapshot(final ObserverContext ctx, final SnapshotDescription snapshot) throws IOException; @@ -720,7 +774,7 @@ public interface MasterObserver extends Coprocessor { * Called as part of deleteSnapshot RPC call. * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor of the snapshot to delete - * @throws IOException + * @throws IOException if an IO error occurs */ void postDeleteSnapshot(final ObserverContext ctx, final SnapshotDescription snapshot) throws IOException; @@ -730,7 +784,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableNamesList the list of table names, or null if querying for all * @param descriptors an empty list, can be filled with what to return if bypassing - * @throws IOException + * @throws IOException if an IO error occurs * @deprecated Use preGetTableDescriptors with regex instead. */ @Deprecated @@ -741,7 +795,7 @@ public interface MasterObserver extends Coprocessor { * Called after a getTableDescriptors request has been processed. * @param ctx the environment to interact with the framework and master * @param descriptors the list of descriptors about to be returned - * @throws IOException + * @throws IOException if an IO error occurs * @deprecated Use postGetTableDescriptors with regex instead. */ @Deprecated @@ -754,7 +808,7 @@ public interface MasterObserver extends Coprocessor { * @param tableNamesList the list of table names, or null if querying for all * @param descriptors an empty list, can be filled with what to return if bypassing * @param regex regular expression used for filtering the table names - * @throws IOException + * @throws IOException if an IO error occurs */ void preGetTableDescriptors(ObserverContext ctx, List tableNamesList, List descriptors, @@ -766,7 +820,7 @@ public interface MasterObserver extends Coprocessor { * @param tableNamesList the list of table names, or null if querying for all * @param descriptors the list of descriptors about to be returned * @param regex regular expression used for filtering the table names - * @throws IOException + * @throws IOException if an IO error occurs */ void postGetTableDescriptors(ObserverContext ctx, List tableNamesList, List descriptors, @@ -777,7 +831,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param descriptors an empty list, can be filled with what to return if bypassing * @param regex regular expression used for filtering the table names - * @throws IOException + * @throws IOException if an IO error occurs */ void preGetTableNames(ObserverContext ctx, List descriptors, String regex) throws IOException; @@ -787,7 +841,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param descriptors the list of descriptors about to be returned * @param regex regular expression used for filtering the table names - * @throws IOException + * @throws IOException if an IO error occurs */ void postGetTableNames(ObserverContext ctx, List descriptors, String regex) throws IOException; @@ -798,7 +852,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param ns the NamespaceDescriptor for the table - * @throws IOException + * @throws IOException if an IO error occurs */ void preCreateNamespace(final ObserverContext ctx, NamespaceDescriptor ns) throws IOException; @@ -806,7 +860,7 @@ public interface MasterObserver extends Coprocessor { * Called after the createNamespace operation has been requested. * @param ctx the environment to interact with the framework and master * @param ns the NamespaceDescriptor for the table - * @throws IOException + * @throws IOException if an IO error occurs */ void postCreateNamespace(final ObserverContext ctx, NamespaceDescriptor ns) throws IOException; @@ -817,6 +871,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param namespace the name of the namespace + * @throws IOException if an IO error occurs */ void preDeleteNamespace(final ObserverContext ctx, String namespace) throws IOException; @@ -825,6 +880,7 @@ public interface MasterObserver extends Coprocessor { * Called after the deleteNamespace operation has been requested. * @param ctx the environment to interact with the framework and master * @param namespace the name of the namespace + * @throws IOException if an IO error occurs */ void postDeleteNamespace(final ObserverContext ctx, String namespace) throws IOException; @@ -834,6 +890,7 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param ns the NamespaceDescriptor + * @throws IOException if an IO error occurs */ void preModifyNamespace(final ObserverContext ctx, NamespaceDescriptor ns) throws IOException; @@ -842,6 +899,7 @@ public interface MasterObserver extends Coprocessor { * Called after the modifyNamespace operation has been requested. * @param ctx the environment to interact with the framework and master * @param ns the NamespaceDescriptor + * @throws IOException if an IO error occurs */ void postModifyNamespace(final ObserverContext ctx, NamespaceDescriptor ns) throws IOException; @@ -850,7 +908,7 @@ public interface MasterObserver extends Coprocessor { * Called before a getNamespaceDescriptor request has been processed. * @param ctx the environment to interact with the framework and master * @param namespace the name of the namespace - * @throws IOException + * @throws IOException if an IO error occurs */ void preGetNamespaceDescriptor(ObserverContext ctx, String namespace) throws IOException; @@ -859,7 +917,7 @@ public interface MasterObserver extends Coprocessor { * Called after a getNamespaceDescriptor request has been processed. * @param ctx the environment to interact with the framework and master * @param ns the NamespaceDescriptor - * @throws IOException + * @throws IOException if an IO error occurs */ void postGetNamespaceDescriptor(ObserverContext ctx, NamespaceDescriptor ns) throws IOException; @@ -868,7 +926,7 @@ public interface MasterObserver extends Coprocessor { * Called before a listNamespaceDescriptors request has been processed. * @param ctx the environment to interact with the framework and master * @param descriptors an empty list, can be filled with what to return if bypassing - * @throws IOException + * @throws IOException if an IO error occurs */ void preListNamespaceDescriptors(ObserverContext ctx, List descriptors) throws IOException; @@ -877,7 +935,7 @@ public interface MasterObserver extends Coprocessor { * Called after a listNamespaceDescriptors request has been processed. * @param ctx the environment to interact with the framework and master * @param descriptors the list of descriptors about to be returned - * @throws IOException + * @throws IOException if an IO error occurs */ void postListNamespaceDescriptors(ObserverContext ctx, List descriptors) throws IOException; @@ -887,7 +945,7 @@ public interface MasterObserver extends Coprocessor { * Called before the table memstore is flushed to disk. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @throws IOException + * @throws IOException if an IO error occurs */ void preTableFlush(final ObserverContext ctx, final TableName tableName) throws IOException; @@ -896,7 +954,7 @@ public interface MasterObserver extends Coprocessor { * Called after the table memstore is flushed to disk. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @throws IOException + * @throws IOException if an IO error occurs */ void postTableFlush(final ObserverContext ctx, final TableName tableName) throws IOException; @@ -906,7 +964,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param userName the name of user * @param quotas the quota settings - * @throws IOException + * @throws IOException if an IO error occurs */ void preSetUserQuota(final ObserverContext ctx, final String userName, final Quotas quotas) throws IOException; @@ -916,7 +974,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param userName the name of user * @param quotas the quota settings - * @throws IOException + * @throws IOException if an IO error occurs */ void postSetUserQuota(final ObserverContext ctx, final String userName, final Quotas quotas) throws IOException; @@ -927,7 +985,7 @@ public interface MasterObserver extends Coprocessor { * @param userName the name of user * @param tableName the name of the table * @param quotas the quota settings - * @throws IOException + * @throws IOException if an IO error occurs */ void preSetUserQuota(final ObserverContext ctx, final String userName, final TableName tableName, final Quotas quotas) throws IOException; @@ -938,7 +996,7 @@ public interface MasterObserver extends Coprocessor { * @param userName the name of user * @param tableName the name of the table * @param quotas the quota settings - * @throws IOException + * @throws IOException if an IO error occurs */ void postSetUserQuota(final ObserverContext ctx, final String userName, final TableName tableName, final Quotas quotas) throws IOException; @@ -949,7 +1007,7 @@ public interface MasterObserver extends Coprocessor { * @param userName the name of user * @param namespace the name of the namespace * @param quotas the quota settings - * @throws IOException + * @throws IOException if an IO error occurs */ void preSetUserQuota(final ObserverContext ctx, final String userName, final String namespace, final Quotas quotas) throws IOException; @@ -960,7 +1018,7 @@ public interface MasterObserver extends Coprocessor { * @param userName the name of user * @param namespace the name of the namespace * @param quotas the quota settings - * @throws IOException + * @throws IOException if an IO error occurs */ void postSetUserQuota(final ObserverContext ctx, final String userName, final String namespace, final Quotas quotas) throws IOException; @@ -970,7 +1028,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param quotas the quota settings - * @throws IOException + * @throws IOException if an IO error occurs */ void preSetTableQuota(final ObserverContext ctx, final TableName tableName, final Quotas quotas) throws IOException; @@ -980,7 +1038,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param tableName the name of the table * @param quotas the quota settings - * @throws IOException + * @throws IOException if an IO error occurs */ void postSetTableQuota(final ObserverContext ctx, final TableName tableName, final Quotas quotas) throws IOException; @@ -990,7 +1048,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param namespace the name of the namespace * @param quotas the quota settings - * @throws IOException + * @throws IOException if an IO error occurs */ void preSetNamespaceQuota(final ObserverContext ctx, final String namespace, final Quotas quotas) throws IOException; @@ -1000,7 +1058,7 @@ public interface MasterObserver extends Coprocessor { * @param ctx the environment to interact with the framework and master * @param namespace the name of the namespace * @param quotas the quota settings - * @throws IOException + * @throws IOException if an IO error occurs */ void postSetNamespaceQuota(final ObserverContext ctx, final String namespace, final Quotas quotas) throws IOException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java index 2bdaa16..78e97df 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java @@ -354,6 +354,7 @@ public interface RegionObserver extends Coprocessor { * Called before the region is split. * @param c the environment provided by the region server * (e.getRegion() returns the parent region) + * @param splitRow the row as split point * @throws IOException if an error occurred on the coprocessor */ void preSplit(final ObserverContext c, byte[] splitRow) @@ -374,10 +375,10 @@ public interface RegionObserver extends Coprocessor { /** * This will be called before PONR step as part of split transaction. Calling * {@link org.apache.hadoop.hbase.coprocessor.ObserverContext#bypass()} rollback the split - * @param ctx - * @param splitKey - * @param metaEntries - * @throws IOException + * @param ctx the environment provided by the region server + * @param splitKey the row as split point + * @param metaEntries actions to operate on meta during split + * @throws IOException if an error occurred on the coprocessor */ void preSplitBeforePONR(final ObserverContext ctx, byte[] splitKey, List metaEntries) throws IOException; @@ -387,22 +388,22 @@ public interface RegionObserver extends Coprocessor { * This will be called after PONR step as part of split transaction * Calling {@link org.apache.hadoop.hbase.coprocessor.ObserverContext#bypass()} has no * effect in this hook. - * @param ctx - * @throws IOException + * @param ctx the environment provided by the region server + * @throws IOException if an error occurred on the coprocessor */ void preSplitAfterPONR(final ObserverContext ctx) throws IOException; /** * This will be called before the roll back of the split region is completed - * @param ctx - * @throws IOException + * @param ctx the environment provided by the region server + * @throws IOException if an error occurred on the coprocessor */ void preRollBackSplit(final ObserverContext ctx) throws IOException; /** * This will be called after the roll back of the split region is completed - * @param ctx - * @throws IOException + * @param ctx the environment provided by the region server + * @throws IOException if an error occurred on the coprocessor */ void postRollBackSplit(final ObserverContext ctx) throws IOException; @@ -410,8 +411,8 @@ public interface RegionObserver extends Coprocessor { /** * Called after any split request is processed. This will be called irrespective of success or * failure of the split. - * @param ctx - * @throws IOException + * @param ctx the environment provided by the region server + * @throws IOException if an error occurred on the coprocessor */ void postCompleteSplit(final ObserverContext ctx) throws IOException; @@ -419,7 +420,7 @@ public interface RegionObserver extends Coprocessor { * Called before the region is reported as closed to the master. * @param c the environment provided by the region server * @param abortRequested true if the region server is aborting - * @throws IOException + * @throws IOException if an error occurred on the coprocessor */ void preClose(final ObserverContext c, boolean abortRequested) throws IOException; @@ -507,7 +508,7 @@ public interface RegionObserver extends Coprocessor { * coprocessors * @param c the environment provided by the region server * @param get the Get request - * @param exists + * @param exists the default result * @return the value to return to the client if bypassing default processing * @throws IOException if an error occurred on the coprocessor */ @@ -591,7 +592,7 @@ public interface RegionObserver extends Coprocessor { * @param byteNow - timestamp bytes * @param get - the get formed using the current cell's row. * Note that the get does not specify the family and qualifier - * @throws IOException + * @throws IOException if an error occurred on the coprocessor */ void prePrepareTimeStampForDeleteVersion(final ObserverContext c, final Mutation mutation, final Cell cell, final byte[] byteNow, @@ -638,18 +639,18 @@ public interface RegionObserver extends Coprocessor { /** * This will be called for region operations where read lock is acquired in * {@link Region#startRegionOperation()}. - * @param ctx + * @param ctx the environment provided by the region server * @param operation The operation is about to be taken on the region - * @throws IOException + * @throws IOException if an error occurred on the coprocessor */ void postStartRegionOperation(final ObserverContext ctx, Operation operation) throws IOException; /** * Called after releasing read lock in {@link Region#closeRegionOperation()}. - * @param ctx - * @param operation - * @throws IOException + * @param ctx the environment provided by the region server + * @param operation The operation is about to be taken on the region + * @throws IOException if an error occurred on the coprocessor */ void postCloseRegionOperation(final ObserverContext ctx, Operation operation) throws IOException; @@ -657,10 +658,10 @@ public interface RegionObserver extends Coprocessor { /** * Called after the completion of batch put/delete and will be called even if the batch operation * fails - * @param ctx - * @param miniBatchOp + * @param ctx the environment provided by the region server + * @param miniBatchOp batch of Mutations applied to region * @param success true if batch operation is successful otherwise false. - * @throws IOException + * @throws IOException if an error occurred on the coprocessor */ void postBatchMutateIndispensably(final ObserverContext ctx, MiniBatchOperationInProgress miniBatchOp, final boolean success) throws IOException; @@ -679,7 +680,7 @@ public interface RegionObserver extends Coprocessor { * @param compareOp the comparison operation * @param comparator the comparator * @param put data to put if check succeeds - * @param result + * @param result the default result to return * @return the return value to return to client if bypassing default * processing * @throws IOException if an error occurred on the coprocessor @@ -708,7 +709,7 @@ public interface RegionObserver extends Coprocessor { * @param compareOp the comparison operation * @param comparator the comparator * @param put data to put if check succeeds - * @param result + * @param result the default result to return * @return the return value to return to client if bypassing default * processing * @throws IOException if an error occurred on the coprocessor @@ -754,7 +755,7 @@ public interface RegionObserver extends Coprocessor { * @param compareOp the comparison operation * @param comparator the comparator * @param delete delete to commit if check succeeds - * @param result + * @param result the default result to return * @return the value to return to client if bypassing default processing * @throws IOException if an error occurred on the coprocessor */ @@ -782,7 +783,7 @@ public interface RegionObserver extends Coprocessor { * @param compareOp the comparison operation * @param comparator the comparator * @param delete delete to commit if check succeeds - * @param result + * @param result the default result to return * @return the value to return to client if bypassing default processing * @throws IOException if an error occurred on the coprocessor */ @@ -1077,7 +1078,7 @@ public interface RegionObserver extends Coprocessor { * @param length length of rowkey * @param hasMore the 'has more' indication * @return whether more rows are available for the scanner or not - * @throws IOException + * @throws IOException if an error occurred on the coprocessor */ boolean postScannerFilterRow(final ObserverContext c, final InternalScanner s, final byte[] currentRow, final int offset, final short length, @@ -1114,6 +1115,11 @@ public interface RegionObserver extends Coprocessor { /** * Called before a {@link org.apache.hadoop.hbase.regionserver.wal.WALEdit} * replayed for this region. + * @param ctx the environment provided by the region server + * @param info which region the coprocessor is operating on + * @param logKey key of the wal entry + * @param logEdit content of the wal entry + * @throws IOException if an error occurred on the coprocessor */ void preWALRestore(final ObserverContext ctx, HRegionInfo info, WALKey logKey, WALEdit logEdit) throws IOException; @@ -1136,6 +1142,11 @@ public interface RegionObserver extends Coprocessor { * at ERROR will be generated per coprocessor on the logger for {@link CoprocessorHost} once per * classloader. * + * @param ctx the environment provided by the region server + * @param info which region the coprocessor is operating on + * @param logKey key of the wal entry + * @param logEdit content of the wal entry + * @throws IOException if an error occurred on the coprocessor * @deprecated use {@link #preWALRestore(ObserverContext, HRegionInfo, WALKey, WALEdit)} */ @Deprecated @@ -1167,6 +1178,11 @@ public interface RegionObserver extends Coprocessor { * at ERROR will be generated per coprocessor on the logger for {@link CoprocessorHost} once per * classloader. * + * @param ctx the environment provided by the region server + * @param info which region the coprocessor is operating on + * @param logKey key of the wal entry + * @param logEdit content of the wal entry + * @throws IOException if an error occurred on the coprocessor * @deprecated use {@link #postWALRestore(ObserverContext, HRegionInfo, WALKey, WALEdit)} */ @Deprecated @@ -1177,10 +1193,10 @@ public interface RegionObserver extends Coprocessor { * Called before bulkLoadHFile. Users can create a StoreFile instance to * access the contents of a HFile. * - * @param ctx + * @param ctx the environment provided by the region server * @param familyPaths pairs of { CF, HFile path } submitted for bulk load. Adding * or removing from this list will add or remove HFiles to be bulk loaded. - * @throws IOException + * @throws IOException if an error occurred on the coprocessor */ void preBulkLoadHFile(final ObserverContext ctx, List> familyPaths) throws IOException; @@ -1188,11 +1204,11 @@ public interface RegionObserver extends Coprocessor { /** * Called after bulkLoadHFile. * - * @param ctx + * @param ctx the environment provided by the region server * @param familyPaths pairs of { CF, HFile path } submitted for bulk load * @param hasLoaded whether the bulkLoad was successful * @return the new value of hasLoaded - * @throws IOException + * @throws IOException if an error occurred on the coprocessor */ boolean postBulkLoadHFile(final ObserverContext ctx, List> familyPaths, boolean hasLoaded) throws IOException; @@ -1207,12 +1223,12 @@ public interface RegionObserver extends Coprocessor { * @param p path to the file * @param in {@link FSDataInputStreamWrapper} * @param size Full size of the file - * @param cacheConf + * @param cacheConf The cache configuration and block cache reference. * @param r original reference file. This will be not null only when reading a split file. * @param reader the base reader, if not {@code null}, from previous RegionObserver in the chain * @return a Reader instance to use instead of the base reader if overriding * default behavior, null otherwise - * @throws IOException + * @throws IOException if an error occurred on the coprocessor */ StoreFile.Reader preStoreFileReaderOpen(final ObserverContext ctx, final FileSystem fs, final Path p, final FSDataInputStreamWrapper in, long size, @@ -1226,11 +1242,11 @@ public interface RegionObserver extends Coprocessor { * @param p path to the file * @param in {@link FSDataInputStreamWrapper} * @param size Full size of the file - * @param cacheConf + * @param cacheConf The cache configuration and block cache reference. * @param r original reference file. This will be not null only when reading a split file. * @param reader the base reader instance * @return The reader to use - * @throws IOException + * @throws IOException if an error occurred on the coprocessor */ StoreFile.Reader postStoreFileReaderOpen(final ObserverContext ctx, final FileSystem fs, final Path p, final FSDataInputStreamWrapper in, long size, @@ -1247,7 +1263,7 @@ public interface RegionObserver extends Coprocessor { * @param oldCell old cell containing previous value * @param newCell the new cell containing the computed value * @return the new cell, possibly changed - * @throws IOException + * @throws IOException if an error occurred on the coprocessor */ Cell postMutationBeforeWAL(ObserverContext ctx, MutationType opType, Mutation mutation, Cell oldCell, Cell newCell) throws IOException; @@ -1260,7 +1276,7 @@ public interface RegionObserver extends Coprocessor { * @param ctx the environment provided by the region server * @param delTracker the deleteTracker that is created by the QueryMatcher * @return the Delete Tracker - * @throws IOException + * @throws IOException if an error occurred on the coprocessor */ DeleteTracker postInstantiateDeleteTracker( final ObserverContext ctx, DeleteTracker delTracker) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/MasterProcedureManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/MasterProcedureManager.java index e5257e5..2728e7b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/MasterProcedureManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/MasterProcedureManager.java @@ -60,9 +60,10 @@ public abstract class MasterProcedureManager extends ProcedureManager implements * Initialize a globally barriered procedure for master. * * @param master Master service interface - * @throws KeeperException - * @throws IOException - * @throws UnsupportedOperationException + * @param metricsMaster Master metrics + * @throws KeeperException if an unexpected zk error occurs + * @throws IOException if an unexpected IO error occurs + * @throws UnsupportedOperationException if the operation is not supported */ public abstract void initialize(MasterServices master, MetricsMaster metricsMaster) throws KeeperException, IOException, UnsupportedOperationException; @@ -71,7 +72,7 @@ public abstract class MasterProcedureManager extends ProcedureManager implements * Execute a distributed procedure on cluster * * @param desc Procedure description - * @throws IOException + * @throws IOException if an unexpected IO error occurs */ public void execProcedure(ProcedureDescription desc) throws IOException { @@ -82,7 +83,7 @@ public abstract class MasterProcedureManager extends ProcedureManager implements * * @param desc Procedure description * @return data returned from the procedure execution, null if no data - * @throws IOException + * @throws IOException if an unexpected IO error occurs */ public byte[] execProcedureWithRet(ProcedureDescription desc) throws IOException { @@ -94,7 +95,7 @@ public abstract class MasterProcedureManager extends ProcedureManager implements * * @param desc Procedure description * @return true if the specified procedure is finished successfully - * @throws IOException + * @throws IOException if an unexpected IO error occurs */ public abstract boolean isProcedureDone(ProcedureDescription desc) throws IOException; } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Procedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Procedure.java index 198bcdd..6ee8a16 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Procedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Procedure.java @@ -239,7 +239,7 @@ public class Procedure implements Callable, ForeignExceptionListener { /** * Sends a message to Members to create a new {@link Subprocedure} for this Procedure and execute * the {@link Subprocedure#acquireBarrier} step. - * @throws ForeignException + * @throws ForeignException if the procedure was already marked as failed */ public void sendGlobalBarrierStart() throws ForeignException { // start the procedure @@ -260,7 +260,7 @@ public class Procedure implements Callable, ForeignExceptionListener { * should only be executed after all members have completed its * {@link Subprocedure#acquireBarrier()} call successfully. This triggers the member * {@link Subprocedure#insideBarrier} method. - * @throws ForeignException + * @throws ForeignException if we can't reach the remote notification mechanism */ public void sendGlobalBarrierReached() throws ForeignException { try { @@ -291,7 +291,7 @@ public class Procedure implements Callable, ForeignExceptionListener { /** * Call back triggered by an individual member upon successful local barrier acquisition - * @param member + * @param member name of the member that acquired */ public void barrierAcquiredByMember(String member) { LOG.debug("member: '" + member + "' joining acquired barrier for procedure '" + procName @@ -313,8 +313,8 @@ public class Procedure implements Callable, ForeignExceptionListener { /** * Call back triggered by a individual member upon successful local in-barrier execution and * release - * @param member - * @param dataFromMember + * @param member name of the member that executed and released its barrier + * @param dataFromMember the data that the member returned along with the notification */ public void barrierReleasedByMember(String member, byte[] dataFromMember) { boolean removed = false; @@ -339,8 +339,8 @@ public class Procedure implements Callable, ForeignExceptionListener { * Waits until the entire procedure has globally completed, or has been aborted. If an * exception is thrown the procedure may or not have run cleanup to trigger the completion latch * yet. - * @throws ForeignException - * @throws InterruptedException + * @throws ForeignException type of error the monitor can throw, if the task fails + * @throws InterruptedException if we are interrupted while waiting on latch */ public void waitForCompleted() throws ForeignException, InterruptedException { waitForLatch(completedLatch, monitor, wakeFrequency, procName + " completed"); @@ -351,8 +351,8 @@ public class Procedure implements Callable, ForeignExceptionListener { * exception is thrown the procedure may or not have run cleanup to trigger the completion latch * yet. * @return data returned from procedure members upon successfully completing subprocedure. - * @throws ForeignException - * @throws InterruptedException + * @throws ForeignException type of error the monitor can throw, if the task fails + * @throws InterruptedException if we are interrupted while waiting */ public HashMap waitForCompletedWithRet() throws ForeignException, InterruptedException { waitForCompleted(); @@ -361,7 +361,8 @@ public class Procedure implements Callable, ForeignExceptionListener { /** * Check if the entire procedure has globally completed, or has been aborted. - * @throws ForeignException + * @return true if the entire procedure complete + * @throws ForeignException exceptions to re-throw if any */ public boolean isCompleted() throws ForeignException { // Rethrow exception if any diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinator.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinator.java index d55fc85..4066187 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinator.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinator.java @@ -67,7 +67,7 @@ public class ProcedureCoordinator { * The rpc object registers the ProcedureCoordinator and starts any threads in this * constructor. * - * @param rpcs + * @param rpcs RPCs to the coordinate * @param pool Used for executing procedures. */ public ProcedureCoordinator(ProcedureCoordinatorRpcs rpcs, ThreadPoolExecutor pool) { @@ -80,9 +80,10 @@ public class ProcedureCoordinator { * The rpc object registers the ProcedureCoordinator and starts any threads in * this constructor. * - * @param rpcs + * @param rpcs RPCs to the coordinate * @param pool Used for executing procedures. - * @param timeoutMillis + * @param timeoutMillis timeout in milliseconds + * @param wakeTimeMillis wake time in milliseconds */ public ProcedureCoordinator(ProcedureCoordinatorRpcs rpcs, ThreadPoolExecutor pool, long timeoutMillis, long wakeTimeMillis) { @@ -96,8 +97,9 @@ public class ProcedureCoordinator { /** * Default thread pool for the procedure * - * @param coordName + * @param coordName name of the procedure coordinator * @param opThreads the maximum number of threads to allow in the pool + * @return the default thread pool */ public static ThreadPoolExecutor defaultPool(String coordName, int opThreads) { return defaultPool(coordName, opThreads, KEEP_ALIVE_MILLIS_DEFAULT); @@ -106,9 +108,10 @@ public class ProcedureCoordinator { /** * Default thread pool for the procedure * - * @param coordName + * @param coordName name of the procedure coordinator * @param opThreads the maximum number of threads to allow in the pool * @param keepAliveMillis the maximum time (ms) that excess idle threads will wait for new tasks + * @return the default thread pool */ public static ThreadPoolExecutor defaultPool(String coordName, int opThreads, long keepAliveMillis) { @@ -119,7 +122,7 @@ public class ProcedureCoordinator { /** * Shutdown the thread pools and release rpc resources - * @throws IOException + * @throws IOException if an IO error occurs */ public void close() throws IOException { // have to use shutdown now to break any latch waiting @@ -240,6 +243,7 @@ public class ProcedureCoordinator { /** * Kick off the named procedure * Currently only one procedure with the same type and name is allowed to run at a time. + * @param fed state holding entity for foreign error handling * @param procName name of the procedure to start * @param procArgs arguments for the procedure * @param expectedMembers expected members to start diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinatorRpcs.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinatorRpcs.java index 631c270..ffcb76f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinatorRpcs.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinatorRpcs.java @@ -34,7 +34,7 @@ public interface ProcedureCoordinatorRpcs extends Closeable { /** * Initialize and start threads necessary to connect an implementation's rpc mechanisms. - * @param listener + * @param listener the coordinator for procedure * @return true if succeed, false if encountered initialization errors. */ boolean start(final ProcedureCoordinator listener); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManager.java index 128d965..c4aa392 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManager.java @@ -28,6 +28,7 @@ public abstract class ProcedureManager { * Return the unique signature of the procedure. This signature uniquely * identifies the procedure. By default, this signature is the string used in * the procedure controller (i.e., the root ZK node name for the procedure) + * @return unique signature of the procedure */ public abstract String getProcedureSignature(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManagerHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManagerHost.java index e06c9ef..4f390e0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManagerHost.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManagerHost.java @@ -51,6 +51,8 @@ public abstract class ProcedureManagerHost { /** * Load system procedures. Read the class names from configuration. * Called by constructor. + * @param conf the given Configuration instance + * @param confKey configuration key to get class names */ protected void loadUserProcedures(Configuration conf, String confKey) { Class implClass = null; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMember.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMember.java index 1f22022..224fe79 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMember.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMember.java @@ -69,8 +69,9 @@ public class ProcedureMember implements Closeable { /** * Default thread pool for the procedure * - * @param memberName + * @param memberName name of the member * @param procThreads the maximum number of threads to allow in the pool + * @return the thread pool for procedure */ public static ThreadPoolExecutor defaultPool(String memberName, int procThreads) { return defaultPool(memberName, procThreads, KEEP_ALIVE_MILLIS_DEFAULT); @@ -79,9 +80,10 @@ public class ProcedureMember implements Closeable { /** * Default thread pool for the procedure * - * @param memberName + * @param memberName name of the member * @param procThreads the maximum number of threads to allow in the pool * @param keepAliveMillis the maximum time (ms) that excess idle threads will wait for new tasks + * @return the thread pool for procedure */ public static ThreadPoolExecutor defaultPool(String memberName, int procThreads, long keepAliveMillis) { @@ -104,8 +106,8 @@ public class ProcedureMember implements Closeable { * This is separated from execution so that we can detect and handle the case where the * subprocedure is invalid and inactionable due to bad info (like DISABLED snapshot type being * sent here) - * @param opName - * @param data + * @param opName name of the procedure + * @param data arguments about the procedure * @return subprocedure */ public Subprocedure createSubprocedure(String opName, byte[] data) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMemberRpcs.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMemberRpcs.java index 96c22b0..83abd7f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMemberRpcs.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMemberRpcs.java @@ -32,6 +32,8 @@ public interface ProcedureMemberRpcs extends Closeable { /** * Initialize and start any threads or connections the member needs. + * @param memberName name of the member + * @param member the ProcedureMember instance */ void start(final String memberName, final ProcedureMember member); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/RegionServerProcedureManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/RegionServerProcedureManager.java index 95c3ffe..ad110ed 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/RegionServerProcedureManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/RegionServerProcedureManager.java @@ -35,7 +35,7 @@ public abstract class RegionServerProcedureManager extends ProcedureManager { * Initialize a globally barriered procedure for region servers. * * @param rss Region Server service interface - * @throws KeeperException + * @throws KeeperException if an unexpected zk error occurs */ public abstract void initialize(RegionServerServices rss) throws KeeperException; @@ -48,7 +48,7 @@ public abstract class RegionServerProcedureManager extends ProcedureManager { * Close this and all running procedure tasks * * @param force forcefully stop all running tasks - * @throws IOException + * @throws IOException if an unexpected IO error occurs */ public abstract void stop(boolean force) throws IOException; } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Subprocedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Subprocedure.java index 8927338..d28c443 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Subprocedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Subprocedure.java @@ -240,7 +240,7 @@ abstract public class Subprocedure implements Callable { * Users should override this method. If a quiescent is not required, this is overkill but * can still be used to execute a procedure on all members and to propagate any exceptions. * - * @throws ForeignException + * @throws ForeignException if error occurs */ abstract public void acquireBarrier() throws ForeignException; @@ -253,7 +253,7 @@ abstract public class Subprocedure implements Callable { * to the coordinator upon successful completion. * Users should override this method. * @return the data the subprocedure wants to return to coordinator side. - * @throws ForeignException + * @throws ForeignException if error occurs */ abstract public byte[] insideBarrier() throws ForeignException; @@ -261,13 +261,14 @@ abstract public class Subprocedure implements Callable { * Users should override this method. This implementation of this method should rollback and * cleanup any temporary or partially completed state that the {@link #acquireBarrier()} may have * created. - * @param e + * @param e the error occurred during the process */ abstract public void cleanup(Exception e); /** * Method to cancel the Subprocedure by injecting an exception from and external source. - * @param cause + * @param msg error message to log + * @param cause cause of the error */ public void cancel(String msg, Throwable cause) { LOG.error(msg, cause); @@ -307,8 +308,8 @@ abstract public class Subprocedure implements Callable { /** * Waits until the entire procedure has globally completed, or has been aborted. - * @throws ForeignException - * @throws InterruptedException + * @throws ForeignException type of error the monitor can throw, if the task fails + * @throws InterruptedException if we are interrupted while waiting on latch */ public void waitForLocallyCompleted() throws ForeignException, InterruptedException { Procedure.waitForLatch(releasedLocalBarrier, monitor, wakeFrequency, diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureUtil.java index 8171218..485ca4c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureUtil.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureUtil.java @@ -226,6 +226,8 @@ public abstract class ZKProcedureUtil /** * Is this in the procedure barrier abort znode path + * @param path znode path to check + * @return true if the given path is an abort path */ public boolean isAbortPathNode(String path) { return path.startsWith(this.abortZnode) && !path.equals(abortZnode); @@ -253,6 +255,8 @@ public abstract class ZKProcedureUtil /** * Helper method to print the current state of the ZK tree. + * @param root name of the root directory in zk to print + * @param prefix prefix added to the message before log * @see #logZKTree(String) * @throws KeeperException if an unexpected exception occurs */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java index a441a6b..3d34603 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java @@ -107,7 +107,7 @@ public class RegionServerFlushTableProcedureManager extends RegionServerProcedur /** * Close this and all running tasks * @param force forcefully stop all running tasks - * @throws IOException + * @throws IOException if an IO error occurs */ @Override public void stop(boolean force) throws IOException { @@ -127,7 +127,7 @@ public class RegionServerFlushTableProcedureManager extends RegionServerProcedur * Because this gets the local list of regions to flush and not the set the master had, * there is a possibility of a race where regions may be missed. * - * @param table + * @param table name of the table to flush * @return Subprocedure to submit to the ProcedureMemeber. */ public Subprocedure buildSubprocedure(String table) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java index 61d1a9a..ca4f85e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java @@ -52,9 +52,9 @@ public class ReplicationProtbufUtil { /** * A helper to replicate a list of WAL entries using admin protocol. * - * @param admin - * @param entries - * @throws java.io.IOException + * @param admin the Admin instance for cluster administration + * @param entries the WAL entries to be replicated + * @throws java.io.IOException if an IO error occurs */ public static void replicateWALEntry(final AdminService.BlockingInterface admin, final Entry[] entries) throws IOException { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java index 1ba2ebe..530add5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java @@ -1580,7 +1580,7 @@ public class RegionCoprocessorHost * @param p path to the file * @param in {@link FSDataInputStreamWrapper} * @param size Full size of the file - * @param cacheConf + * @param cacheConf The cache configuration and block cache reference. * @param r original reference file. This will be not null only when reading a split file. * @return a Reader instance to use instead of the base reader if overriding * default behavior, null otherwise diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/ScanLabelGenerator.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/ScanLabelGenerator.java index e2425a6..59faf2f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/ScanLabelGenerator.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/ScanLabelGenerator.java @@ -35,8 +35,8 @@ public interface ScanLabelGenerator extends Configurable { /** * Helps to get a list of lables associated with an UGI - * @param user - * @param authorizations + * @param user User who called the RPC method + * @param authorizations Authorizations for the request * @return The labels */ public List getLabels(User user, Authorizations authorizations); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityLabelService.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityLabelService.java index 1ef1253..51d9ad2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityLabelService.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityLabelService.java @@ -42,6 +42,7 @@ public interface VisibilityLabelService extends Configurable { * any initialization logic. * @param e * the region coprocessor env + * @throws IOException if an IO error occurs */ void init(RegionCoprocessorEnvironment e) throws IOException; @@ -50,6 +51,7 @@ public interface VisibilityLabelService extends Configurable { * @param labels * Labels to add to the system. * @return OperationStatus for each of the label addition + * @throws IOException if an IO error occurs */ OperationStatus[] addLabels(List labels) throws IOException; @@ -60,6 +62,7 @@ public interface VisibilityLabelService extends Configurable { * @param authLabels * Labels which are getting authorized for the user * @return OperationStatus for each of the label auth addition + * @throws IOException if an IO error occurs */ OperationStatus[] setAuths(byte[] user, List authLabels) throws IOException; @@ -70,6 +73,7 @@ public interface VisibilityLabelService extends Configurable { * @param authLabels * Labels which are getting removed from authorization set * @return OperationStatus for each of the label auth removal + * @throws IOException if an IO error occurs */ OperationStatus[] clearAuths(byte[] user, List authLabels) throws IOException; @@ -80,6 +84,7 @@ public interface VisibilityLabelService extends Configurable { * @param systemCall * Whether a system or user originated call. * @return Visibility labels authorized for the given user. + * @throws IOException if an IO error occurs * @deprecated Use {@link #getUserAuths(byte[], boolean)} */ @Deprecated @@ -92,6 +97,7 @@ public interface VisibilityLabelService extends Configurable { * @param systemCall * Whether a system or user originated call. * @return Visibility labels authorized for the given user. + * @throws IOException if an IO error occurs */ List getUserAuths(byte[] user, boolean systemCall) throws IOException; @@ -102,6 +108,7 @@ public interface VisibilityLabelService extends Configurable { * @param systemCall * Whether a system or user originated call. * @return Visibility labels authorized for the given group. + * @throws IOException if an IO error occurs */ List getGroupAuths(String[] groups, boolean systemCall) throws IOException; @@ -109,6 +116,7 @@ public interface VisibilityLabelService extends Configurable { * Retrieve the list of visibility labels defined in the system. * @param regex The regular expression to filter which labels are returned. * @return List of visibility labels + * @throws IOException if an IO error occurs */ List listLabels(String regex) throws IOException; @@ -125,6 +133,7 @@ public interface VisibilityLabelService extends Configurable { * global auth label. * @return The list of tags corresponds to the visibility expression. These tags will be stored * along with the Cells. + * @throws IOException if an IO error occurs */ List createVisibilityExpTags(String visExpression, boolean withSerializationFormat, boolean checkAuths) throws IOException; @@ -136,6 +145,7 @@ public interface VisibilityLabelService extends Configurable { * @param authorizations * Authorizations for the read request * @return The VisibilityExpEvaluator corresponding to the given set of authorization labels. + * @throws IOException if an IO error occurs */ VisibilityExpEvaluator getVisibilityExpEvaluator(Authorizations authorizations) throws IOException; @@ -147,6 +157,7 @@ public interface VisibilityLabelService extends Configurable { * @param user * User for whom system auth check to be done. * @return true if the given user is having system/super auth + * @throws IOException if an IO error occurs * @deprecated Use {@link #havingSystemAuth(User)} */ @Deprecated @@ -159,6 +170,7 @@ public interface VisibilityLabelService extends Configurable { * @param user * User for whom system auth check to be done. * @return true if the given user is having system/super auth + * @throws IOException if an IO error occurs */ boolean havingSystemAuth(User user) throws IOException; @@ -180,6 +192,7 @@ public interface VisibilityLabelService extends Configurable { * this format means the tags are written with unsorted label ordinals * @return true if matching tags are found * @see VisibilityConstants#SORTED_ORDINAL_SERIALIZATION_FORMAT + * @throws IOException if an IO error occurs */ boolean matchVisibility(List putVisTags, Byte putVisTagFormat, List deleteVisTags, Byte deleteVisTagFormat) throws IOException; @@ -199,7 +212,7 @@ public interface VisibilityLabelService extends Configurable { * @param serializationFormat * the serialization format associated with the tag * @return the modified visibility expression in the form of byte[] - * @throws IOException + * @throws IOException if an IO error occurs */ byte[] encodeVisibilityForReplication(final List visTags, final Byte serializationFormat) throws IOException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java index 1dfe115..2789e5b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java @@ -485,7 +485,9 @@ public final class Canary implements Tool { /** * Canary entry point for specified table. - * @throws Exception + * @param admin the Admin instance for cluster administration + * @param tableName name of the target table + * @throws Exception if unexpected error occurs */ public static void sniff(final Admin admin, TableName tableName) throws Exception { sniff(admin, new StdOutSink(), tableName.getNameAsString()); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/WriteSinkCoprocessor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/WriteSinkCoprocessor.java index 92ab4d1..7ef7425 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/WriteSinkCoprocessor.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/WriteSinkCoprocessor.java @@ -51,7 +51,6 @@ import java.util.concurrent.atomic.AtomicLong; * scan 'usertable' * Will return: * 0 row(s) in 0.0050 seconds - *

*/ public class WriteSinkCoprocessor extends BaseRegionObserver { private static final Log LOG = LogFactory.getLog(WriteSinkCoprocessor.class); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java index a876aef..1a9335f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java @@ -65,10 +65,14 @@ public abstract class AbstractHBaseTool implements Tool { /** * This method is called to process the options after they have been parsed. + * @param cmd the command to process on */ protected abstract void processOptions(CommandLine cmd); - /** The "main function" of the tool */ + /** + * The "main function" of the tool + * @return exit code indicating success or fail + */ protected abstract int doWork() throws Exception; @Override @@ -174,6 +178,10 @@ public abstract class AbstractHBaseTool implements Tool { /** * Parse a number and enforce a range. + * @param s the String to parse + * @param minValue min value of the range, including + * @param maxValue max value of the range, including + * @return the long value if parse successfully, or throws {@link IllegalArgumentException} if not */ public static long parseLong(String s, long minValue, long maxValue) { long l = Long.parseLong(s); @@ -188,7 +196,10 @@ public abstract class AbstractHBaseTool implements Tool { return (int) parseLong(s, minValue, maxValue); } - /** Call this from the concrete tool class's main function. */ + /** + * Call this from the concrete tool class's main function. + * @param args arguments for the run + */ protected void doStaticMain(String args[]) { int ret; try { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterBase.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterBase.java index 3b9ca9a..bb86a23 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterBase.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterBase.java @@ -45,6 +45,13 @@ public interface BloomFilterBase { /** * Create a key for a row-column Bloom filter. + * @param rowBuf the array containing the row bytes + * @param rowOffset array index of first row byte + * @param rowLen number of row bytes + * @param qualBuf the array containing the qualifier bytes + * @param qualOffset array index of first qualifier byte + * @param qualLen number of qualifier bytes + * @return the key of the Bloom filter */ byte[] createBloomKey(byte[] rowBuf, int rowOffset, int rowLen, byte[] qualBuf, int qualOffset, int qualLen); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterFactory.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterFactory.java index 5ff7207..7a00784 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterFactory.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterFactory.java @@ -92,7 +92,8 @@ public final class BloomFilterFactory { * @param reader the {@link HFile} reader to use to lazily load Bloom filter * blocks * @return an instance of the correct type of Bloom filter - * @throws IllegalArgumentException + * @throws IllegalArgumentException if version of the Bloom filter is not recognized + * @throws IOException if an IO error occurs */ public static BloomFilter createFromMeta(DataInput meta, HFile.Reader reader) @@ -116,6 +117,7 @@ public final class BloomFilterFactory { } /** + * @param conf The Configuration instance to get value from * @return true if general Bloom (Row or RowCol) filters are enabled in the * given configuration */ @@ -124,6 +126,7 @@ public final class BloomFilterFactory { } /** + * @param conf The Configuration instance to get value from * @return true if Delete Family Bloom filters are enabled in the given configuration */ public static boolean isDeleteFamilyBloomEnabled(Configuration conf) { @@ -131,6 +134,7 @@ public final class BloomFilterFactory { } /** + * @param conf The Configuration instance to get value from * @return the Bloom filter error rate in the given configuration */ public static float getErrorRate(Configuration conf) { @@ -138,20 +142,25 @@ public final class BloomFilterFactory { } /** + * @param conf The Configuration instance to get value from * @return the value for Bloom filter max fold in the given configuration */ public static int getMaxFold(Configuration conf) { return conf.getInt(IO_STOREFILE_BLOOM_MAX_FOLD, MAX_ALLOWED_FOLD_FACTOR); } - /** @return the compound Bloom filter block size from the configuration */ + /** + * @param conf The Configuration instance to get value from + * @return the compound Bloom filter block size from the configuration + */ public static int getBloomBlockSize(Configuration conf) { return conf.getInt(IO_STOREFILE_BLOOM_BLOCK_SIZE, 128 * 1024); } /** - * @return max key for the Bloom filter from the configuration - */ + * @param conf The Configuration instance to get value from + * @return max key for the Bloom filter from the configuration + */ public static int getMaxKeys(Configuration conf) { return conf.getInt(IO_STOREFILE_BLOOM_MAX_KEYS, 128 * 1000 * 1000); } @@ -160,9 +169,9 @@ public final class BloomFilterFactory { * Creates a new general (Row or RowCol) Bloom filter at the time of * {@link org.apache.hadoop.hbase.regionserver.StoreFile} writing. * - * @param conf - * @param cacheConf - * @param bloomType + * @param conf The Configuration instance to get value from + * @param cacheConf The cache configuration and block cache reference + * @param bloomType type of the Bloom filter * @param maxKeys an estimate of the number of keys we expect to insert. * Irrelevant if compound Bloom filters are enabled. * @param writer the HFile writer @@ -207,8 +216,8 @@ public final class BloomFilterFactory { /** * Creates a new Delete Family Bloom filter at the time of * {@link org.apache.hadoop.hbase.regionserver.StoreFile} writing. - * @param conf - * @param cacheConf + * @param conf The Configuration instance to get value from + * @param cacheConf The cache configuration and block cache reference * @param maxKeys an estimate of the number of keys we expect to insert. * Irrelevant if compound Bloom filters are enabled. * @param writer the HFile writer diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ByteBloomFilter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ByteBloomFilter.java index 56c3776..49855ad 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ByteBloomFilter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ByteBloomFilter.java @@ -146,8 +146,10 @@ public class ByteBloomFilter implements BloomFilter, BloomFilterWriter { } /** - * @param maxKeys - * @param errorRate + * @param maxKeys Maximum expected number of keys that will be stored in this + * bloom + * @param errorRate Desired false positive error rate. Lower rate = more + * storage required * @return the number of bits for a Bloom filter than can hold the given * number of keys and provide the given error rate, assuming that the * optimal number of hash functions is used and it does not have to @@ -163,8 +165,8 @@ public class ByteBloomFilter implements BloomFilter, BloomFilterWriter { * functions is chosen optimally and does not even have to be an integer * (hence the "ideal" in the function name). * - * @param bitSize - * @param errorRate + * @param bitSize the desired number of bits for the Bloom filter bit array + * @param errorRate target false positive rate of the Bloom filter * @return maximum number of keys that can be inserted into the Bloom filter * @see #computeMaxKeys(long, double, int) for a more precise estimate */ @@ -178,9 +180,9 @@ public class ByteBloomFilter implements BloomFilter, BloomFilterWriter { * The maximum number of keys we can put into a Bloom filter of a certain * size to get the given error rate, with the given number of hash functions. * - * @param bitSize - * @param errorRate - * @param hashCount + * @param bitSize the desired number of bits for the Bloom filter bit array + * @param errorRate target false positive rate of the Bloom filter + * @param hashCount number of hash functions * @return the maximum number of keys that can be inserted in a Bloom filter * to maintain the target error rate, if the number of hash functions * is provided. @@ -211,9 +213,10 @@ public class ByteBloomFilter implements BloomFilter, BloomFilterWriter { * "http://en.wikipedia.org/wiki/Bloom_filter#Probability_of_false_positives" * > Wikipedia Bloom filter article. * - * @param maxKeys - * @param bitSize - * @param functionCount + * @param maxKeys Maximum expected number of keys that will be stored in this + * bloom + * @param bitSize the desired number of bits for the Bloom filter bit array + * @param functionCount number of hash functions * @return the actual error rate */ public static double actualErrorRate(long maxKeys, long bitSize, @@ -226,8 +229,8 @@ public class ByteBloomFilter implements BloomFilter, BloomFilterWriter { * Increases the given byte size of a Bloom filter until it can be folded by * the given factor. * - * @param bitSize - * @param foldFactor + * @param bitSize the desired number of bits for the Bloom filter bit array + * @param foldFactor factor to 'fold' this bloom to save space * @return Foldable byte size */ public static int computeFoldableByteSize(long bitSize, int foldFactor) { @@ -273,7 +276,7 @@ public class ByteBloomFilter implements BloomFilter, BloomFilterWriter { * this bloom to save space. Tradeoff potentially excess bytes in * bloom for ability to fold if keyCount is exponentially greater * than maxKeys. - * @throws IllegalArgumentException + * @throws IllegalArgumentException if settings for this Bloom is not correct */ public ByteBloomFilter(int maxKeys, double errorRate, int hashType, int foldFactor) throws IllegalArgumentException { @@ -296,7 +299,7 @@ public class ByteBloomFilter implements BloomFilter, BloomFilterWriter { * array. Will be increased so that folding is possible. * @param errorRate target false positive rate of the Bloom filter * @param hashType Bloom filter hash function type - * @param foldFactor + * @param foldFactor factor to 'fold' this bloom to save space * @return the new Bloom filter of the desired size */ public static ByteBloomFilter createBySize(int byteSizeHint,