http://git-wip-us.apache.org/repos/asf/hbase-site/blob/9577bd5e/apidocs/src-html/org/apache/hadoop/hbase/client/Admin.html ---------------------------------------------------------------------- diff --git a/apidocs/src-html/org/apache/hadoop/hbase/client/Admin.html b/apidocs/src-html/org/apache/hadoop/hbase/client/Admin.html index a47dece..02668c6 100644 --- a/apidocs/src-html/org/apache/hadoop/hbase/client/Admin.html +++ b/apidocs/src-html/org/apache/hadoop/hbase/client/Admin.html @@ -973,706 +973,734 @@ <span class="sourceLineNo">965</span> Configuration getConfiguration();<a name="line.965"></a> <span class="sourceLineNo">966</span><a name="line.966"></a> <span class="sourceLineNo">967</span> /**<a name="line.967"></a> -<span class="sourceLineNo">968</span> * Create a new namespace<a name="line.968"></a> -<span class="sourceLineNo">969</span> *<a name="line.969"></a> -<span class="sourceLineNo">970</span> * @param descriptor descriptor which describes the new namespace<a name="line.970"></a> -<span class="sourceLineNo">971</span> * @throws IOException<a name="line.971"></a> +<span class="sourceLineNo">968</span> * Create a new namespace. Blocks until namespace has been successfully created or an exception<a name="line.968"></a> +<span class="sourceLineNo">969</span> * is thrown.<a name="line.969"></a> +<span class="sourceLineNo">970</span> *<a name="line.970"></a> +<span class="sourceLineNo">971</span> * @param descriptor descriptor which describes the new namespace<a name="line.971"></a> <span class="sourceLineNo">972</span> */<a name="line.972"></a> <span class="sourceLineNo">973</span> void createNamespace(final NamespaceDescriptor descriptor)<a name="line.973"></a> -<span class="sourceLineNo">974</span> throws IOException;<a name="line.974"></a> +<span class="sourceLineNo">974</span> throws IOException;<a name="line.974"></a> <span class="sourceLineNo">975</span><a name="line.975"></a> <span class="sourceLineNo">976</span> /**<a name="line.976"></a> -<span class="sourceLineNo">977</span> * Modify an existing namespace<a name="line.977"></a> +<span class="sourceLineNo">977</span> * Create a new namespace<a name="line.977"></a> <span class="sourceLineNo">978</span> *<a name="line.978"></a> <span class="sourceLineNo">979</span> * @param descriptor descriptor which describes the new namespace<a name="line.979"></a> -<span class="sourceLineNo">980</span> * @throws IOException<a name="line.980"></a> -<span class="sourceLineNo">981</span> */<a name="line.981"></a> -<span class="sourceLineNo">982</span> void modifyNamespace(final NamespaceDescriptor descriptor)<a name="line.982"></a> -<span class="sourceLineNo">983</span> throws IOException;<a name="line.983"></a> -<span class="sourceLineNo">984</span><a name="line.984"></a> -<span class="sourceLineNo">985</span> /**<a name="line.985"></a> -<span class="sourceLineNo">986</span> * Delete an existing namespace. Only empty namespaces (no tables) can be removed.<a name="line.986"></a> -<span class="sourceLineNo">987</span> *<a name="line.987"></a> -<span class="sourceLineNo">988</span> * @param name namespace name<a name="line.988"></a> -<span class="sourceLineNo">989</span> * @throws IOException<a name="line.989"></a> -<span class="sourceLineNo">990</span> */<a name="line.990"></a> -<span class="sourceLineNo">991</span> void deleteNamespace(final String name) throws IOException;<a name="line.991"></a> -<span class="sourceLineNo">992</span><a name="line.992"></a> -<span class="sourceLineNo">993</span> /**<a name="line.993"></a> -<span class="sourceLineNo">994</span> * Get a namespace descriptor by name<a name="line.994"></a> -<span class="sourceLineNo">995</span> *<a name="line.995"></a> -<span class="sourceLineNo">996</span> * @param name name of namespace descriptor<a name="line.996"></a> -<span class="sourceLineNo">997</span> * @return A descriptor<a name="line.997"></a> -<span class="sourceLineNo">998</span> * @throws IOException<a name="line.998"></a> -<span class="sourceLineNo">999</span> */<a name="line.999"></a> -<span class="sourceLineNo">1000</span> NamespaceDescriptor getNamespaceDescriptor(final String name)<a name="line.1000"></a> -<span class="sourceLineNo">1001</span> throws IOException;<a name="line.1001"></a> -<span class="sourceLineNo">1002</span><a name="line.1002"></a> -<span class="sourceLineNo">1003</span> /**<a name="line.1003"></a> -<span class="sourceLineNo">1004</span> * List available namespace descriptors<a name="line.1004"></a> -<span class="sourceLineNo">1005</span> *<a name="line.1005"></a> -<span class="sourceLineNo">1006</span> * @return List of descriptors<a name="line.1006"></a> -<span class="sourceLineNo">1007</span> * @throws IOException<a name="line.1007"></a> -<span class="sourceLineNo">1008</span> */<a name="line.1008"></a> -<span class="sourceLineNo">1009</span> NamespaceDescriptor[] listNamespaceDescriptors()<a name="line.1009"></a> -<span class="sourceLineNo">1010</span> throws IOException;<a name="line.1010"></a> -<span class="sourceLineNo">1011</span><a name="line.1011"></a> -<span class="sourceLineNo">1012</span> /**<a name="line.1012"></a> -<span class="sourceLineNo">1013</span> * Get list of table descriptors by namespace<a name="line.1013"></a> -<span class="sourceLineNo">1014</span> *<a name="line.1014"></a> -<span class="sourceLineNo">1015</span> * @param name namespace name<a name="line.1015"></a> -<span class="sourceLineNo">1016</span> * @return A descriptor<a name="line.1016"></a> -<span class="sourceLineNo">1017</span> * @throws IOException<a name="line.1017"></a> -<span class="sourceLineNo">1018</span> */<a name="line.1018"></a> -<span class="sourceLineNo">1019</span> HTableDescriptor[] listTableDescriptorsByNamespace(final String name)<a name="line.1019"></a> -<span class="sourceLineNo">1020</span> throws IOException;<a name="line.1020"></a> -<span class="sourceLineNo">1021</span><a name="line.1021"></a> -<span class="sourceLineNo">1022</span> /**<a name="line.1022"></a> -<span class="sourceLineNo">1023</span> * Get list of table names by namespace<a name="line.1023"></a> -<span class="sourceLineNo">1024</span> *<a name="line.1024"></a> -<span class="sourceLineNo">1025</span> * @param name namespace name<a name="line.1025"></a> -<span class="sourceLineNo">1026</span> * @return The list of table names in the namespace<a name="line.1026"></a> -<span class="sourceLineNo">1027</span> * @throws IOException<a name="line.1027"></a> +<span class="sourceLineNo">980</span> * @return the result of the async create namespace operation. Use Future.get(long, TimeUnit) to<a name="line.980"></a> +<span class="sourceLineNo">981</span> * wait on the operation to complete.<a name="line.981"></a> +<span class="sourceLineNo">982</span> */<a name="line.982"></a> +<span class="sourceLineNo">983</span> Future<Void> createNamespaceAsync(final NamespaceDescriptor descriptor)<a name="line.983"></a> +<span class="sourceLineNo">984</span> throws IOException;<a name="line.984"></a> +<span class="sourceLineNo">985</span><a name="line.985"></a> +<span class="sourceLineNo">986</span> /**<a name="line.986"></a> +<span class="sourceLineNo">987</span> * Modify an existing namespace. Blocks until namespace has been successfully modified or an<a name="line.987"></a> +<span class="sourceLineNo">988</span> * exception is thrown.<a name="line.988"></a> +<span class="sourceLineNo">989</span> *<a name="line.989"></a> +<span class="sourceLineNo">990</span> * @param descriptor descriptor which describes the new namespace<a name="line.990"></a> +<span class="sourceLineNo">991</span> */<a name="line.991"></a> +<span class="sourceLineNo">992</span> void modifyNamespace(final NamespaceDescriptor descriptor)<a name="line.992"></a> +<span class="sourceLineNo">993</span> throws IOException;<a name="line.993"></a> +<span class="sourceLineNo">994</span><a name="line.994"></a> +<span class="sourceLineNo">995</span> /**<a name="line.995"></a> +<span class="sourceLineNo">996</span> * Modify an existing namespace<a name="line.996"></a> +<span class="sourceLineNo">997</span> *<a name="line.997"></a> +<span class="sourceLineNo">998</span> * @param descriptor descriptor which describes the new namespace<a name="line.998"></a> +<span class="sourceLineNo">999</span> * @return the result of the async modify namespace operation. Use Future.get(long, TimeUnit) to<a name="line.999"></a> +<span class="sourceLineNo">1000</span> * wait on the operation to complete.<a name="line.1000"></a> +<span class="sourceLineNo">1001</span> */<a name="line.1001"></a> +<span class="sourceLineNo">1002</span> Future<Void> modifyNamespaceAsync(final NamespaceDescriptor descriptor)<a name="line.1002"></a> +<span class="sourceLineNo">1003</span> throws IOException;<a name="line.1003"></a> +<span class="sourceLineNo">1004</span><a name="line.1004"></a> +<span class="sourceLineNo">1005</span> /**<a name="line.1005"></a> +<span class="sourceLineNo">1006</span> * Delete an existing namespace. Only empty namespaces (no tables) can be removed.<a name="line.1006"></a> +<span class="sourceLineNo">1007</span> * Blocks until namespace has been successfully deleted or an<a name="line.1007"></a> +<span class="sourceLineNo">1008</span> * exception is thrown.<a name="line.1008"></a> +<span class="sourceLineNo">1009</span> *<a name="line.1009"></a> +<span class="sourceLineNo">1010</span> * @param name namespace name<a name="line.1010"></a> +<span class="sourceLineNo">1011</span> */<a name="line.1011"></a> +<span class="sourceLineNo">1012</span> void deleteNamespace(final String name) throws IOException;<a name="line.1012"></a> +<span class="sourceLineNo">1013</span><a name="line.1013"></a> +<span class="sourceLineNo">1014</span> /**<a name="line.1014"></a> +<span class="sourceLineNo">1015</span> * Delete an existing namespace. Only empty namespaces (no tables) can be removed.<a name="line.1015"></a> +<span class="sourceLineNo">1016</span> *<a name="line.1016"></a> +<span class="sourceLineNo">1017</span> * @param name namespace name<a name="line.1017"></a> +<span class="sourceLineNo">1018</span> * @return the result of the async delete namespace operation. Use Future.get(long, TimeUnit) to<a name="line.1018"></a> +<span class="sourceLineNo">1019</span> * wait on the operation to complete.<a name="line.1019"></a> +<span class="sourceLineNo">1020</span> */<a name="line.1020"></a> +<span class="sourceLineNo">1021</span> Future<Void> deleteNamespaceAsync(final String name) throws IOException;<a name="line.1021"></a> +<span class="sourceLineNo">1022</span><a name="line.1022"></a> +<span class="sourceLineNo">1023</span> /**<a name="line.1023"></a> +<span class="sourceLineNo">1024</span> * Get a namespace descriptor by name<a name="line.1024"></a> +<span class="sourceLineNo">1025</span> *<a name="line.1025"></a> +<span class="sourceLineNo">1026</span> * @param name name of namespace descriptor<a name="line.1026"></a> +<span class="sourceLineNo">1027</span> * @return A descriptor<a name="line.1027"></a> <span class="sourceLineNo">1028</span> */<a name="line.1028"></a> -<span class="sourceLineNo">1029</span> TableName[] listTableNamesByNamespace(final String name)<a name="line.1029"></a> -<span class="sourceLineNo">1030</span> throws IOException;<a name="line.1030"></a> +<span class="sourceLineNo">1029</span> NamespaceDescriptor getNamespaceDescriptor(final String name)<a name="line.1029"></a> +<span class="sourceLineNo">1030</span> throws IOException;<a name="line.1030"></a> <span class="sourceLineNo">1031</span><a name="line.1031"></a> <span class="sourceLineNo">1032</span> /**<a name="line.1032"></a> -<span class="sourceLineNo">1033</span> * Get the regions of a given table.<a name="line.1033"></a> +<span class="sourceLineNo">1033</span> * List available namespace descriptors<a name="line.1033"></a> <span class="sourceLineNo">1034</span> *<a name="line.1034"></a> -<span class="sourceLineNo">1035</span> * @param tableName the name of the table<a name="line.1035"></a> -<span class="sourceLineNo">1036</span> * @return List of {@link HRegionInfo}.<a name="line.1036"></a> -<span class="sourceLineNo">1037</span> * @throws IOException<a name="line.1037"></a> -<span class="sourceLineNo">1038</span> */<a name="line.1038"></a> -<span class="sourceLineNo">1039</span> List<HRegionInfo> getTableRegions(final TableName tableName)<a name="line.1039"></a> -<span class="sourceLineNo">1040</span> throws IOException;<a name="line.1040"></a> -<span class="sourceLineNo">1041</span><a name="line.1041"></a> -<span class="sourceLineNo">1042</span> @Override<a name="line.1042"></a> -<span class="sourceLineNo">1043</span> void close() throws IOException;<a name="line.1043"></a> -<span class="sourceLineNo">1044</span><a name="line.1044"></a> -<span class="sourceLineNo">1045</span> /**<a name="line.1045"></a> -<span class="sourceLineNo">1046</span> * Get tableDescriptors<a name="line.1046"></a> -<span class="sourceLineNo">1047</span> *<a name="line.1047"></a> -<span class="sourceLineNo">1048</span> * @param tableNames List of table names<a name="line.1048"></a> -<span class="sourceLineNo">1049</span> * @return HTD[] the tableDescriptor<a name="line.1049"></a> -<span class="sourceLineNo">1050</span> * @throws IOException if a remote or network exception occurs<a name="line.1050"></a> -<span class="sourceLineNo">1051</span> */<a name="line.1051"></a> -<span class="sourceLineNo">1052</span> HTableDescriptor[] getTableDescriptorsByTableName(List<TableName> tableNames)<a name="line.1052"></a> -<span class="sourceLineNo">1053</span> throws IOException;<a name="line.1053"></a> -<span class="sourceLineNo">1054</span><a name="line.1054"></a> -<span class="sourceLineNo">1055</span> /**<a name="line.1055"></a> -<span class="sourceLineNo">1056</span> * Get tableDescriptors<a name="line.1056"></a> -<span class="sourceLineNo">1057</span> *<a name="line.1057"></a> -<span class="sourceLineNo">1058</span> * @param names List of table names<a name="line.1058"></a> -<span class="sourceLineNo">1059</span> * @return HTD[] the tableDescriptor<a name="line.1059"></a> -<span class="sourceLineNo">1060</span> * @throws IOException if a remote or network exception occurs<a name="line.1060"></a> -<span class="sourceLineNo">1061</span> */<a name="line.1061"></a> -<span class="sourceLineNo">1062</span> HTableDescriptor[] getTableDescriptors(List<String> names)<a name="line.1062"></a> -<span class="sourceLineNo">1063</span> throws IOException;<a name="line.1063"></a> -<span class="sourceLineNo">1064</span><a name="line.1064"></a> -<span class="sourceLineNo">1065</span> /**<a name="line.1065"></a> -<span class="sourceLineNo">1066</span> * abort a procedure<a name="line.1066"></a> -<span class="sourceLineNo">1067</span> * @param procId ID of the procedure to abort<a name="line.1067"></a> -<span class="sourceLineNo">1068</span> * @param mayInterruptIfRunning if the proc completed at least one step, should it be aborted?<a name="line.1068"></a> -<span class="sourceLineNo">1069</span> * @return true if aborted, false if procedure already completed or does not exist<a name="line.1069"></a> -<span class="sourceLineNo">1070</span> * @throws IOException<a name="line.1070"></a> -<span class="sourceLineNo">1071</span> */<a name="line.1071"></a> -<span class="sourceLineNo">1072</span> boolean abortProcedure(<a name="line.1072"></a> -<span class="sourceLineNo">1073</span> final long procId,<a name="line.1073"></a> -<span class="sourceLineNo">1074</span> final boolean mayInterruptIfRunning) throws IOException;<a name="line.1074"></a> -<span class="sourceLineNo">1075</span><a name="line.1075"></a> -<span class="sourceLineNo">1076</span> /**<a name="line.1076"></a> -<span class="sourceLineNo">1077</span> * Abort a procedure but does not block and wait for it be completely removed.<a name="line.1077"></a> -<span class="sourceLineNo">1078</span> * You can use Future.get(long, TimeUnit) to wait on the operation to complete.<a name="line.1078"></a> -<span class="sourceLineNo">1079</span> * It may throw ExecutionException if there was an error while executing the operation<a name="line.1079"></a> -<span class="sourceLineNo">1080</span> * or TimeoutException in case the wait timeout was not long enough to allow the<a name="line.1080"></a> -<span class="sourceLineNo">1081</span> * operation to complete.<a name="line.1081"></a> -<span class="sourceLineNo">1082</span> *<a name="line.1082"></a> -<span class="sourceLineNo">1083</span> * @param procId ID of the procedure to abort<a name="line.1083"></a> -<span class="sourceLineNo">1084</span> * @param mayInterruptIfRunning if the proc completed at least one step, should it be aborted?<a name="line.1084"></a> -<span class="sourceLineNo">1085</span> * @return true if aborted, false if procedure already completed or does not exist<a name="line.1085"></a> -<span class="sourceLineNo">1086</span> * @throws IOException<a name="line.1086"></a> -<span class="sourceLineNo">1087</span> */<a name="line.1087"></a> -<span class="sourceLineNo">1088</span> Future<Boolean> abortProcedureAsync(<a name="line.1088"></a> -<span class="sourceLineNo">1089</span> final long procId,<a name="line.1089"></a> -<span class="sourceLineNo">1090</span> final boolean mayInterruptIfRunning) throws IOException;<a name="line.1090"></a> -<span class="sourceLineNo">1091</span><a name="line.1091"></a> -<span class="sourceLineNo">1092</span> /**<a name="line.1092"></a> -<span class="sourceLineNo">1093</span> * List procedures<a name="line.1093"></a> -<span class="sourceLineNo">1094</span> * @return procedure list<a name="line.1094"></a> -<span class="sourceLineNo">1095</span> * @throws IOException<a name="line.1095"></a> -<span class="sourceLineNo">1096</span> */<a name="line.1096"></a> -<span class="sourceLineNo">1097</span> ProcedureInfo[] listProcedures()<a name="line.1097"></a> -<span class="sourceLineNo">1098</span> throws IOException;<a name="line.1098"></a> -<span class="sourceLineNo">1099</span><a name="line.1099"></a> -<span class="sourceLineNo">1100</span> /**<a name="line.1100"></a> -<span class="sourceLineNo">1101</span> * Roll the log writer. I.e. for filesystem based write ahead logs, start writing to a new file.<a name="line.1101"></a> -<span class="sourceLineNo">1102</span> *<a name="line.1102"></a> -<span class="sourceLineNo">1103</span> * Note that the actual rolling of the log writer is asynchronous and may not be complete when<a name="line.1103"></a> -<span class="sourceLineNo">1104</span> * this method returns. As a side effect of this call, the named region server may schedule<a name="line.1104"></a> -<span class="sourceLineNo">1105</span> * store flushes at the request of the wal.<a name="line.1105"></a> -<span class="sourceLineNo">1106</span> *<a name="line.1106"></a> -<span class="sourceLineNo">1107</span> * @param serverName The servername of the regionserver.<a name="line.1107"></a> -<span class="sourceLineNo">1108</span> * @throws IOException if a remote or network exception occurs<a name="line.1108"></a> -<span class="sourceLineNo">1109</span> * @throws org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException<a name="line.1109"></a> -<span class="sourceLineNo">1110</span> */<a name="line.1110"></a> -<span class="sourceLineNo">1111</span> void rollWALWriter(ServerName serverName) throws IOException, FailedLogCloseException;<a name="line.1111"></a> -<span class="sourceLineNo">1112</span><a name="line.1112"></a> -<span class="sourceLineNo">1113</span> /**<a name="line.1113"></a> -<span class="sourceLineNo">1114</span> * Helper delegage to getClusterStatus().getMasterCoprocessors().<a name="line.1114"></a> -<span class="sourceLineNo">1115</span> * @return an array of master coprocessors<a name="line.1115"></a> -<span class="sourceLineNo">1116</span> * @see org.apache.hadoop.hbase.ClusterStatus#getMasterCoprocessors()<a name="line.1116"></a> -<span class="sourceLineNo">1117</span> */<a name="line.1117"></a> -<span class="sourceLineNo">1118</span> String[] getMasterCoprocessors() throws IOException;<a name="line.1118"></a> +<span class="sourceLineNo">1035</span> * @return List of descriptors<a name="line.1035"></a> +<span class="sourceLineNo">1036</span> */<a name="line.1036"></a> +<span class="sourceLineNo">1037</span> NamespaceDescriptor[] listNamespaceDescriptors()<a name="line.1037"></a> +<span class="sourceLineNo">1038</span> throws IOException;<a name="line.1038"></a> +<span class="sourceLineNo">1039</span><a name="line.1039"></a> +<span class="sourceLineNo">1040</span> /**<a name="line.1040"></a> +<span class="sourceLineNo">1041</span> * Get list of table descriptors by namespace<a name="line.1041"></a> +<span class="sourceLineNo">1042</span> *<a name="line.1042"></a> +<span class="sourceLineNo">1043</span> * @param name namespace name<a name="line.1043"></a> +<span class="sourceLineNo">1044</span> * @return A descriptor<a name="line.1044"></a> +<span class="sourceLineNo">1045</span> * @throws IOException<a name="line.1045"></a> +<span class="sourceLineNo">1046</span> */<a name="line.1046"></a> +<span class="sourceLineNo">1047</span> HTableDescriptor[] listTableDescriptorsByNamespace(final String name)<a name="line.1047"></a> +<span class="sourceLineNo">1048</span> throws IOException;<a name="line.1048"></a> +<span class="sourceLineNo">1049</span><a name="line.1049"></a> +<span class="sourceLineNo">1050</span> /**<a name="line.1050"></a> +<span class="sourceLineNo">1051</span> * Get list of table names by namespace<a name="line.1051"></a> +<span class="sourceLineNo">1052</span> *<a name="line.1052"></a> +<span class="sourceLineNo">1053</span> * @param name namespace name<a name="line.1053"></a> +<span class="sourceLineNo">1054</span> * @return The list of table names in the namespace<a name="line.1054"></a> +<span class="sourceLineNo">1055</span> * @throws IOException<a name="line.1055"></a> +<span class="sourceLineNo">1056</span> */<a name="line.1056"></a> +<span class="sourceLineNo">1057</span> TableName[] listTableNamesByNamespace(final String name)<a name="line.1057"></a> +<span class="sourceLineNo">1058</span> throws IOException;<a name="line.1058"></a> +<span class="sourceLineNo">1059</span><a name="line.1059"></a> +<span class="sourceLineNo">1060</span> /**<a name="line.1060"></a> +<span class="sourceLineNo">1061</span> * Get the regions of a given table.<a name="line.1061"></a> +<span class="sourceLineNo">1062</span> *<a name="line.1062"></a> +<span class="sourceLineNo">1063</span> * @param tableName the name of the table<a name="line.1063"></a> +<span class="sourceLineNo">1064</span> * @return List of {@link HRegionInfo}.<a name="line.1064"></a> +<span class="sourceLineNo">1065</span> * @throws IOException<a name="line.1065"></a> +<span class="sourceLineNo">1066</span> */<a name="line.1066"></a> +<span class="sourceLineNo">1067</span> List<HRegionInfo> getTableRegions(final TableName tableName)<a name="line.1067"></a> +<span class="sourceLineNo">1068</span> throws IOException;<a name="line.1068"></a> +<span class="sourceLineNo">1069</span><a name="line.1069"></a> +<span class="sourceLineNo">1070</span> @Override<a name="line.1070"></a> +<span class="sourceLineNo">1071</span> void close() throws IOException;<a name="line.1071"></a> +<span class="sourceLineNo">1072</span><a name="line.1072"></a> +<span class="sourceLineNo">1073</span> /**<a name="line.1073"></a> +<span class="sourceLineNo">1074</span> * Get tableDescriptors<a name="line.1074"></a> +<span class="sourceLineNo">1075</span> *<a name="line.1075"></a> +<span class="sourceLineNo">1076</span> * @param tableNames List of table names<a name="line.1076"></a> +<span class="sourceLineNo">1077</span> * @return HTD[] the tableDescriptor<a name="line.1077"></a> +<span class="sourceLineNo">1078</span> * @throws IOException if a remote or network exception occurs<a name="line.1078"></a> +<span class="sourceLineNo">1079</span> */<a name="line.1079"></a> +<span class="sourceLineNo">1080</span> HTableDescriptor[] getTableDescriptorsByTableName(List<TableName> tableNames)<a name="line.1080"></a> +<span class="sourceLineNo">1081</span> throws IOException;<a name="line.1081"></a> +<span class="sourceLineNo">1082</span><a name="line.1082"></a> +<span class="sourceLineNo">1083</span> /**<a name="line.1083"></a> +<span class="sourceLineNo">1084</span> * Get tableDescriptors<a name="line.1084"></a> +<span class="sourceLineNo">1085</span> *<a name="line.1085"></a> +<span class="sourceLineNo">1086</span> * @param names List of table names<a name="line.1086"></a> +<span class="sourceLineNo">1087</span> * @return HTD[] the tableDescriptor<a name="line.1087"></a> +<span class="sourceLineNo">1088</span> * @throws IOException if a remote or network exception occurs<a name="line.1088"></a> +<span class="sourceLineNo">1089</span> */<a name="line.1089"></a> +<span class="sourceLineNo">1090</span> HTableDescriptor[] getTableDescriptors(List<String> names)<a name="line.1090"></a> +<span class="sourceLineNo">1091</span> throws IOException;<a name="line.1091"></a> +<span class="sourceLineNo">1092</span><a name="line.1092"></a> +<span class="sourceLineNo">1093</span> /**<a name="line.1093"></a> +<span class="sourceLineNo">1094</span> * abort a procedure<a name="line.1094"></a> +<span class="sourceLineNo">1095</span> * @param procId ID of the procedure to abort<a name="line.1095"></a> +<span class="sourceLineNo">1096</span> * @param mayInterruptIfRunning if the proc completed at least one step, should it be aborted?<a name="line.1096"></a> +<span class="sourceLineNo">1097</span> * @return true if aborted, false if procedure already completed or does not exist<a name="line.1097"></a> +<span class="sourceLineNo">1098</span> * @throws IOException<a name="line.1098"></a> +<span class="sourceLineNo">1099</span> */<a name="line.1099"></a> +<span class="sourceLineNo">1100</span> boolean abortProcedure(<a name="line.1100"></a> +<span class="sourceLineNo">1101</span> final long procId,<a name="line.1101"></a> +<span class="sourceLineNo">1102</span> final boolean mayInterruptIfRunning) throws IOException;<a name="line.1102"></a> +<span class="sourceLineNo">1103</span><a name="line.1103"></a> +<span class="sourceLineNo">1104</span> /**<a name="line.1104"></a> +<span class="sourceLineNo">1105</span> * Abort a procedure but does not block and wait for it be completely removed.<a name="line.1105"></a> +<span class="sourceLineNo">1106</span> * You can use Future.get(long, TimeUnit) to wait on the operation to complete.<a name="line.1106"></a> +<span class="sourceLineNo">1107</span> * It may throw ExecutionException if there was an error while executing the operation<a name="line.1107"></a> +<span class="sourceLineNo">1108</span> * or TimeoutException in case the wait timeout was not long enough to allow the<a name="line.1108"></a> +<span class="sourceLineNo">1109</span> * operation to complete.<a name="line.1109"></a> +<span class="sourceLineNo">1110</span> *<a name="line.1110"></a> +<span class="sourceLineNo">1111</span> * @param procId ID of the procedure to abort<a name="line.1111"></a> +<span class="sourceLineNo">1112</span> * @param mayInterruptIfRunning if the proc completed at least one step, should it be aborted?<a name="line.1112"></a> +<span class="sourceLineNo">1113</span> * @return true if aborted, false if procedure already completed or does not exist<a name="line.1113"></a> +<span class="sourceLineNo">1114</span> * @throws IOException<a name="line.1114"></a> +<span class="sourceLineNo">1115</span> */<a name="line.1115"></a> +<span class="sourceLineNo">1116</span> Future<Boolean> abortProcedureAsync(<a name="line.1116"></a> +<span class="sourceLineNo">1117</span> final long procId,<a name="line.1117"></a> +<span class="sourceLineNo">1118</span> final boolean mayInterruptIfRunning) throws IOException;<a name="line.1118"></a> <span class="sourceLineNo">1119</span><a name="line.1119"></a> <span class="sourceLineNo">1120</span> /**<a name="line.1120"></a> -<span class="sourceLineNo">1121</span> * Get the current compaction state of a table. It could be in a major compaction, a minor<a name="line.1121"></a> -<span class="sourceLineNo">1122</span> * compaction, both, or none.<a name="line.1122"></a> -<span class="sourceLineNo">1123</span> *<a name="line.1123"></a> -<span class="sourceLineNo">1124</span> * @param tableName table to examine<a name="line.1124"></a> -<span class="sourceLineNo">1125</span> * @return the current compaction state<a name="line.1125"></a> -<span class="sourceLineNo">1126</span> * @throws IOException if a remote or network exception occurs<a name="line.1126"></a> -<span class="sourceLineNo">1127</span> */<a name="line.1127"></a> -<span class="sourceLineNo">1128</span> AdminProtos.GetRegionInfoResponse.CompactionState getCompactionState(final TableName tableName)<a name="line.1128"></a> -<span class="sourceLineNo">1129</span> throws IOException;<a name="line.1129"></a> -<span class="sourceLineNo">1130</span><a name="line.1130"></a> -<span class="sourceLineNo">1131</span> /**<a name="line.1131"></a> -<span class="sourceLineNo">1132</span> * Get the current compaction state of region. It could be in a major compaction, a minor<a name="line.1132"></a> -<span class="sourceLineNo">1133</span> * compaction, both, or none.<a name="line.1133"></a> +<span class="sourceLineNo">1121</span> * List procedures<a name="line.1121"></a> +<span class="sourceLineNo">1122</span> * @return procedure list<a name="line.1122"></a> +<span class="sourceLineNo">1123</span> * @throws IOException<a name="line.1123"></a> +<span class="sourceLineNo">1124</span> */<a name="line.1124"></a> +<span class="sourceLineNo">1125</span> ProcedureInfo[] listProcedures()<a name="line.1125"></a> +<span class="sourceLineNo">1126</span> throws IOException;<a name="line.1126"></a> +<span class="sourceLineNo">1127</span><a name="line.1127"></a> +<span class="sourceLineNo">1128</span> /**<a name="line.1128"></a> +<span class="sourceLineNo">1129</span> * Roll the log writer. I.e. for filesystem based write ahead logs, start writing to a new file.<a name="line.1129"></a> +<span class="sourceLineNo">1130</span> *<a name="line.1130"></a> +<span class="sourceLineNo">1131</span> * Note that the actual rolling of the log writer is asynchronous and may not be complete when<a name="line.1131"></a> +<span class="sourceLineNo">1132</span> * this method returns. As a side effect of this call, the named region server may schedule<a name="line.1132"></a> +<span class="sourceLineNo">1133</span> * store flushes at the request of the wal.<a name="line.1133"></a> <span class="sourceLineNo">1134</span> *<a name="line.1134"></a> -<span class="sourceLineNo">1135</span> * @param regionName region to examine<a name="line.1135"></a> -<span class="sourceLineNo">1136</span> * @return the current compaction state<a name="line.1136"></a> -<span class="sourceLineNo">1137</span> * @throws IOException if a remote or network exception occurs<a name="line.1137"></a> +<span class="sourceLineNo">1135</span> * @param serverName The servername of the regionserver.<a name="line.1135"></a> +<span class="sourceLineNo">1136</span> * @throws IOException if a remote or network exception occurs<a name="line.1136"></a> +<span class="sourceLineNo">1137</span> * @throws org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException<a name="line.1137"></a> <span class="sourceLineNo">1138</span> */<a name="line.1138"></a> -<span class="sourceLineNo">1139</span> AdminProtos.GetRegionInfoResponse.CompactionState getCompactionStateForRegion(<a name="line.1139"></a> -<span class="sourceLineNo">1140</span> final byte[] regionName) throws IOException;<a name="line.1140"></a> -<span class="sourceLineNo">1141</span><a name="line.1141"></a> -<span class="sourceLineNo">1142</span> /**<a name="line.1142"></a> -<span class="sourceLineNo">1143</span> * Get the timestamp of the last major compaction for the passed table<a name="line.1143"></a> -<span class="sourceLineNo">1144</span> *<a name="line.1144"></a> -<span class="sourceLineNo">1145</span> * The timestamp of the oldest HFile resulting from a major compaction of that table,<a name="line.1145"></a> -<span class="sourceLineNo">1146</span> * or 0 if no such HFile could be found.<a name="line.1146"></a> -<span class="sourceLineNo">1147</span> *<a name="line.1147"></a> -<span class="sourceLineNo">1148</span> * @param tableName table to examine<a name="line.1148"></a> -<span class="sourceLineNo">1149</span> * @return the last major compaction timestamp or 0<a name="line.1149"></a> -<span class="sourceLineNo">1150</span> * @throws IOException if a remote or network exception occurs<a name="line.1150"></a> -<span class="sourceLineNo">1151</span> */<a name="line.1151"></a> -<span class="sourceLineNo">1152</span> long getLastMajorCompactionTimestamp(final TableName tableName)<a name="line.1152"></a> -<span class="sourceLineNo">1153</span> throws IOException;<a name="line.1153"></a> -<span class="sourceLineNo">1154</span><a name="line.1154"></a> -<span class="sourceLineNo">1155</span> /**<a name="line.1155"></a> -<span class="sourceLineNo">1156</span> * Get the timestamp of the last major compaction for the passed region.<a name="line.1156"></a> -<span class="sourceLineNo">1157</span> *<a name="line.1157"></a> -<span class="sourceLineNo">1158</span> * The timestamp of the oldest HFile resulting from a major compaction of that region,<a name="line.1158"></a> -<span class="sourceLineNo">1159</span> * or 0 if no such HFile could be found.<a name="line.1159"></a> -<span class="sourceLineNo">1160</span> *<a name="line.1160"></a> -<span class="sourceLineNo">1161</span> * @param regionName region to examine<a name="line.1161"></a> -<span class="sourceLineNo">1162</span> * @return the last major compaction timestamp or 0<a name="line.1162"></a> -<span class="sourceLineNo">1163</span> * @throws IOException if a remote or network exception occurs<a name="line.1163"></a> -<span class="sourceLineNo">1164</span> */<a name="line.1164"></a> -<span class="sourceLineNo">1165</span> long getLastMajorCompactionTimestampForRegion(final byte[] regionName)<a name="line.1165"></a> -<span class="sourceLineNo">1166</span> throws IOException;<a name="line.1166"></a> -<span class="sourceLineNo">1167</span><a name="line.1167"></a> -<span class="sourceLineNo">1168</span> /**<a name="line.1168"></a> -<span class="sourceLineNo">1169</span> * Take a snapshot for the given table. If the table is enabled, a FLUSH-type snapshot will be<a name="line.1169"></a> -<span class="sourceLineNo">1170</span> * taken. If the table is disabled, an offline snapshot is taken. Snapshots are considered unique<a name="line.1170"></a> -<span class="sourceLineNo">1171</span> * based on <b>the name of the snapshot</b>. Attempts to take a snapshot with the same name (even<a name="line.1171"></a> -<span class="sourceLineNo">1172</span> * a different type or with different parameters) will fail with a {@link<a name="line.1172"></a> -<span class="sourceLineNo">1173</span> * org.apache.hadoop.hbase.snapshot.SnapshotCreationException} indicating the duplicate naming.<a name="line.1173"></a> -<span class="sourceLineNo">1174</span> * Snapshot names follow the same naming constraints as tables in HBase. See {@link<a name="line.1174"></a> -<span class="sourceLineNo">1175</span> * org.apache.hadoop.hbase.TableName#isLegalFullyQualifiedTableName(byte[])}.<a name="line.1175"></a> -<span class="sourceLineNo">1176</span> *<a name="line.1176"></a> -<span class="sourceLineNo">1177</span> * @param snapshotName name of the snapshot to be created<a name="line.1177"></a> -<span class="sourceLineNo">1178</span> * @param tableName name of the table for which snapshot is created<a name="line.1178"></a> -<span class="sourceLineNo">1179</span> * @throws IOException if a remote or network exception occurs<a name="line.1179"></a> -<span class="sourceLineNo">1180</span> * @throws org.apache.hadoop.hbase.snapshot.SnapshotCreationException if snapshot creation failed<a name="line.1180"></a> -<span class="sourceLineNo">1181</span> * @throws IllegalArgumentException if the snapshot request is formatted incorrectly<a name="line.1181"></a> -<span class="sourceLineNo">1182</span> */<a name="line.1182"></a> -<span class="sourceLineNo">1183</span> void snapshot(final String snapshotName, final TableName tableName)<a name="line.1183"></a> -<span class="sourceLineNo">1184</span> throws IOException, SnapshotCreationException, IllegalArgumentException;<a name="line.1184"></a> -<span class="sourceLineNo">1185</span><a name="line.1185"></a> -<span class="sourceLineNo">1186</span> /**<a name="line.1186"></a> -<span class="sourceLineNo">1187</span> * Create a timestamp consistent snapshot for the given table. Snapshots are considered unique<a name="line.1187"></a> -<span class="sourceLineNo">1188</span> * based on <b>the name of the snapshot</b>. Attempts to take a snapshot with the same name (even<a name="line.1188"></a> -<span class="sourceLineNo">1189</span> * different type or with different parameters) will fail with a {@link SnapshotCreationException}<a name="line.1189"></a> -<span class="sourceLineNo">1190</span> * indicating the duplicate naming. Snapshot names follow the same naming constraints as tables in<a name="line.1190"></a> -<span class="sourceLineNo">1191</span> * HBase.<a name="line.1191"></a> -<span class="sourceLineNo">1192</span> *<a name="line.1192"></a> -<span class="sourceLineNo">1193</span> * @param snapshotName name of the snapshot to be created<a name="line.1193"></a> -<span class="sourceLineNo">1194</span> * @param tableName name of the table for which snapshot is created<a name="line.1194"></a> -<span class="sourceLineNo">1195</span> * @throws IOException if a remote or network exception occurs<a name="line.1195"></a> -<span class="sourceLineNo">1196</span> * @throws SnapshotCreationException if snapshot creation failed<a name="line.1196"></a> -<span class="sourceLineNo">1197</span> * @throws IllegalArgumentException if the snapshot request is formatted incorrectly<a name="line.1197"></a> -<span class="sourceLineNo">1198</span> */<a name="line.1198"></a> -<span class="sourceLineNo">1199</span> void snapshot(final byte[] snapshotName, final TableName tableName)<a name="line.1199"></a> -<span class="sourceLineNo">1200</span> throws IOException, SnapshotCreationException, IllegalArgumentException;<a name="line.1200"></a> -<span class="sourceLineNo">1201</span><a name="line.1201"></a> -<span class="sourceLineNo">1202</span> /**<a name="line.1202"></a> -<span class="sourceLineNo">1203</span> * Create typed snapshot of the table. Snapshots are considered unique based on <b>the name of the<a name="line.1203"></a> -<span class="sourceLineNo">1204</span> * snapshot</b>. Attempts to take a snapshot with the same name (even a different type or with<a name="line.1204"></a> -<span class="sourceLineNo">1205</span> * different parameters) will fail with a {@link SnapshotCreationException} indicating the<a name="line.1205"></a> -<span class="sourceLineNo">1206</span> * duplicate naming. Snapshot names follow the same naming constraints as tables in HBase. See<a name="line.1206"></a> -<span class="sourceLineNo">1207</span> * {@link org.apache.hadoop.hbase.TableName#isLegalFullyQualifiedTableName(byte[])}.<a name="line.1207"></a> -<span class="sourceLineNo">1208</span> *<a name="line.1208"></a> -<span class="sourceLineNo">1209</span> * @param snapshotName name to give the snapshot on the filesystem. Must be unique from all other<a name="line.1209"></a> -<span class="sourceLineNo">1210</span> * snapshots stored on the cluster<a name="line.1210"></a> -<span class="sourceLineNo">1211</span> * @param tableName name of the table to snapshot<a name="line.1211"></a> -<span class="sourceLineNo">1212</span> * @param type type of snapshot to take<a name="line.1212"></a> -<span class="sourceLineNo">1213</span> * @throws IOException we fail to reach the master<a name="line.1213"></a> -<span class="sourceLineNo">1214</span> * @throws SnapshotCreationException if snapshot creation failed<a name="line.1214"></a> -<span class="sourceLineNo">1215</span> * @throws IllegalArgumentException if the snapshot request is formatted incorrectly<a name="line.1215"></a> -<span class="sourceLineNo">1216</span> */<a name="line.1216"></a> -<span class="sourceLineNo">1217</span> void snapshot(final String snapshotName,<a name="line.1217"></a> -<span class="sourceLineNo">1218</span> final TableName tableName,<a name="line.1218"></a> -<span class="sourceLineNo">1219</span> HBaseProtos.SnapshotDescription.Type type) throws IOException, SnapshotCreationException,<a name="line.1219"></a> -<span class="sourceLineNo">1220</span> IllegalArgumentException;<a name="line.1220"></a> -<span class="sourceLineNo">1221</span><a name="line.1221"></a> -<span class="sourceLineNo">1222</span> /**<a name="line.1222"></a> -<span class="sourceLineNo">1223</span> * Take a snapshot and wait for the server to complete that snapshot (blocking). Only a single<a name="line.1223"></a> -<span class="sourceLineNo">1224</span> * snapshot should be taken at a time for an instance of HBase, or results may be undefined (you<a name="line.1224"></a> -<span class="sourceLineNo">1225</span> * can tell multiple HBase clusters to snapshot at the same time, but only one at a time for a<a name="line.1225"></a> -<span class="sourceLineNo">1226</span> * single cluster). Snapshots are considered unique based on <b>the name of the snapshot</b>.<a name="line.1226"></a> -<span class="sourceLineNo">1227</span> * Attempts to take a snapshot with the same name (even a different type or with different<a name="line.1227"></a> -<span class="sourceLineNo">1228</span> * parameters) will fail with a {@link SnapshotCreationException} indicating the duplicate naming.<a name="line.1228"></a> -<span class="sourceLineNo">1229</span> * Snapshot names follow the same naming constraints as tables in HBase. See {@link<a name="line.1229"></a> -<span class="sourceLineNo">1230</span> * org.apache.hadoop.hbase.TableName#isLegalFullyQualifiedTableName(byte[])}. You should probably<a name="line.1230"></a> -<span class="sourceLineNo">1231</span> * use {@link #snapshot(String, org.apache.hadoop.hbase.TableName)} or<a name="line.1231"></a> -<span class="sourceLineNo">1232</span> * {@link #snapshot(byte[], org.apache.hadoop.hbase.TableName)} unless you are sure about the type<a name="line.1232"></a> -<span class="sourceLineNo">1233</span> * of snapshot that you want to take.<a name="line.1233"></a> -<span class="sourceLineNo">1234</span> *<a name="line.1234"></a> -<span class="sourceLineNo">1235</span> * @param snapshot snapshot to take<a name="line.1235"></a> -<span class="sourceLineNo">1236</span> * @throws IOException or we lose contact with the master.<a name="line.1236"></a> -<span class="sourceLineNo">1237</span> * @throws SnapshotCreationException if snapshot failed to be taken<a name="line.1237"></a> -<span class="sourceLineNo">1238</span> * @throws IllegalArgumentException if the snapshot request is formatted incorrectly<a name="line.1238"></a> -<span class="sourceLineNo">1239</span> */<a name="line.1239"></a> -<span class="sourceLineNo">1240</span> void snapshot(HBaseProtos.SnapshotDescription snapshot)<a name="line.1240"></a> -<span class="sourceLineNo">1241</span> throws IOException, SnapshotCreationException, IllegalArgumentException;<a name="line.1241"></a> -<span class="sourceLineNo">1242</span><a name="line.1242"></a> -<span class="sourceLineNo">1243</span> /**<a name="line.1243"></a> -<span class="sourceLineNo">1244</span> * Take a snapshot without waiting for the server to complete that snapshot (asynchronous) Only a<a name="line.1244"></a> -<span class="sourceLineNo">1245</span> * single snapshot should be taken at a time, or results may be undefined.<a name="line.1245"></a> -<span class="sourceLineNo">1246</span> *<a name="line.1246"></a> -<span class="sourceLineNo">1247</span> * @param snapshot snapshot to take<a name="line.1247"></a> -<span class="sourceLineNo">1248</span> * @return response from the server indicating the max time to wait for the snapshot<a name="line.1248"></a> -<span class="sourceLineNo">1249</span> * @throws IOException if the snapshot did not succeed or we lose contact with the master.<a name="line.1249"></a> -<span class="sourceLineNo">1250</span> * @throws SnapshotCreationException if snapshot creation failed<a name="line.1250"></a> -<span class="sourceLineNo">1251</span> * @throws IllegalArgumentException if the snapshot request is formatted incorrectly<a name="line.1251"></a> -<span class="sourceLineNo">1252</span> */<a name="line.1252"></a> -<span class="sourceLineNo">1253</span> MasterProtos.SnapshotResponse takeSnapshotAsync(HBaseProtos.SnapshotDescription snapshot)<a name="line.1253"></a> -<span class="sourceLineNo">1254</span> throws IOException, SnapshotCreationException;<a name="line.1254"></a> -<span class="sourceLineNo">1255</span><a name="line.1255"></a> -<span class="sourceLineNo">1256</span> /**<a name="line.1256"></a> -<span class="sourceLineNo">1257</span> * Check the current state of the passed snapshot. There are three possible states: <ol><a name="line.1257"></a> -<span class="sourceLineNo">1258</span> * <li>running - returns <tt>false</tt></li> <li>finished - returns <tt>true</tt></li><a name="line.1258"></a> -<span class="sourceLineNo">1259</span> * <li>finished with error - throws the exception that caused the snapshot to fail</li> </ol> The<a name="line.1259"></a> -<span class="sourceLineNo">1260</span> * cluster only knows about the most recent snapshot. Therefore, if another snapshot has been<a name="line.1260"></a> -<span class="sourceLineNo">1261</span> * run/started since the snapshot your are checking, you will recieve an {@link<a name="line.1261"></a> -<span class="sourceLineNo">1262</span> * org.apache.hadoop.hbase.snapshot.UnknownSnapshotException}.<a name="line.1262"></a> -<span class="sourceLineNo">1263</span> *<a name="line.1263"></a> -<span class="sourceLineNo">1264</span> * @param snapshot description of the snapshot to check<a name="line.1264"></a> -<span class="sourceLineNo">1265</span> * @return <tt>true</tt> if the snapshot is completed, <tt>false</tt> if the snapshot is still<a name="line.1265"></a> -<span class="sourceLineNo">1266</span> * running<a name="line.1266"></a> -<span class="sourceLineNo">1267</span> * @throws IOException if we have a network issue<a name="line.1267"></a> -<span class="sourceLineNo">1268</span> * @throws org.apache.hadoop.hbase.snapshot.HBaseSnapshotException if the snapshot failed<a name="line.1268"></a> -<span class="sourceLineNo">1269</span> * @throws org.apache.hadoop.hbase.snapshot.UnknownSnapshotException if the requested snapshot is<a name="line.1269"></a> -<span class="sourceLineNo">1270</span> * unknown<a name="line.1270"></a> -<span class="sourceLineNo">1271</span> */<a name="line.1271"></a> -<span class="sourceLineNo">1272</span> boolean isSnapshotFinished(final HBaseProtos.SnapshotDescription snapshot)<a name="line.1272"></a> -<span class="sourceLineNo">1273</span> throws IOException, HBaseSnapshotException, UnknownSnapshotException;<a name="line.1273"></a> -<span class="sourceLineNo">1274</span><a name="line.1274"></a> -<span class="sourceLineNo">1275</span> /**<a name="line.1275"></a> -<span class="sourceLineNo">1276</span> * Restore the specified snapshot on the original table. (The table must be disabled) If the<a name="line.1276"></a> -<span class="sourceLineNo">1277</span> * "hbase.snapshot.restore.take.failsafe.snapshot" configuration property is set to true, a<a name="line.1277"></a> -<span class="sourceLineNo">1278</span> * snapshot of the current table is taken before executing the restore operation. In case of<a name="line.1278"></a> -<span class="sourceLineNo">1279</span> * restore failure, the failsafe snapshot will be restored. If the restore completes without<a name="line.1279"></a> -<span class="sourceLineNo">1280</span> * problem the failsafe snapshot is deleted.<a name="line.1280"></a> -<span class="sourceLineNo">1281</span> *<a name="line.1281"></a> -<span class="sourceLineNo">1282</span> * @param snapshotName name of the snapshot to restore<a name="line.1282"></a> -<span class="sourceLineNo">1283</span> * @throws IOException if a remote or network exception occurs<a name="line.1283"></a> -<span class="sourceLineNo">1284</span> * @throws org.apache.hadoop.hbase.snapshot.RestoreSnapshotException if snapshot failed to be<a name="line.1284"></a> -<span class="sourceLineNo">1285</span> * restored<a name="line.1285"></a> -<span class="sourceLineNo">1286</span> * @throws IllegalArgumentException if the restore request is formatted incorrectly<a name="line.1286"></a> -<span class="sourceLineNo">1287</span> */<a name="line.1287"></a> -<span class="sourceLineNo">1288</span> void restoreSnapshot(final byte[] snapshotName) throws IOException, RestoreSnapshotException;<a name="line.1288"></a> -<span class="sourceLineNo">1289</span><a name="line.1289"></a> -<span class="sourceLineNo">1290</span> /**<a name="line.1290"></a> -<span class="sourceLineNo">1291</span> * Restore the specified snapshot on the original table. (The table must be disabled) If the<a name="line.1291"></a> -<span class="sourceLineNo">1292</span> * "hbase.snapshot.restore.take.failsafe.snapshot" configuration property is set to true, a<a name="line.1292"></a> -<span class="sourceLineNo">1293</span> * snapshot of the current table is taken before executing the restore operation. In case of<a name="line.1293"></a> -<span class="sourceLineNo">1294</span> * restore failure, the failsafe snapshot will be restored. If the restore completes without<a name="line.1294"></a> -<span class="sourceLineNo">1295</span> * problem the failsafe snapshot is deleted.<a name="line.1295"></a> -<span class="sourceLineNo">1296</span> *<a name="line.1296"></a> -<span class="sourceLineNo">1297</span> * @param snapshotName name of the snapshot to restore<a name="line.1297"></a> -<span class="sourceLineNo">1298</span> * @throws IOException if a remote or network exception occurs<a name="line.1298"></a> -<span class="sourceLineNo">1299</span> * @throws RestoreSnapshotException if snapshot failed to be restored<a name="line.1299"></a> -<span class="sourceLineNo">1300</span> * @throws IllegalArgumentException if the restore request is formatted incorrectly<a name="line.1300"></a> -<span class="sourceLineNo">1301</span> */<a name="line.1301"></a> -<span class="sourceLineNo">1302</span> void restoreSnapshot(final String snapshotName) throws IOException, RestoreSnapshotException;<a name="line.1302"></a> -<span class="sourceLineNo">1303</span><a name="line.1303"></a> -<span class="sourceLineNo">1304</span> /**<a name="line.1304"></a> -<span class="sourceLineNo">1305</span> * Restore the specified snapshot on the original table. (The table must be disabled) If<a name="line.1305"></a> -<span class="sourceLineNo">1306</span> * 'takeFailSafeSnapshot' is set to true, a snapshot of the current table is taken before<a name="line.1306"></a> -<span class="sourceLineNo">1307</span> * executing the restore operation. In case of restore failure, the failsafe snapshot will be<a name="line.1307"></a> -<span class="sourceLineNo">1308</span> * restored. If the restore completes without problem the failsafe snapshot is deleted. The<a name="line.1308"></a> -<span class="sourceLineNo">1309</span> * failsafe snapshot name is configurable by using the property<a name="line.1309"></a> -<span class="sourceLineNo">1310</span> * "hbase.snapshot.restore.failsafe.name".<a name="line.1310"></a> -<span class="sourceLineNo">1311</span> *<a name="line.1311"></a> -<span class="sourceLineNo">1312</span> * @param snapshotName name of the snapshot to restore<a name="line.1312"></a> -<span class="sourceLineNo">1313</span> * @param takeFailSafeSnapshot true if the failsafe snapshot should be taken<a name="line.1313"></a> -<span class="sourceLineNo">1314</span> * @throws IOException if a remote or network exception occurs<a name="line.1314"></a> -<span class="sourceLineNo">1315</span> * @throws RestoreSnapshotException if snapshot failed to be restored<a name="line.1315"></a> -<span class="sourceLineNo">1316</span> * @throws IllegalArgumentException if the restore request is formatted incorrectly<a name="line.1316"></a> -<span class="sourceLineNo">1317</span> */<a name="line.1317"></a> -<span class="sourceLineNo">1318</span> void restoreSnapshot(final byte[] snapshotName, final boolean takeFailSafeSnapshot)<a name="line.1318"></a> -<span class="sourceLineNo">1319</span> throws IOException, RestoreSnapshotException;<a name="line.1319"></a> -<span class="sourceLineNo">1320</span><a name="line.1320"></a> -<span class="sourceLineNo">1321</span> /**<a name="line.1321"></a> -<span class="sourceLineNo">1322</span> * Restore the specified snapshot on the original table. (The table must be disabled) If<a name="line.1322"></a> -<span class="sourceLineNo">1323</span> * 'takeFailSafeSnapshot' is set to true, a snapshot of the current table is taken before<a name="line.1323"></a> -<span class="sourceLineNo">1324</span> * executing the restore operation. In case of restore failure, the failsafe snapshot will be<a name="line.1324"></a> -<span class="sourceLineNo">1325</span> * restored. If the restore completes without problem the failsafe snapshot is deleted. The<a name="line.1325"></a> -<span class="sourceLineNo">1326</span> * failsafe snapshot name is configurable by using the property<a name="line.1326"></a> -<span class="sourceLineNo">1327</span> * "hbase.snapshot.restore.failsafe.name".<a name="line.1327"></a> -<span class="sourceLineNo">1328</span> *<a name="line.1328"></a> -<span class="sourceLineNo">1329</span> * @param snapshotName name of the snapshot to restore<a name="line.1329"></a> -<span class="sourceLineNo">1330</span> * @param takeFailSafeSnapshot true if the failsafe snapshot should be taken<a name="line.1330"></a> -<span class="sourceLineNo">1331</span> * @throws IOException if a remote or network exception occurs<a name="line.1331"></a> -<span class="sourceLineNo">1332</span> * @throws RestoreSnapshotException if snapshot failed to be restored<a name="line.1332"></a> -<span class="sourceLineNo">1333</span> * @throws IllegalArgumentException if the restore request is formatted incorrectly<a name="line.1333"></a> -<span class="sourceLineNo">1334</span> */<a name="line.1334"></a> -<span class="sourceLineNo">1335</span> void restoreSnapshot(final String snapshotName, boolean takeFailSafeSnapshot)<a name="line.1335"></a> -<span class="sourceLineNo">1336</span> throws IOException, RestoreSnapshotException;<a name="line.1336"></a> -<span class="sourceLineNo">1337</span><a name="line.1337"></a> -<span class="sourceLineNo">1338</span> /**<a name="line.1338"></a> -<span class="sourceLineNo">1339</span> * Create a new table by cloning the snapshot content.<a name="line.1339"></a> -<span class="sourceLineNo">1340</span> *<a name="line.1340"></a> -<span class="sourceLineNo">1341</span> * @param snapshotName name of the snapshot to be cloned<a name="line.1341"></a> -<span class="sourceLineNo">1342</span> * @param tableName name of the table where the snapshot will be restored<a name="line.1342"></a> -<span class="sourceLineNo">1343</span> * @throws IOException if a remote or network exception occurs<a name="line.1343"></a> -<span class="sourceLineNo">1344</span> * @throws TableExistsException if table to be created already exists<a name="line.1344"></a> -<span class="sourceLineNo">1345</span> * @throws RestoreSnapshotException if snapshot failed to be cloned<a name="line.1345"></a> -<span class="sourceLineNo">1346</span> * @throws IllegalArgumentException if the specified table has not a valid name<a name="line.1346"></a> -<span class="sourceLineNo">1347</span> */<a name="line.1347"></a> -<span class="sourceLineNo">1348</span> void cloneSnapshot(final byte[] snapshotName, final TableName tableName)<a name="line.1348"></a> -<span class="sourceLineNo">1349</span> throws IOException, TableExistsException, RestoreSnapshotException;<a name="line.1349"></a> -<span class="sourceLineNo">1350</span><a name="line.1350"></a> -<span class="sourceLineNo">1351</span> /**<a name="line.1351"></a> -<span class="sourceLineNo">1352</span> * Create a new table by cloning the snapshot content.<a name="line.1352"></a> -<span class="sourceLineNo">1353</span> *<a name="line.1353"></a> -<span class="sourceLineNo">1354</span> * @param snapshotName name of the snapshot to be cloned<a name="line.1354"></a> -<span class="sourceLineNo">1355</span> * @param tableName name of the table where the snapshot will be restored<a name="line.1355"></a> -<span class="sourceLineNo">1356</span> * @throws IOException if a remote or network exception occurs<a name="line.1356"></a> -<span class="sourceLineNo">1357</span> * @throws TableExistsException if table to be created already exists<a name="line.1357"></a> -<span class="sourceLineNo">1358</span> * @throws RestoreSnapshotException if snapshot failed to be cloned<a name="line.1358"></a> -<span class="sourceLineNo">1359</span> * @throws IllegalArgumentException if the specified table has not a valid name<a name="line.1359"></a> -<span class="sourceLineNo">1360</span> */<a name="line.1360"></a> -<span class="sourceLineNo">1361</span> void cloneSnapshot(final String snapshotName, final TableName tableName)<a name="line.1361"></a> -<span class="sourceLineNo">1362</span> throws IOException, TableExistsException, RestoreSnapshotException;<a name="line.1362"></a> -<span class="sourceLineNo">1363</span><a name="line.1363"></a> -<span class="sourceLineNo">1364</span> /**<a name="line.1364"></a> -<span class="sourceLineNo">1365</span> * Execute a distributed procedure on a cluster.<a name="line.1365"></a> -<span class="sourceLineNo">1366</span> *<a name="line.1366"></a> -<span class="sourceLineNo">1367</span> * @param signature A distributed procedure is uniquely identified by its signature (default the<a name="line.1367"></a> -<span class="sourceLineNo">1368</span> * root ZK node name of the procedure).<a name="line.1368"></a> -<span class="sourceLineNo">1369</span> * @param instance The instance name of the procedure. For some procedures, this parameter is<a name="line.1369"></a> -<span class="sourceLineNo">1370</span> * optional.<a name="line.1370"></a> -<span class="sourceLineNo">1371</span> * @param props Property/Value pairs of properties passing to the procedure<a name="line.1371"></a> -<span class="sourceLineNo">1372</span> * @throws IOException<a name="line.1372"></a> -<span class="sourceLineNo">1373</span> */<a name="line.1373"></a> -<span class="sourceLineNo">1374</span> void execProcedure(String signature, String instance, Map<String, String> props)<a name="line.1374"></a> -<span class="sourceLineNo">1375</span> throws IOException;<a name="line.1375"></a> -<span class="sourceLineNo">1376</span><a name="line.1376"></a> -<span class="sourceLineNo">1377</span> /**<a name="line.1377"></a> -<span class="sourceLineNo">1378</span> * Execute a distributed procedure on a cluster.<a name="line.1378"></a> -<span class="sourceLineNo">1379</span> *<a name="line.1379"></a> -<span class="sourceLineNo">1380</span> * @param signature A distributed procedure is uniquely identified by its signature (default the<a name="line.1380"></a> -<span class="sourceLineNo">1381</span> * root ZK node name of the procedure).<a name="line.1381"></a> -<span class="sourceLineNo">1382</span> * @param instance The instance name of the procedure. For some procedures, this parameter is<a name="line.1382"></a> -<span class="sourceLineNo">1383</span> * optional.<a name="line.1383"></a> -<span class="sourceLineNo">1384</span> * @param props Property/Value pairs of properties passing to the procedure<a name="line.1384"></a> -<span class="sourceLineNo">1385</span> * @return data returned after procedure execution. null if no return data.<a name="line.1385"></a> -<span class="sourceLineNo">1386</span> * @throws IOException<a name="line.1386"></a> -<span class="sourceLineNo">1387</span> */<a name="line.1387"></a> -<span class="sourceLineNo">1388</span> byte[] execProcedureWithRet(String signature, String instance, Map<String, String> props)<a name="line.1388"></a> -<span class="sourceLineNo">1389</span> throws IOException;<a name="line.1389"></a> -<span class="sourceLineNo">1390</span><a name="line.1390"></a> -<span class="sourceLineNo">1391</span> /**<a name="line.1391"></a> -<span class="sourceLineNo">1392</span> * Check the current state of the specified procedure. There are three possible states: <ol><a name="line.1392"></a> -<span class="sourceLineNo">1393</span> * <li>running - returns <tt>false</tt></li> <li>finished - returns <tt>true</tt></li><a name="line.1393"></a> -<span class="sourceLineNo">1394</span> * <li>finished with error - throws the exception that caused the procedure to fail</li> </ol><a name="line.1394"></a> -<span class="sourceLineNo">1395</span> *<a name="line.1395"></a> -<span class="sourceLineNo">1396</span> * @param signature The signature that uniquely identifies a procedure<a name="line.1396"></a> -<span class="sourceLineNo">1397</span> * @param instance The instance name of the procedure<a name="line.1397"></a> -<span class="sourceLineNo">1398</span> * @param props Property/Value pairs of properties passing to the procedure<a name="line.1398"></a> -<span class="sourceLineNo">1399</span> * @return true if the specified procedure is finished successfully, false if it is still running<a name="line.1399"></a> -<span class="sourceLineNo">1400</span> * @throws IOException if the specified procedure finished with error<a name="line.1400"></a> +<span class="sourceLineNo">1139</span> void rollWALWriter(ServerName serverName) throws IOException, FailedLogCloseException;<a name="line.1139"></a> +<span class="sourceLineNo">1140</span><a name="line.1140"></a> +<span class="sourceLineNo">1141</span> /**<a name="line.1141"></a> +<span class="sourceLineNo">1142</span> * Helper delegage to getClusterStatus().getMasterCoprocessors().<a name="line.1142"></a> +<span class="sourceLineNo">1143</span> * @return an array of master coprocessors<a name="line.1143"></a> +<span class="sourceLineNo">1144</span> * @see org.apache.hadoop.hbase.ClusterStatus#getMasterCoprocessors()<a name="line.1144"></a> +<span class="sourceLineNo">1145</span> */<a name="line.1145"></a> +<span class="sourceLineNo">1146</span> String[] getMasterCoprocessors() throws IOException;<a name="line.1146"></a> +<span class="sourceLineNo">1147</span><a name="line.1147"></a> +<span class="sourceLineNo">1148</span> /**<a name="line.1148"></a> +<span class="sourceLineNo">1149</span> * Get the current compaction state of a table. It could be in a major compaction, a minor<a name="line.1149"></a> +<span class="sourceLineNo">1150</span> * compaction, both, or none.<a name="line.1150"></a> +<span class="sourceLineNo">1151</span> *<a name="line.1151"></a> +<span class="sourceLineNo">1152</span> * @param tableName table to examine<a name="line.1152"></a> +<span class="sourceLineNo">1153</span> * @return the current compaction state<a name="line.1153"></a> +<span class="sourceLineNo">1154</span> * @throws IOException if a remote or network exception occurs<a name="line.1154"></a> +<span class="sourceLineNo">1155</span> */<a name="line.1155"></a> +<span class="sourceLineNo">1156</span> AdminProtos.GetRegionInfoResponse.CompactionState getCompactionState(final TableName tableName)<a name="line.1156"></a> +<span class="sourceLineNo">1157</span> throws IOException;<a name="line.1157"></a> +<span class="sourceLineNo">1158</span><a name="line.1158"></a> +<span class="sourceLineNo">1159</span> /**<a name="line.1159"></a> +<span class="sourceLineNo">1160</span> * Get the current compaction state of region. It could be in a major compaction, a minor<a name="line.1160"></a> +<span class="sourceLineNo">1161</span> * compaction, both, or none.<a name="line.1161"></a> +<span class="sourceLineNo">1162</span> *<a name="line.1162"></a> +<span class="sourceLineNo">1163</span> * @param regionName region to examine<a name="line.1163"></a> +<span class="sourceLineNo">1164</span> * @return the current compaction state<a name="line.1164"></a> +<span class="sourceLineNo">1165</span> * @throws IOException if a remote or network exception occurs<a name="line.1165"></a> +<span class="sourceLineNo">1166</span> */<a name="line.1166"></a> +<span class="sourceLineNo">1167</span> AdminProtos.GetRegionInfoResponse.CompactionState getCompactionStateForRegion(<a name="line.1167"></a> +<span class="sourceLineNo">1168</span> final byte[] regionName) throws IOException;<a name="line.1168"></a> +<span class="sourceLineNo">1169</span><a name="line.1169"></a> +<span class="sourceLineNo">1170</span> /**<a name="line.1170"></a> +<span class="sourceLineNo">1171</span> * Get the timestamp of the last major compaction for the passed table<a name="line.1171"></a> +<span class="sourceLineNo">1172</span> *<a name="line.1172"></a> +<span class="sourceLineNo">1173</span> * The timestamp of the oldest HFile resulting from a major compaction of that table,<a name="line.1173"></a> +<span class="sourceLineNo">1174</span> * or 0 if no such HFile could be found.<a name="line.1174"></a> +<span class="sourceLineNo">1175</span> *<a name="line.1175"></a> +<span class="sourceLineNo">1176</span> * @param tableName table to examine<a name="line.1176"></a> +<span class="sourceLineNo">1177</span> * @return the last major compaction timestamp or 0<a name="line.1177"></a> +<span class="sourceLineNo">1178</span> * @throws IOException if a remote or network exception occurs<a name="line.1178"></a> +<span class="sourceLineNo">1179</span> */<a name="line.1179"></a> +<span class="sourceLineNo">1180</span> long getLastMajorCompactionTimestamp(final TableName tableName)<a name="line.1180"></a> +<span class="sourceLineNo">1181</span> throws IOException;<a name="line.1181"></a> +<span class="sourceLineNo">1182</span><a name="line.1182"></a> +<span class="sourceLineNo">1183</span> /**<a name="line.1183"></a> +<span class="sourceLineNo">1184</span> * Get the timestamp of the last major compaction for the passed region.<a name="line.1184"></a> +<span class="sourceLineNo">1185</span> *<a name="line.1185"></a> +<span class="sourceLineNo">1186</span> * The timestamp of the oldest HFile resulting from a major compaction of that region,<a name="line.1186"></a> +<span class="sourceLineNo">1187</span> * or 0 if no such HFile could be found.<a name="line.1187"></a> +<span class="sourceLineNo">1188</span> *<a name="line.1188"></a> +<span class="sourceLineNo">1189</span> * @param regionName region to examine<a name="line.1189"></a> +<span class="sourceLineNo">1190</span> * @return the last major compaction timestamp or 0<a name="line.1190"></a> +<span class="sourceLineNo">1191</span> * @throws IOException if a remote or network exception occurs<a name="line.1191"></a> +<span class="sourceLineNo">1192</span> */<a name="line.1192"></a> +<span class="sourceLineNo">1193</span> long getLastMajorCompactionTimestampForRegion(final byte[] regionName)<a name="line.1193"></a> +<span class="sourceLineNo">1194</span> throws IOException;<a name="line.1194"></a> +<span class="sourceLineNo">1195</span><a name="line.1195"></a> +<span class="sourceLineNo">1196</span> /**<a name="line.1196"></a> +<span class="sourceLineNo">1197</span> * Take a snapshot for the given table. If the table is enabled, a FLUSH-type snapshot will be<a name="line.1197"></a> +<span class="sourceLineNo">1198</span> * taken. If the table is disabled, an offline snapshot is taken. Snapshots are considered unique<a name="line.1198"></a> +<span class="sourceLineNo">1199</span> * based on <b>the name of the snapshot</b>. Attempts to take a snapshot with the same name (even<a name="line.1199"></a> +<span class="sourceLineNo">1200</span> * a different type or with different parameters) will fail with a {@link<a name="line.1200"></a> +<span class="sourceLineNo">1201</span> * org.apache.hadoop.hbase.snapshot.SnapshotCreationException} indicating the duplicate naming.<a name="line.1201"></a> +<span class="sourceLineNo">1202</span> * Snapshot names follow the same naming constraints as tables in HBase. See {@link<a name="line.1202"></a> +<span class="sourceLineNo">1203</span> * org.apache.hadoop.hbase.TableName#isLegalFullyQualifiedTableName(byte[])}.<a name="line.1203"></a> +<span class="sourceLineNo">1204</span> *<a name="line.1204"></a> +<span class="sourceLineNo">1205</span> * @param snapshotName name of the snapshot to be created<a name="line.1205"></a> +<span class="sourceLineNo">1206</span> * @param tableName name of the table for which snapshot is created<a name="line.1206"></a> +<span class="sourceLineNo">1207</span> * @throws IOException if a remote or network exception occurs<a name="line.1207"></a> +<span class="sourceLineNo">1208</span> * @throws org.apache.hadoop.hbase.snapshot.SnapshotCreationException if snapshot creation failed<a name="line.1208"></a> +<span class="sourceLineNo">1209</span> * @throws IllegalArgumentException if the snapshot request is formatted incorrectly<a name="line.1209"></a> +<span class="sourceLineNo">1210</span> */<a name="line.1210"></a> +<span class="sourceLineNo">1211</span> void snapshot(final String snapshotName, final TableName tableName)<a name="line.1211"></a> +<span class="sourceLineNo">1212</span> throws IOException, SnapshotCreationException, IllegalArgumentException;<a name="line.1212"></a> +<span class="sourceLineNo">1213</span><a name="line.1213"></a> +<span class="sourceLineNo">1214</span> /**<a name="line.1214"></a> +<span class="sourceLineNo">1215</span> * Create a timestamp consistent snapshot for the given table. Snapshots are considered unique<a name="line.1215"></a> +<span class="sourceLineNo">1216</span> * based on <b>the name of the snapshot</b>. Attempts to take a snapshot with the same name (even<a name="line.1216"></a> +<span class="sourceLineNo">1217</span> * different type or with different parameters) will fail with a {@link SnapshotCreationException}<a name="line.1217"></a> +<span class="sourceLineNo">1218</span> * indicating the duplicate naming. Snapshot names follow the same naming constraints as tables in<a name="line.1218"></a> +<span class="sourceLineNo">1219</span> * HBase.<a name="line.1219"></a> +<span class="sourceLineNo">1220</span> *<a name="line.1220"></a> +<span class="sourceLineNo">1221</span> * @param snapshotName name of the snapshot to be created<a name="line.1221"></a> +<span class="sourceLineNo">1222</span> * @param tableName name of the table for which snapshot is created<a name="line.1222"></a> +<span class="sourceLineNo">1223</span> * @throws IOException if a remote or network exception occurs<a name="line.1223"></a> +<span class="sourceLineNo">1224</span> * @throws SnapshotCreationException if snapshot creation failed<a name="line.1224"></a> +<span class="sourceLineNo">1225</span> * @throws IllegalArgumentException if the snapshot request is formatted incorrectly<a name="line.1225"></a> +<span class="sourceLineNo">1226</span> */<a name="line.1226"></a> +<span class="sourceLineNo">1227</span> void snapshot(final byte[] snapshotName, final TableName tableName)<a name="line.1227"></a> +<span class="sourceLineNo">1228</span> throws IOException, SnapshotCreationException, IllegalArgumentException;<a name="line.1228"></a> +<span class="sourceLineNo">1229</span><a name="line.1229"></a> +<span class="sourceLineNo">1230</span> /**<a name="line.1230"></a> +<span class="sourceLineNo">1231</span> * Create typed snapshot of the table. Snapshots are considered unique based on <b>the name of the<a name="line.1231"></a> +<span class="sourceLineNo">1232</span> * snapshot</b>. Attempts to take a snapshot with the same name (even a different type or with<a name="line.1232"></a> +<span class="sourceLineNo">1233</span> * different parameters) will fail with a {@link SnapshotCreationException} indicating the<a name="line.1233"></a> +<span class="sourceLineNo">1234</span> * duplicate naming. Snapshot names follow the same naming constraints as tables in HBase. See<a name="line.1234"></a> +<span class="sourceLineNo">1235</span> * {@link org.apache.hadoop.hbase.TableName#isLegalFullyQualifiedTableName(byte[])}.<a name="line.1235"></a> +<span class="sourceLineNo">1236</span> *<a name="line.1236"></a> +<span class="sourceLineNo">1237</span> * @param snapshotName name to give the snapshot on the filesystem. Must be unique from all other<a name="line.1237"></a> +<span class="sourceLineNo">1238</span> * snapshots stored on the cluster<a name="line.1238"></a> +<span class="sourceLineNo">1239</span> * @param tableName name of the table to snapshot<a name="line.1239"></a> +<span class="sourceLineNo">1240</span> * @param type type of snapshot to take<a name="line.1240"></a> +<span class="sourceLineNo">1241</span> * @throws IOException we fail to reach the master<a name="line.1241"></a> +<span class="sourceLineNo">1242</span> * @throws SnapshotCreationException if snapshot creation failed<a name="line.1242"></a> +<span class="sourceLineNo">1243</span> * @throws IllegalArgumentException if the snapshot request is formatted incorrectly<a name="line.1243"></a> +<span class="sourceLineNo">1244</span> */<a name="line.1244"></a> +<span class="sourceLineNo">1245</span> void snapshot(final String snapshotName,<a name="line.1245"></a> +<span class="sourceLineNo">1246</span> final TableName tableName,<a name="line.1246"></a> +<span class="sourceLineNo">1247</span> HBaseProtos.SnapshotDescription.Type type) throws IOException, SnapshotCreationException,<a name="line.1247"></a> +<span class="sourceLineNo">1248</span> IllegalArgumentException;<a name="line.1248"></a> +<span class="sourceLineNo">1249</span><a name="line.1249"></a> +<span class="sourceLineNo">1250</span> /**<a name="line.1250"></a> +<span class="sourceLineNo">1251</span> * Take a snapshot and wait for the server to complete that snapshot (blocking). Only a single<a name="line.1251"></a> +<span class="sourceLineNo">1252</span> * snapshot should be taken at a time for an instance of HBase, or results may be undefined (you<a name="line.1252"></a> +<span class="sourceLineNo">1253</span> * can tell multiple HBase clusters to snapshot at the same time, but only one at a time for a<a name="line.1253"></a> +<span class="sourceLineNo">1254</span> * single cluster). Snapshots are considered unique based on <b>the name of the snapshot</b>.<a name="line.1254"></a> +<span class="sourceLineNo">1255</span> * Attempts to take a snapshot with the same name (even a different type or with different<a name="line.1255"></a> +<span class="sourceLineNo">1256</span> * parameters) will fail with a {@link SnapshotCreationException} indicating the duplicate naming.<a name="line.1256"></a> +<span class="sourceLineNo">1257</span> * Snapshot names follow the same naming constraints as tables in HBase. See {@link<a name="line.1257"></a> +<span class="sourceLineNo">1258</span> * org.apache.hadoop.hbase.TableName#isLegalFullyQualifiedTableName(byte[])}. You should probably<a name="line.1258"></a> +<span class="sourceLineNo">1259</span> * use {@link #snapshot(String, org.apache.hadoop.hbase.TableName)} or<a name="line.1259"></a> +<span class="sourceLineNo">1260</span> * {@link #snapshot(byte[], org.apache.hadoop.hbase.TableName)} unless you are sure about the type<a name="line.1260"></a> +<span class="sourceLineNo">1261</span> * of snapshot that you want to take.<a name="line.1261"></a> +<span class="sourceLineNo">1262</span> *<a name="line.1262"></a> +<span class="sourceLineNo">1263</span> * @param snapshot snapshot to take<a name="line.1263"></a> +<span class="sourceLineNo">1264</span> * @throws IOException or we lose contact with the master.<a name="line.1264"></a> +<span class="sourceLineNo">1265</span> * @throws SnapshotCreationException if snapshot failed to be taken<a name="line.1265"></a> +<span class="sourceLineNo">1266</span> * @throws IllegalArgumentException if the snapshot request is formatted incorrectly<a name="line.1266"></a> +<span class="sourceLineNo">1267</span> */<a name="line.1267"></a> +<span class="sourceLineNo">1268</span> void snapshot(HBaseProtos.SnapshotDescription snapshot)<a name="line.1268"></a> +<span class="sourceLineNo">1269</span> throws IOException, SnapshotCreationException, IllegalArgumentException;<a name="line.1269"></a> +<span class="sourceLineNo">1270</span><a name="line.1270"></a> +<span class="sourceLineNo">1271</span> /**<a name="line.1271"></a> +<span class="sourceLineNo">1272</span> * Take a snapshot without waiting for the server to complete that snapshot (asynchronous) Only a<a name="line.1272"></a> +<span class="sourceLineNo">1273</span> * single snapshot should be taken at a time, or results may be undefined.<a name="line.1273"></a> +<span class="sourceLineNo">1274</span> *<a name="line.1274"></a> +<span class="sourceLineNo">1275</span> * @param snapshot snapshot to take<a name="line.1275"></a> +<span class="sourceLineNo">1276</span> * @return response from the server indicating the max time to wait for the snapshot<a name="line.1276"></a> +<span class="sourceLineNo">1277</span> * @throws IOException if the snapshot did not succeed or we lose contact with the master.<a name="line.1277"></a> +<span class="sourceLineNo">1278</span> * @throws SnapshotCreationException if snapshot creation failed<a name="line.1278"></a> +<span class="sourceLineNo">1279</span> * @throws IllegalArgumentException if the snapshot request is formatted incorrectly<a name="line.1279"></a> +<span class="sourceLineNo">1280</span> */<a name="line.1280"></a> +<span class="sourceLineNo">1281</span> MasterProtos.SnapshotResponse takeSnapshotAsync(HBaseProtos.SnapshotDescription snapshot)<a name="line.1281"></a> +<span class="sourceLineNo">1282</span> throws IOException, SnapshotCreationException;<a name="line.1282"></a> +<span class="sourceLineNo">1283</span><a name="line.1283"></a> +<span class="sourceLineNo">1284</span> /**<a name="line.1284"></a> +<span class="sourceLineNo">1285</span> * Check the current state of the passed snapshot. There are three possible states: <ol><a name="line.1285"></a> +<span class="sourceLineNo">1286</span> * <li>running - returns <tt>false</tt></li> <li>finished - returns <tt>true</tt></li><a name="line.1286"></a> +<span class="sourceLineNo">1287</span> * <li>finished with error - throws the exception that caused the snapshot to fail</li> </ol> The<a name="line.1287"></a> +<span class="sourceLineNo">1288</span> * cluster only knows about the most recent snapshot. Therefore, if another snapshot has been<a name="line.1288"></a> +<span class="sourceLineNo">1289</span> * run/started since the snapshot your are checking, you will recieve an {@link<a name="line.1289"></a> +<span class="sourceLineNo">1290</span> * org.apache.hadoop.hbase.snapshot.UnknownSnapshotException}.<a name="line.1290"></a> +<span class="sourceLineNo">1291</span> *<a name="line.1291"></a> +<span class="sourceLineNo">1292</span> * @param snapshot description of the snapshot to check<a name="line.1292"></a> +<span class="sourceLineNo">1293</span> * @return <tt>true</tt> if the snapshot is completed, <tt>false</tt> if the snapshot is still<a name="line.1293"></a> +<span class="sourceLineNo">1294</span> * running<a name="line.1294"></a> +<span class="sourceLineNo">1295</span> * @throws IOException if we have a network issue<a name="line.1295"></a> +<span class="sourceLineNo">1296</span> * @throws org.apache.hadoop.hbase.snapshot.HBaseSnapshotException if the snapshot failed<a name="line.1296"></a> +<span class="sourceLineNo">1297</span> * @throws org.apache.hadoop.hbase.snapshot.UnknownSnapshotException if the requested snapshot is<a name="line.1297"></a> +<span class="sourceLineNo">1298</span> * unknown<a name="line.1298"></a> +<span class="sourceLineNo">1299</span> */<a name="line.1299"></a> +<span class="sourceLineNo">1300</span> boolean isSnapshotFinished(final HBaseProtos.SnapshotDescription snapshot)<a name="line.1300"></a> +<span class="sourceLineNo">1301</span> throws IOException, HBaseSnapshotException, UnknownSnapshotException;<a name="line.1301"></a> +<span class="sourceLineNo">1302</span><a name="line.1302"></a> +<span class="sourceLineNo">1303</span> /**<a name="line.1303"></a> +<span class="sourceLineNo">1304</span> * Restore the specified snapshot on the original table. (The table must be disabled) If the<a name="line.1304"></a> +<span class="sourceLineNo">1305</span> * "hbase.snapshot.restore.take.failsafe.snapshot" configuration property is set to true, a<a name="line.1305"></a> +<span class="sourceLineNo">1306</span> * snapshot of the current table is taken before executing the restore operation. In case of<a name="line.1306"></a> +<span class="sourceLineNo">1307</span> * restore failure, the failsafe snapshot will be restored. If the restore completes without<a name="line.1307"></a> +<span class="sourceLineNo">1308</span> * problem the failsafe snapshot is deleted.<a name="line.1308"></a> +<span class="sourceLineNo">1309</span> *<a name="line.1309"></a> +<span class="sourceLineNo">1310</span> * @param snapshotName name of the snapshot to restore<a name="line.1310"></a> +<span class="sourceLineNo">1311</span> * @throws IOException if a remote or network exception occurs<a name="line.1311"></a> +<span class="sourceLineNo">1312</span> * @throws org.apache.hadoop.hbase.snapshot.RestoreSnapshotException if snapshot failed to be<a name="line.1312"></a> +<span class="sourceLineNo">1313</span> * restored<a name="line.1313"></a> +<span class="sourceLineNo">1314</span> * @throws IllegalArgumentException if the restore request is formatted incorrectly<a name="line.1314"></a> +<span class="sourceLineNo">1315</span> */<a name="line.1315"></a> +<span class="sourceLineNo">1316</span> void restoreSnapshot(final byte[] snapshotName) throws IOException, RestoreSnapshotException;<a name="line.1316"></a> +<span class="sourceLineNo">1317</span><a name="line.1317"></a> +<span class="sourceLineNo">1318</span> /**<a name="line.1318"></a> +<span class="sourceLineNo">1319</span> * Restore the specified snapshot on the original table. (The table must be disabled) If the<a name="line.1319"></a> +<span class="sourceLineNo">1320</span> * "hbase.snapshot.restore.take.failsafe.snapshot" configuration property is set to true, a<a name="line.1320"></a> +<span class="sourceLineNo">1321</span> * snapshot of the current table is taken before executing the restore operation. In case of<a name="line.1321"></a> +<span class="sourceLineNo">1322</span> * restore failure, the failsafe snapshot will be restored. If the restore completes without<a name="line.1322"></a> +<span class="sourceLineNo">1323</span> * problem the failsafe snapshot is deleted.<a name="line.1323"></a> +<span class="sourceLineNo">1324</span> *<a name="line.1324"></a> +<span class="sourceLineNo">1325</span> * @param snapshotName name of the snapshot to restore<a name="line.1325"></a> +<span class="sourceLineNo">1326</span> * @throws IOException if a remote or network exception occurs<a name="line.1326"></a> +<span class="sourceLineNo">1327</span> * @throws RestoreSnapshotException if snapshot failed to be restored<a name="line.1327"></a> +<span class="sourceLineNo">1328</span> * @throws IllegalArgumentException if the restore request is formatted incorrectly<a name="line.1328"></a> +<span class="sourceLineNo">1329</span> */<a name="line.1329"></a> +<span class="sourceLineNo">1330</span> void restoreSnapshot(final String snapshotName) throws IOException, RestoreSnapshotException;<a name="line.1330"></a> +<span class="sourceLineNo">1331</span><a name="line.1331"></a> +<span class="sourceLineNo">1332</span> /**<a name="line.1332"></a> +<span class="sourceLineNo">1333</span> * Restore the specified snapshot on the original table. (The table must be disabled) If<a name="line.1333"></a> +<span class="sourceLineNo">1334</span> * 'takeFailSafeSnapshot' is set to true, a snapshot of the current table is taken before<a name="line.1334"></a> +<span class="sourceLineNo">1335</span> * executing the restore operation. In case of restore failure, the failsafe snapshot will be<a name="line.1335"></a> +<span class="sourceLineNo">1336</span> * restored. If the restore completes without problem the failsafe snapshot is deleted. The<a name="line.1336"></a> +<span class="sourceLineNo">1337</span> * failsafe snapshot name is configurable by using the property<a name="line.1337"></a> +<span class="sourceLineNo">1338</span> * "hbase.snapshot.restore.failsafe.name".<a name="line.1338"></a> +<span class="sourceLineNo">1339</span> *<a name="line.1339"></a> +<span class="sourceLineNo">1340</span> * @param snapshotName name of the snapshot to restore<a name="line.1340"></a> +<span class="sourceLineNo">1341</span> * @param takeFailSafeSnapshot true if the failsafe snapshot should be taken<a name="line.1341"></a> +<span class="sourceLineNo">1342</span> * @throws IOException if a remote or network exception occurs<a name="line.1342"></a> +<span class="sourceLineNo">1343</span> * @throws RestoreSnapshotException if snapshot failed to be restored<a name="line.1343"></a> +<span class="sourceLineNo">1344</span> * @throws IllegalArgumentException if the restore request is formatted incorrectly<a name="line.1344"></a> +<span class="sourceLineNo">1345</span> */<a name="line.1345"></a> +<span class="sourceLineNo">1346</span> void restoreSnapshot(final byte[] snapshotName, final boolean takeFailSafeSnapshot)<a name="line.1346"></a> +<span class="sourceLineNo">1347</span> throws IOException, RestoreSnapshotException;<a name="line.1347"></a> +<span class="sourceLineNo">1348</span><a name="line.1348"></a> +<span class="sourceLineNo">1349</span> /**<a name="line.1349"></a> +<span class="sourceLineNo">1350</span> * Restore the specified snapshot on the original table. (The table must be disabled) If<a name="line.1350"></a> +<span class="sourceLineNo">1351</span> * 'takeFailSafeSnapshot' is set to true, a snapshot of the current table is taken before<a name="line.1351"></a> +<span class="sourceLineNo">1352</span> * executing the restore operation. In case of restore failure, the failsafe snapshot will be<a name="line.1352"></a> +<span class="sourceLineNo">1353</span> * restored. If the restore completes without problem the failsafe snapshot is deleted. The<a name="line.1353"></a> +<span class="sourceLineNo">1354</span> * failsafe snapshot name is configurable by using the property<a name="line.1354"></a> +<span class="sourceLineNo">1355</span> * "hbase.snapshot.restore.failsafe.name".<a name="line.1355"></a> +<span class="sourceLineNo">1356</span> *<a name="line.1356"></a> +<span class="sourceLineNo">1357</span> * @param snapshotName name of the snapshot to restore<a name="line.1357"></a> +<span class="sourceLineNo">1358</span> * @param takeFailSafeSnapshot true if the failsafe snapshot should be taken<a name="line.1358"></a> +<span class="sourceLineNo">1359</span> * @throws IOException if a remote or network exception occurs<a name="line.1359"></a> +<span class="sourceLineNo">1360</span> * @throws RestoreSnapshotException if snapshot failed to be restored<a name="line.1360"></a> +<span class="sourceLineNo">1361</span> * @throws IllegalArgumentException if the restore request is for
<TRUNCATED>