Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 82D00200CCE for ; Sun, 23 Jul 2017 17:08:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 815EC1646F2; Sun, 23 Jul 2017 15:08:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 654AB1642FF for ; Sun, 23 Jul 2017 17:08:43 +0200 (CEST) Received: (qmail 68169 invoked by uid 500); 23 Jul 2017 15:08:39 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 66359 invoked by uid 99); 23 Jul 2017 15:08:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Jul 2017 15:08:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E3206F32BB; Sun, 23 Jul 2017 15:08:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: git-site-role@apache.org To: commits@hbase.apache.org Date: Sun, 23 Jul 2017 15:08:57 -0000 Message-Id: <7ded6a60124149d985c280956b8d538c@git.apache.org> In-Reply-To: <10dce31be4034f58b712555cb49aa90c@git.apache.org> References: <10dce31be4034f58b712555cb49aa90c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [22/51] [partial] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd. archived-at: Sun, 23 Jul 2017 15:08:45 -0000 http://git-wip-us.apache.org/repos/asf/hbase-site/blob/0383a9c2/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterCoprocessorHost.CoprocessorOperationWithResult.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterCoprocessorHost.CoprocessorOperationWithResult.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterCoprocessorHost.CoprocessorOperationWithResult.html index e690c2d..ec75aa9 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterCoprocessorHost.CoprocessorOperationWithResult.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterCoprocessorHost.CoprocessorOperationWithResult.html @@ -818,1092 +818,1070 @@ 810 }); 811 } 812 -813 public void preDispatchMerge(final HRegionInfo regionInfoA, final HRegionInfo regionInfoB) -814 throws IOException { +813 public void preMergeRegions(final HRegionInfo[] regionsToMerge) +814 throws IOException { 815 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { 816 @Override 817 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) 818 throws IOException { -819 oserver.preDispatchMerge(ctx, regionInfoA, regionInfoB); +819 oserver.preMergeRegions(ctx, regionsToMerge); 820 } 821 }); 822 } 823 -824 public void postDispatchMerge(final HRegionInfo regionInfoA, final HRegionInfo regionInfoB) -825 throws IOException { +824 public void postMergeRegions(final HRegionInfo[] regionsToMerge) +825 throws IOException { 826 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { 827 @Override 828 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) 829 throws IOException { -830 oserver.postDispatchMerge(ctx, regionInfoA, regionInfoB); +830 oserver.postMergeRegions(ctx, regionsToMerge); 831 } 832 }); 833 } 834 -835 public void preMergeRegions(final HRegionInfo[] regionsToMerge) -836 throws IOException { -837 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -838 @Override -839 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -840 throws IOException { -841 oserver.preMergeRegions(ctx, regionsToMerge); -842 } -843 }); -844 } -845 -846 public void postMergeRegions(final HRegionInfo[] regionsToMerge) -847 throws IOException { -848 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -849 @Override -850 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -851 throws IOException { -852 oserver.postMergeRegions(ctx, regionsToMerge); -853 } -854 }); -855 } -856 -857 public boolean preBalance() throws IOException { -858 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -859 @Override -860 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -861 throws IOException { -862 oserver.preBalance(ctx); -863 } -864 }); -865 } -866 -867 public void postBalance(final List<RegionPlan> plans) throws IOException { +835 public boolean preBalance() throws IOException { +836 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +837 @Override +838 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +839 throws IOException { +840 oserver.preBalance(ctx); +841 } +842 }); +843 } +844 +845 public void postBalance(final List<RegionPlan> plans) throws IOException { +846 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +847 @Override +848 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +849 throws IOException { +850 oserver.postBalance(ctx, plans); +851 } +852 }); +853 } +854 +855 public boolean preSetSplitOrMergeEnabled(final boolean newValue, +856 final MasterSwitchType switchType) throws IOException { +857 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +858 @Override +859 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +860 throws IOException { +861 oserver.preSetSplitOrMergeEnabled(ctx, newValue, switchType); +862 } +863 }); +864 } +865 +866 public void postSetSplitOrMergeEnabled(final boolean newValue, +867 final MasterSwitchType switchType) throws IOException { 868 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { 869 @Override 870 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) 871 throws IOException { -872 oserver.postBalance(ctx, plans); +872 oserver.postSetSplitOrMergeEnabled(ctx, newValue, switchType); 873 } 874 }); 875 } 876 -877 public boolean preSetSplitOrMergeEnabled(final boolean newValue, -878 final MasterSwitchType switchType) throws IOException { -879 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -880 @Override -881 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -882 throws IOException { -883 oserver.preSetSplitOrMergeEnabled(ctx, newValue, switchType); -884 } -885 }); -886 } -887 -888 public void postSetSplitOrMergeEnabled(final boolean newValue, -889 final MasterSwitchType switchType) throws IOException { -890 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -891 @Override -892 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -893 throws IOException { -894 oserver.postSetSplitOrMergeEnabled(ctx, newValue, switchType); -895 } -896 }); -897 } -898 -899 /** -900 * Invoked just before calling the split region procedure -901 * @param tableName the table where the region belongs to -902 * @param splitRow the split point -903 * @throws IOException -904 */ -905 public void preSplitRegion( -906 final TableName tableName, -907 final byte[] splitRow) throws IOException { -908 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -909 @Override -910 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -911 throws IOException { -912 oserver.preSplitRegion(ctx, tableName, splitRow); -913 } -914 }); -915 } -916 -917 /** -918 * Invoked just before a split -919 * @param tableName the table where the region belongs to -920 * @param splitRow the split point -921 * @param user the user -922 * @throws IOException -923 */ -924 public void preSplitRegionAction( -925 final TableName tableName, -926 final byte[] splitRow, -927 final User user) throws IOException { -928 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { -929 @Override -930 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -931 throws IOException { -932 oserver.preSplitRegionAction(ctx, tableName, splitRow); -933 } -934 }); -935 } -936 -937 /** -938 * Invoked just after a split -939 * @param regionInfoA the new left-hand daughter region -940 * @param regionInfoB the new right-hand daughter region -941 * @param user the user -942 * @throws IOException -943 */ -944 public void postCompletedSplitRegionAction( -945 final HRegionInfo regionInfoA, -946 final HRegionInfo regionInfoB, -947 final User user) throws IOException { -948 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { -949 @Override -950 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -951 throws IOException { -952 oserver.postCompletedSplitRegionAction(ctx, regionInfoA, regionInfoB); -953 } -954 }); -955 } -956 -957 /** -958 * This will be called before PONR step as part of split table region procedure. -959 * @param splitKey -960 * @param metaEntries -961 * @param user the user -962 * @throws IOException -963 */ -964 public boolean preSplitBeforePONRAction( -965 final byte[] splitKey, -966 final List<Mutation> metaEntries, -967 final User user) throws IOException { -968 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { -969 @Override -970 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -971 throws IOException { -972 oserver.preSplitRegionBeforePONRAction(ctx, splitKey, metaEntries); -973 } -974 }); -975 } -976 -977 /** -978 * This will be called after PONR step as part of split table region procedure. -979 * @param user the user -980 * @throws IOException -981 */ -982 public void preSplitAfterPONRAction(final User user) throws IOException { -983 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { -984 @Override -985 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -986 throws IOException { -987 oserver.preSplitRegionAfterPONRAction(ctx); -988 } -989 }); -990 } -991 -992 /** -993 * Invoked just after the rollback of a failed split -994 * @param user the user -995 * @throws IOException -996 */ -997 public void postRollBackSplitRegionAction(final User user) throws IOException { -998 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { -999 @Override -1000 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -1001 throws IOException { -1002 oserver.postRollBackSplitRegionAction(ctx); -1003 } -1004 }); -1005 } -1006 -1007 /** -1008 * Invoked just before a merge -1009 * @param regionsToMerge the regions to merge -1010 * @param user the user -1011 * @throws IOException -1012 */ -1013 public boolean preMergeRegionsAction( -1014 final HRegionInfo[] regionsToMerge, final User user) throws IOException { -1015 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { -1016 @Override -1017 public void call(MasterObserver oserver, -1018 ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { -1019 oserver.preMergeRegionsAction(ctx, regionsToMerge); -1020 } -1021 }); -1022 } -1023 -1024 /** -1025 * Invoked after completing merge regions operation -1026 * @param regionsToMerge the regions to merge -1027 * @param mergedRegion the new merged region -1028 * @param user the user -1029 * @throws IOException -1030 */ -1031 public void postCompletedMergeRegionsAction( -1032 final HRegionInfo[] regionsToMerge, -1033 final HRegionInfo mergedRegion, -1034 final User user) throws IOException { -1035 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { -1036 @Override -1037 public void call(MasterObserver oserver, -1038 ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { -1039 oserver.postCompletedMergeRegionsAction(ctx, regionsToMerge, mergedRegion); -1040 } -1041 }); -1042 } -1043 -1044 /** -1045 * Invoked before merge regions operation writes the new region to hbase:meta -1046 * @param regionsToMerge the regions to merge -1047 * @param metaEntries the meta entry -1048 * @param user the user -1049 * @throws IOException -1050 */ -1051 public boolean preMergeRegionsCommit( -1052 final HRegionInfo[] regionsToMerge, -1053 final @MetaMutationAnnotation List<Mutation> metaEntries, -1054 final User user) throws IOException { -1055 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { -1056 @Override -1057 public void call(MasterObserver oserver, -1058 ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { -1059 oserver.preMergeRegionsCommitAction(ctx, regionsToMerge, metaEntries); -1060 } -1061 }); -1062 } -1063 -1064 /** -1065 * Invoked after merge regions operation writes the new region to hbase:meta -1066 * @param regionsToMerge the regions to merge -1067 * @param mergedRegion the new merged region -1068 * @param user the user -1069 * @throws IOException -1070 */ -1071 public void postMergeRegionsCommit( -1072 final HRegionInfo[] regionsToMerge, -1073 final HRegionInfo mergedRegion, -1074 final User user) throws IOException { -1075 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { -1076 @Override -1077 public void call(MasterObserver oserver, -1078 ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { -1079 oserver.postMergeRegionsCommitAction(ctx, regionsToMerge, mergedRegion); -1080 } -1081 }); -1082 } -1083 -1084 /** -1085 * Invoked after rollback merge regions operation -1086 * @param regionsToMerge the regions to merge -1087 * @param user the user -1088 * @throws IOException -1089 */ -1090 public void postRollBackMergeRegionsAction( -1091 final HRegionInfo[] regionsToMerge, final User user) throws IOException { -1092 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { +877 /** +878 * Invoked just before calling the split region procedure +879 * @param tableName the table where the region belongs to +880 * @param splitRow the split point +881 * @throws IOException +882 */ +883 public void preSplitRegion( +884 final TableName tableName, +885 final byte[] splitRow) throws IOException { +886 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +887 @Override +888 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +889 throws IOException { +890 oserver.preSplitRegion(ctx, tableName, splitRow); +891 } +892 }); +893 } +894 +895 /** +896 * Invoked just before a split +897 * @param tableName the table where the region belongs to +898 * @param splitRow the split point +899 * @param user the user +900 * @throws IOException +901 */ +902 public void preSplitRegionAction( +903 final TableName tableName, +904 final byte[] splitRow, +905 final User user) throws IOException { +906 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { +907 @Override +908 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +909 throws IOException { +910 oserver.preSplitRegionAction(ctx, tableName, splitRow); +911 } +912 }); +913 } +914 +915 /** +916 * Invoked just after a split +917 * @param regionInfoA the new left-hand daughter region +918 * @param regionInfoB the new right-hand daughter region +919 * @param user the user +920 * @throws IOException +921 */ +922 public void postCompletedSplitRegionAction( +923 final HRegionInfo regionInfoA, +924 final HRegionInfo regionInfoB, +925 final User user) throws IOException { +926 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { +927 @Override +928 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +929 throws IOException { +930 oserver.postCompletedSplitRegionAction(ctx, regionInfoA, regionInfoB); +931 } +932 }); +933 } +934 +935 /** +936 * This will be called before PONR step as part of split table region procedure. +937 * @param splitKey +938 * @param metaEntries +939 * @param user the user +940 * @throws IOException +941 */ +942 public boolean preSplitBeforePONRAction( +943 final byte[] splitKey, +944 final List<Mutation> metaEntries, +945 final User user) throws IOException { +946 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { +947 @Override +948 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +949 throws IOException { +950 oserver.preSplitRegionBeforePONRAction(ctx, splitKey, metaEntries); +951 } +952 }); +953 } +954 +955 /** +956 * This will be called after PONR step as part of split table region procedure. +957 * @param user the user +958 * @throws IOException +959 */ +960 public void preSplitAfterPONRAction(final User user) throws IOException { +961 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { +962 @Override +963 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +964 throws IOException { +965 oserver.preSplitRegionAfterPONRAction(ctx); +966 } +967 }); +968 } +969 +970 /** +971 * Invoked just after the rollback of a failed split +972 * @param user the user +973 * @throws IOException +974 */ +975 public void postRollBackSplitRegionAction(final User user) throws IOException { +976 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { +977 @Override +978 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +979 throws IOException { +980 oserver.postRollBackSplitRegionAction(ctx); +981 } +982 }); +983 } +984 +985 /** +986 * Invoked just before a merge +987 * @param regionsToMerge the regions to merge +988 * @param user the user +989 * @throws IOException +990 */ +991 public boolean preMergeRegionsAction( +992 final HRegionInfo[] regionsToMerge, final User user) throws IOException { +993 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { +994 @Override +995 public void call(MasterObserver oserver, +996 ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { +997 oserver.preMergeRegionsAction(ctx, regionsToMerge); +998 } +999 }); +1000 } +1001 +1002 /** +1003 * Invoked after completing merge regions operation +1004 * @param regionsToMerge the regions to merge +1005 * @param mergedRegion the new merged region +1006 * @param user the user +1007 * @throws IOException +1008 */ +1009 public void postCompletedMergeRegionsAction( +1010 final HRegionInfo[] regionsToMerge, +1011 final HRegionInfo mergedRegion, +1012 final User user) throws IOException { +1013 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { +1014 @Override +1015 public void call(MasterObserver oserver, +1016 ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { +1017 oserver.postCompletedMergeRegionsAction(ctx, regionsToMerge, mergedRegion); +1018 } +1019 }); +1020 } +1021 +1022 /** +1023 * Invoked before merge regions operation writes the new region to hbase:meta +1024 * @param regionsToMerge the regions to merge +1025 * @param metaEntries the meta entry +1026 * @param user the user +1027 * @throws IOException +1028 */ +1029 public boolean preMergeRegionsCommit( +1030 final HRegionInfo[] regionsToMerge, +1031 final @MetaMutationAnnotation List<Mutation> metaEntries, +1032 final User user) throws IOException { +1033 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { +1034 @Override +1035 public void call(MasterObserver oserver, +1036 ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { +1037 oserver.preMergeRegionsCommitAction(ctx, regionsToMerge, metaEntries); +1038 } +1039 }); +1040 } +1041 +1042 /** +1043 * Invoked after merge regions operation writes the new region to hbase:meta +1044 * @param regionsToMerge the regions to merge +1045 * @param mergedRegion the new merged region +1046 * @param user the user +1047 * @throws IOException +1048 */ +1049 public void postMergeRegionsCommit( +1050 final HRegionInfo[] regionsToMerge, +1051 final HRegionInfo mergedRegion, +1052 final User user) throws IOException { +1053 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { +1054 @Override +1055 public void call(MasterObserver oserver, +1056 ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { +1057 oserver.postMergeRegionsCommitAction(ctx, regionsToMerge, mergedRegion); +1058 } +1059 }); +1060 } +1061 +1062 /** +1063 * Invoked after rollback merge regions operation +1064 * @param regionsToMerge the regions to merge +1065 * @param user the user +1066 * @throws IOException +1067 */ +1068 public void postRollBackMergeRegionsAction( +1069 final HRegionInfo[] regionsToMerge, final User user) throws IOException { +1070 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { +1071 @Override +1072 public void call(MasterObserver oserver, +1073 ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { +1074 oserver.postRollBackMergeRegionsAction(ctx, regionsToMerge); +1075 } +1076 }); +1077 } +1078 +1079 public boolean preBalanceSwitch(final boolean b) throws IOException { +1080 return execOperationWithResult(b, coprocessors.isEmpty() ? null : +1081 new CoprocessorOperationWithResult<Boolean>() { +1082 @Override +1083 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +1084 throws IOException { +1085 setResult(oserver.preBalanceSwitch(ctx, getResult())); +1086 } +1087 }); +1088 } +1089 +1090 public void postBalanceSwitch(final boolean oldValue, final boolean newValue) +1091 throws IOException { +1092 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { 1093 @Override -1094 public void call(MasterObserver oserver, -1095 ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { -1096 oserver.postRollBackMergeRegionsAction(ctx, regionsToMerge); +1094 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +1095 throws IOException { +1096 oserver.postBalanceSwitch(ctx, oldValue, newValue); 1097 } 1098 }); 1099 } 1100 -1101 public boolean preBalanceSwitch(final boolean b) throws IOException { -1102 return execOperationWithResult(b, coprocessors.isEmpty() ? null : -1103 new CoprocessorOperationWithResult<Boolean>() { -1104 @Override -1105 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -1106 throws IOException { -1107 setResult(oserver.preBalanceSwitch(ctx, getResult())); -1108 } -1109 }); -1110 } -1111 -1112 public void postBalanceSwitch(final boolean oldValue, final boolean newValue) -1113 throws IOException { -1114 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -1115 @Override -1116 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -1117 throws IOException { -1118 oserver.postBalanceSwitch(ctx, oldValue, newValue); -1119 } -1120 }); -1121 } -1122 -1123 public void preShutdown() throws IOException { -1124 // While stopping the cluster all coprocessors method should be executed first then the -1125 // coprocessor should be cleaned up. -1126 execShutdown(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1101 public void preShutdown() throws IOException { +1102 // While stopping the cluster all coprocessors method should be executed first then the +1103 // coprocessor should be cleaned up. +1104 execShutdown(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1105 @Override +1106 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +1107 throws IOException { +1108 oserver.preShutdown(ctx); +1109 } +1110 @Override +1111 public void postEnvCall(MasterEnvironment env) { +1112 // invoke coprocessor stop method +1113 shutdown(env); +1114 } +1115 }); +1116 } +1117 +1118 public void preStopMaster() throws IOException { +1119 // While stopping master all coprocessors method should be executed first then the coprocessor +1120 // environment should be cleaned up. +1121 execShutdown(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1122 @Override +1123 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +1124 throws IOException { +1125 oserver.preStopMaster(ctx); +1126 } 1127 @Override -1128 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -1129 throws IOException { -1130 oserver.preShutdown(ctx); +1128 public void postEnvCall(MasterEnvironment env) { +1129 // invoke coprocessor stop method +1130 shutdown(env); 1131 } -1132 @Override -1133 public void postEnvCall(MasterEnvironment env) { -1134 // invoke coprocessor stop method -1135 shutdown(env); -1136 } -1137 }); -1138 } -1139 -1140 public void preStopMaster() throws IOException { -1141 // While stopping master all coprocessors method should be executed first then the coprocessor -1142 // environment should be cleaned up. -1143 execShutdown(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -1144 @Override -1145 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -1146 throws IOException { -1147 oserver.preStopMaster(ctx); -1148 } -1149 @Override -1150 public void postEnvCall(MasterEnvironment env) { -1151 // invoke coprocessor stop method -1152 shutdown(env); -1153 } -1154 }); -1155 } -1156 -1157 public void preMasterInitialization() throws IOException { -1158 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -1159 @Override -1160 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -1161 throws IOException { -1162 oserver.preMasterInitialization(ctx); -1163 } -1164 }); -1165 } -1166 -1167 public void postStartMaster() throws IOException { +1132 }); +1133 } +1134 +1135 public void preMasterInitialization() throws IOException { +1136 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1137 @Override +1138 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +1139 throws IOException { +1140 oserver.preMasterInitialization(ctx); +1141 } +1142 }); +1143 } +1144 +1145 public void postStartMaster() throws IOException { +1146 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1147 @Override +1148 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +1149 throws IOException { +1150 oserver.postStartMaster(ctx); +1151 } +1152 }); +1153 } +1154 +1155 public void preSnapshot(final SnapshotDescription snapshot, +1156 final HTableDescriptor hTableDescriptor) throws IOException { +1157 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1158 @Override +1159 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +1160 throws IOException { +1161 oserver.preSnapshot(ctx, snapshot, hTableDescriptor); +1162 } +1163 }); +1164 } +1165 +1166 public void postSnapshot(final SnapshotDescription snapshot, +1167 final HTableDescriptor hTableDescriptor) throws IOException { 1168 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { 1169 @Override 1170 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) 1171 throws IOException { -1172 oserver.postStartMaster(ctx); +1172 oserver.postSnapshot(ctx, snapshot, hTableDescriptor); 1173 } 1174 }); 1175 } 1176 -1177 public void preSnapshot(final SnapshotDescription snapshot, -1178 final HTableDescriptor hTableDescriptor) throws IOException { -1179 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -1180 @Override -1181 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -1182 throws IOException { -1183 oserver.preSnapshot(ctx, snapshot, hTableDescriptor); -1184 } -1185 }); -1186 } -1187 -1188 public void postSnapshot(final SnapshotDescription snapshot, -1189 final HTableDescriptor hTableDescriptor) throws IOException { -1190 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -1191 @Override -1192 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -1193 throws IOException { -1194 oserver.postSnapshot(ctx, snapshot, hTableDescriptor); -1195 } -1196 }); -1197 } -1198 -1199 public void preListSnapshot(final SnapshotDescription snapshot) throws IOException { -1200 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -1201 @Override -1202 public void call(MasterObserver observer, ObserverContext<MasterCoprocessorEnvironment> ctx) -1203 throws IOException { -1204 observer.preListSnapshot(ctx, snapshot); -1205 } -1206 }); -1207 } -1208 -1209 public void postListSnapshot(final SnapshotDescription snapshot) throws IOException { +1177 public void preListSnapshot(final SnapshotDescription snapshot) throws IOException { +1178 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1179 @Override +1180 public void call(MasterObserver observer, ObserverContext<MasterCoprocessorEnvironment> ctx) +1181 throws IOException { +1182 observer.preListSnapshot(ctx, snapshot); +1183 } +1184 }); +1185 } +1186 +1187 public void postListSnapshot(final SnapshotDescription snapshot) throws IOException { +1188 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1189 @Override +1190 public void call(MasterObserver observer, ObserverContext<MasterCoprocessorEnvironment> ctx) +1191 throws IOException { +1192 observer.postListSnapshot(ctx, snapshot); +1193 } +1194 }); +1195 } +1196 +1197 public void preCloneSnapshot(final SnapshotDescription snapshot, +1198 final HTableDescriptor hTableDescriptor) throws IOException { +1199 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1200 @Override +1201 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +1202 throws IOException { +1203 oserver.preCloneSnapshot(ctx, snapshot, hTableDescriptor); +1204 } +1205 }); +1206 } +1207 +1208 public void postCloneSnapshot(final SnapshotDescription snapshot, +1209 final HTableDescriptor hTableDescriptor) throws IOException { 1210 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { 1211 @Override -1212 public void call(MasterObserver observer, ObserverContext<MasterCoprocessorEnvironment> ctx) +1212 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) 1213 throws IOException { -1214 observer.postListSnapshot(ctx, snapshot); +1214 oserver.postCloneSnapshot(ctx, snapshot, hTableDescriptor); 1215 } 1216 }); 1217 } 1218 -1219 public void preCloneSnapshot(final SnapshotDescription snapshot, +1219 public void preRestoreSnapshot(final SnapshotDescription snapshot, 1220 final HTableDescriptor hTableDescriptor) throws IOException { 1221 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { 1222 @Override 1223 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) 1224 throws IOException { -1225 oserver.preCloneSnapshot(ctx, snapshot, hTableDescriptor); +1225 oserver.preRestoreSnapshot(ctx, snapshot, hTableDescriptor); 1226 } 1227 }); 1228 } 1229 -1230 public void postCloneSnapshot(final SnapshotDescription snapshot, +1230 public void postRestoreSnapshot(final SnapshotDescription snapshot, 1231 final HTableDescriptor hTableDescriptor) throws IOException { 1232 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { 1233 @Override 1234 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) 1235 throws IOException { -1236 oserver.postCloneSnapshot(ctx, snapshot, hTableDescriptor); +1236 oserver.postRestoreSnapshot(ctx, snapshot, hTableDescriptor); 1237 } 1238 }); 1239 } 1240 -1241 public void preRestoreSnapshot(final SnapshotDescription snapshot, -1242 final HTableDescriptor hTableDescriptor) throws IOException { -1243 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -1244 @Override -1245 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -1246 throws IOException { -1247 oserver.preRestoreSnapshot(ctx, snapshot, hTableDescriptor); -1248 } -1249 }); -1250 } -1251 -1252 public void postRestoreSnapshot(final SnapshotDescription snapshot, -1253 final HTableDescriptor hTableDescriptor) throws IOException { -1254 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -1255 @Override -1256 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -1257 throws IOException { -1258 oserver.postRestoreSnapshot(ctx, snapshot, hTableDescriptor); -1259 } -1260 }); -1261 } -1262 -1263 public void preDeleteSnapshot(final SnapshotDescription snapshot) throws IOException { -1264 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { -1265 @Override -1266 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) -1267 throws IOException { -1268 oserver.preDeleteSnapshot(ctx, snapshot); -1269 } -1270 }); -1271 } -1272 -1273 public void postDeleteSnapshot(final SnapshotDescription snapshot) throws IOException { +1241 public void preDeleteSnapshot(final SnapshotDescription snapshot) throws IOException { +1242 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1243 @Override +1244 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +1245 throws IOException { +1246 oserver.preDeleteSnapshot(ctx, snapshot); +1247 } +1248 }); +1249 } +1250 +1251 public void postDeleteSnapshot(final SnapshotDescription snapshot) throws IOException { +1252 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1253 @Override +1254 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +1255 throws IOException { +1256 oserver.postDeleteSnapshot(ctx, snapshot); +1257 } +1258 }); +1259 } +1260 +1261 public boolean preGetTableDescriptors(final List<TableName> tableNamesList, +1262 final List<HTableDescriptor> descriptors, final String regex) throws IOException { +1263 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { +1264 @Override +1265 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) +1266 throws IOException { +1267 oserver.preGetTableDescriptors(ctx, tableNamesList, descriptors, regex); +1268 } +1269 }); +1270 } +1271 +1272 public void postGetTableDescriptors(final List<TableName> tableNamesList, +1273 final List<HTableDescriptor> descriptors, final String regex) throws IOException { 1274 execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { 1275 @Override 1276 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) 1277 throws IOException { -1278 oserver.postDeleteSnapshot(ctx, snapshot); +1278 oserver.postGetTableDescriptors(ctx, tableNamesList, descriptors, regex); 1279 } 1280 }); 1281 } 1282 -1283 public boolean preGetTableDescriptors(final List<TableName> tableNamesList, -1284 final List<HTableDescriptor> descriptors, final String regex) throws IOException { +1283 public boolean preGetTableNames(final List<HTableDescriptor> descriptors, +1284 final String regex) throws IOException { 1285 return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { 1286 @Override 1287 public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) 1288 throws IOException { -1289 oserver.preGetTableDescriptors(ctx, tableNamesList, descriptors, regex); +1289 oserver.preGetTableNames(ctx, descriptors, regex); 1290 } 1291 }); 1292 }