diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java index f73c9f9c80c..d89a3ef4894 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java @@ -32,6 +32,7 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.NamespaceDescriptor; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableExistsException; import org.apache.hadoop.hbase.TableName; @@ -945,6 +946,13 @@ public interface Admin extends Abortable, Closeable { final long procId, final boolean mayInterruptIfRunning) throws IOException; + /** + * List procedures + * @return procedure list + * @throws IOException + */ + ProcedureInfo[] listProcedures() throws IOException; + /** * Abort a procedure but does not block and wait for it be completely removed. * You can use Future.get(long, TimeUnit) to wait on the operation to complete. diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionManager.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionManager.java index 8e1e3666705..2152c2085a4 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionManager.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionManager.java @@ -1726,6 +1726,12 @@ class ConnectionManager { return stub.abortProcedure(controller, request); } @Override + public MasterProtos.ListProceduresResponse listProcedures( + RpcController controller, + MasterProtos.ListProceduresRequest request) throws ServiceException { + return stub.listProcedures(controller, request); + } + @Override public AddColumnResponse addColumn(RpcController controller, AddColumnRequest request) throws ServiceException { return stub.addColumn(controller, request); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index d74a8bc4109..148a77d888e 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -52,6 +52,7 @@ import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.NotServingRegionException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.RegionException; import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; @@ -128,6 +129,7 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsRestoreSnapshot import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotDoneRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotDoneResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespaceDescriptorsRequest; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListTableDescriptorsByNamespaceRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListTableNamesByNamespaceRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.MajorCompactionTimestampForRegionRequest; @@ -146,6 +148,7 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SnapshotResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.StopMasterRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.TruncateTableRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.UnassignRegionRequest; +import org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos; import org.apache.hadoop.hbase.quotas.QuotaFilter; import org.apache.hadoop.hbase.quotas.QuotaRetriever; import org.apache.hadoop.hbase.quotas.QuotaSettings; @@ -2845,6 +2848,28 @@ public class HBaseAdmin implements Admin { }); } + /** + * List procedures + * @return procedure list + * @throws IOException + */ + @Override + public ProcedureInfo[] listProcedures() throws IOException { + return + executeCallable(new MasterCallable(getConnection()) { + @Override + public ProcedureInfo[] call(int callTimeout) throws Exception { + List procList = master.listProcedures( + null, ListProceduresRequest.newBuilder().build()).getProcedureList(); + ProcedureInfo[] procInfoList = new ProcedureInfo[procList.size()]; + for (int i = 0; i < procList.size(); i++) { + procInfoList[i] = ProcedureInfo.convert(procList.get(i)); + } + return procInfoList; + } + }); + } + /** * Get list of table descriptors by namespace * @param name namespace name diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/ProcedureInfo.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/ProcedureInfo.java new file mode 100644 index 00000000000..9708c31da41 --- /dev/null +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/ProcedureInfo.java @@ -0,0 +1,224 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase; + +import java.io.IOException; + +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.classification.InterfaceStability; +import org.apache.hadoop.hbase.protobuf.generated.ErrorHandlingProtos.ForeignExceptionMessage; +import org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos; +import org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureState; +import org.apache.hadoop.hbase.util.ByteStringer; +import org.apache.hadoop.hbase.util.ForeignExceptionUtil; +import org.apache.hadoop.hbase.util.NonceKey; + +/** + * Procedure information + */ +@InterfaceAudience.Public +@InterfaceStability.Evolving +public class ProcedureInfo { + private final long procId; + private final String procName; + private final String procOwner; + private final ProcedureState procState; + private final long parentId; + private final ForeignExceptionMessage exception; + private final long lastUpdate; + private final long startTime; + private final byte[] result; + + private NonceKey nonceKey = null; + private long clientAckTime = -1; + + public ProcedureInfo( + final long procId, + final String procName, + final String procOwner, + final ProcedureState procState, + final long parentId, + final ForeignExceptionMessage exception, + final long lastUpdate, + final long startTime, + final byte[] result) { + this.procId = procId; + this.procName = procName; + this.procOwner = procOwner; + this.procState = procState; + this.parentId = parentId; + this.lastUpdate = lastUpdate; + this.startTime = startTime; + + // If the procedure is completed, we should treat exception and result differently + this.exception = exception; + this.result = result; + } + + public long getProcId() { + return procId; + } + + public String getProcName() { + return procName; + } + + public String getProcOwner() { + return procOwner; + } + + public ProcedureState getProcState() { + return procState; + } + + public boolean hasParentId() { + return (parentId != -1); + } + + public long getParentId() { + return parentId; + } + + public NonceKey getNonceKey() { + return nonceKey; + } + + public void setNonceKey(NonceKey nonceKey) { + this.nonceKey = nonceKey; + } + + public boolean isFailed() { + return exception != null; + } + + public IOException getException() { + if (isFailed()) { + return ForeignExceptionUtil.toIOException(exception); + } + return null; + } + + @InterfaceAudience.Private + public ForeignExceptionMessage getForeignExceptionMessage() { + return exception; + } + + public String getExceptionCause() { + assert isFailed(); + return exception.getGenericException().getClassName(); + } + + public String getExceptionMessage() { + assert isFailed(); + return exception.getGenericException().getMessage(); + } + + public String getExceptionFullMessage() { + assert isFailed(); + return getExceptionCause() + " - " + getExceptionMessage(); + } + + public boolean hasResultData() { + return result != null; + } + + public byte[] getResult() { + return result; + } + + public long getStartTime() { + return startTime; + } + + public long getLastUpdate() { + return lastUpdate; + } + + public long executionTime() { + return lastUpdate - startTime; + } + + @InterfaceAudience.Private + public boolean hasClientAckTime() { + return clientAckTime > 0; + } + + @InterfaceAudience.Private + public long getClientAckTime() { + return clientAckTime; + } + + @InterfaceAudience.Private + public void setClientAckTime(final long timestamp) { + this.clientAckTime = timestamp; + } + + /** + * @return Convert the current {@link ProcedureInfo} into a Protocol Buffers Procedure + * instance. + */ + @InterfaceAudience.Private + public static ProcedureProtos.Procedure convertToProcedureProto( + final ProcedureInfo procInfo) { + ProcedureProtos.Procedure.Builder builder = ProcedureProtos.Procedure.newBuilder(); + + builder.setClassName(procInfo.getProcName()); + builder.setProcId(procInfo.getProcId()); + builder.setStartTime(procInfo.getStartTime()); + builder.setState(procInfo.getProcState()); + builder.setLastUpdate(procInfo.getLastUpdate()); + + if (procInfo.hasParentId()) { + builder.setParentId(procInfo.getParentId()); + } + + if (procInfo.getProcOwner() != null) { + builder.setOwner(procInfo.getProcOwner()); + } + + if (procInfo.isFailed()) { + builder.setException(procInfo.getForeignExceptionMessage()); + } + + if (procInfo.hasResultData()) { + builder.setResult(ByteStringer.wrap(procInfo.getResult())); + } + + return builder.build(); + } + + /** + * Helper to convert the protobuf object. + * @return Convert the current Protocol Buffers Procedure to {@link ProcedureInfo} + * instance. + */ + @InterfaceAudience.Private + public static ProcedureInfo convert(final ProcedureProtos.Procedure procProto) { + return new ProcedureInfo( + procProto.getProcId(), + procProto.getClassName(), + procProto.getOwner(), + procProto.getState(), + procProto.hasParentId() ? procProto.getParentId() : -1, + procProto.getState() == ProcedureState.ROLLEDBACK ? procProto.getException() : null, + procProto.getLastUpdate(), + procProto.getStartTime(), + procProto.getState() == ProcedureState.FINISHED ? procProto.getResult().toByteArray() : null); + } +} \ No newline at end of file diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/exceptions/IllegalArgumentIOException.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/exceptions/IllegalArgumentIOException.java new file mode 100644 index 00000000000..53ced75ddba --- /dev/null +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/exceptions/IllegalArgumentIOException.java @@ -0,0 +1,46 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hbase.exceptions; + +import java.io.IOException; + +import org.apache.hadoop.hbase.classification.InterfaceAudience; + +/** + * Exception thrown when an illegal argument is passed to a function/procedure. + */ +@SuppressWarnings("serial") +@InterfaceAudience.Private +public class IllegalArgumentIOException extends IOException { + public IllegalArgumentIOException() { + super(); + } + + public IllegalArgumentIOException(final String message) { + super(message); + } + + public IllegalArgumentIOException(final String message, final Throwable t) { + super(message, t); + } + + public IllegalArgumentIOException(final Throwable t) { + super(t); + } +} diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/Procedure.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/Procedure.java index a343c8957c9..5545c5c35b3 100644 --- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/Procedure.java +++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/Procedure.java @@ -26,11 +26,12 @@ import java.lang.reflect.Modifier; import java.util.Arrays; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeoutException; import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; +import org.apache.hadoop.hbase.exceptions.TimeoutIOException; import org.apache.hadoop.hbase.procedure2.util.StringUtils; import org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos; import org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureState; @@ -214,6 +215,13 @@ public abstract class Procedure implements Comparable { return sb.toString(); } + protected String toStringClass() { + StringBuilder sb = new StringBuilder(); + toStringClassDetails(sb); + + return sb.toString(); + } + /** * Called from {@link #toString()} when interpolating {@link Procedure} state * @param builder Append current {@link ProcedureState} @@ -395,7 +403,7 @@ public abstract class Procedure implements Comparable { protected synchronized boolean setTimeoutFailure() { if (state == ProcedureState.WAITING_TIMEOUT) { long timeDiff = EnvironmentEdgeManager.currentTime() - lastUpdate; - setFailure("ProcedureExecutor", new TimeoutException( + setFailure("ProcedureExecutor", new TimeoutIOException( "Operation timed out after " + StringUtils.humanTimeDiff(timeDiff))); return true; } @@ -625,6 +633,37 @@ public abstract class Procedure implements Comparable { } } + /** + * Helper to create the ProcedureInfo from Procedure. + */ + @InterfaceAudience.Private + public static ProcedureInfo createProcedureInfo(final Procedure proc, final NonceKey nonceKey) { + RemoteProcedureException exception; + + if (proc.hasException()) { + exception = proc.getException(); + } else { + exception = null; + } + ProcedureInfo procInfo = new ProcedureInfo( + proc.getProcId(), + proc.toStringClass(), + proc.getOwner(), + proc.getState(), + proc.hasParent() ? proc.getParentProcId() : -1, + exception != null ? + RemoteProcedureException.toProto(exception.getSource(), exception.getCause()) : null, + proc.getLastUpdate(), + proc.getStartTime(), + proc.getResult()); + + if (nonceKey != null) { + procInfo.setNonceKey(nonceKey); + } + + return procInfo; + } + /** * Helper to convert the procedure to protobuf. * Used by ProcedureStore implementations. diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java index 1a098e5cb97..32136079186 100644 --- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java +++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java @@ -40,8 +40,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; +import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore.ProcedureIterator; import org.apache.hadoop.hbase.procedure2.util.StringUtils; @@ -135,13 +137,13 @@ public class ProcedureExecutor { private static final String EVICT_ACKED_TTL_CONF_KEY ="hbase.procedure.cleaner.acked.evict.ttl"; private static final int DEFAULT_ACKED_EVICT_TTL = 5 * 60000; // 5min - private final Map completed; + private final Map completed; private final Map nonceKeysToProcIdsMap; private final ProcedureStore store; private final Configuration conf; public CompletedProcedureCleaner(final Configuration conf, final ProcedureStore store, - final Map completedMap, + final Map completedMap, final Map nonceKeysToProcIdsMap) { // set the timeout interval that triggers the periodic-procedure setTimeout(conf.getInt(CLEANER_INTERVAL_CONF_KEY, DEFAULT_CLEANER_INTERVAL)); @@ -163,10 +165,10 @@ public class ProcedureExecutor { final long evictAckTtl = conf.getInt(EVICT_ACKED_TTL_CONF_KEY, DEFAULT_ACKED_EVICT_TTL); long now = EnvironmentEdgeManager.currentTime(); - Iterator> it = completed.entrySet().iterator(); + Iterator> it = completed.entrySet().iterator(); while (it.hasNext() && store.isRunning()) { - Map.Entry entry = it.next(); - ProcedureResult result = entry.getValue(); + Map.Entry entry = it.next(); + ProcedureInfo result = entry.getValue(); // TODO: Select TTL based on Procedure type if ((result.hasClientAckTime() && (now - result.getClientAckTime()) >= evictAckTtl) || @@ -212,12 +214,12 @@ public class ProcedureExecutor { } /** - * Map the the procId returned by submitProcedure(), the Root-ProcID, to the ProcedureResult. + * Map the the procId returned by submitProcedure(), the Root-ProcID, to the ProcedureInfo. * Once a Root-Procedure completes (success or failure), the result will be added to this map. * The user of ProcedureExecutor should call getResult(procId) to get the result. */ - private final ConcurrentHashMap completed = - new ConcurrentHashMap(); + private final ConcurrentHashMap completed = + new ConcurrentHashMap(); /** * Map the the procId returned by submitProcedure(), the Root-ProcID, to the RootProcedureState. @@ -364,7 +366,7 @@ public class ProcedureExecutor { } assert !rollbackStack.containsKey(proc.getProcId()); procedures.remove(proc.getProcId()); - completed.put(proc.getProcId(), newResultFromProcedure(proc)); + completed.put(proc.getProcId(), Procedure.createProcedureInfo(proc, proc.getNonceKey())); continue; } @@ -571,6 +573,26 @@ public class ProcedureExecutor { return this.listeners.remove(listener); } + /** + * List procedures. + * @return the procedures in a list + */ + public List listProcedures() { + List procedureLists = + new ArrayList(procedures.size() + completed.size()); + for (java.util.Map.Entry p: procedures.entrySet()) { + procedureLists.add(Procedure.createProcedureInfo(p.getValue(), null)); + } + for (java.util.Map.Entry e: completed.entrySet()) { + // Note: The procedure could show up twice in the list with different state, as + // it could complete after we walk through procedures list and insert into + // procedureList - it is ok, as we will use the information in the ProcedureInfo + // to figure it out; to prevent this would increase the complexity of the logic. + procedureLists.add(e.getValue()); + } + return procedureLists; + } + /** * Add a new root-procedure to the executor. * @param proc the new procedure to execute. @@ -643,7 +665,7 @@ public class ProcedureExecutor { return currentProcId; } - public ProcedureResult getResult(final long procId) { + public ProcedureInfo getResult(final long procId) { return completed.get(procId); } @@ -676,7 +698,7 @@ public class ProcedureExecutor { * @param procId the ID of the procedure to remove */ public void removeResult(final long procId) { - ProcedureResult result = completed.get(procId); + ProcedureInfo result = completed.get(procId); if (result == null) { assert !procedures.containsKey(procId) : "procId=" + procId + " is still running"; if (LOG.isDebugEnabled()) { @@ -718,7 +740,7 @@ public class ProcedureExecutor { return false; } - public Map getResults() { + public Map getResults() { return Collections.unmodifiableMap(completed); } @@ -1033,7 +1055,7 @@ public class ProcedureExecutor { if (subproc == null) { String msg = "subproc[" + i + "] is null, aborting the procedure"; procedure.setFailure(new RemoteProcedureException(msg, - new IllegalArgumentException(msg))); + new IllegalArgumentIOException(msg))); subprocs = null; break; } @@ -1212,7 +1234,7 @@ public class ProcedureExecutor { } // update the executor internal state maps - completed.put(proc.getProcId(), newResultFromProcedure(proc)); + completed.put(proc.getProcId(), Procedure.createProcedureInfo(proc, proc.getNonceKey())); rollbackStack.remove(proc.getProcId()); procedures.remove(proc.getProcId()); @@ -1228,8 +1250,8 @@ public class ProcedureExecutor { sendProcedureFinishedNotification(proc.getProcId()); } - public Pair getResultOrProcedure(final long procId) { - ProcedureResult result = completed.get(procId); + public Pair getResultOrProcedure(final long procId) { + ProcedureInfo result = completed.get(procId); Procedure proc = null; if (result == null) { proc = procedures.get(procId); @@ -1239,13 +1261,4 @@ public class ProcedureExecutor { } return new Pair(result, proc); } - - private static ProcedureResult newResultFromProcedure(final Procedure proc) { - if (proc.isFailed()) { - return new ProcedureResult( - proc.getNonceKey(), proc.getStartTime(), proc.getLastUpdate(), proc.getException()); - } - return new ProcedureResult( - proc.getNonceKey(), proc.getStartTime(), proc.getLastUpdate(), proc.getResult()); - } } diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureResult.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureResult.java deleted file mode 100644 index ff5407f9c87..00000000000 --- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureResult.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.hbase.procedure2; - -import org.apache.hadoop.hbase.classification.InterfaceAudience; -import org.apache.hadoop.hbase.classification.InterfaceStability; -import org.apache.hadoop.hbase.util.NonceKey; - -/** - * Once a Procedure completes the ProcedureExecutor takes all the useful - * information of the procedure (e.g. exception/result) and creates a ProcedureResult. - * The user of the Procedure framework will get the procedure result with - * procedureExecutor.getResult(procId) - */ -@InterfaceAudience.Private -@InterfaceStability.Evolving -public class ProcedureResult { - private final NonceKey nonceKey; - private final RemoteProcedureException exception; - private final long lastUpdate; - private final long startTime; - private final byte[] result; - - private long clientAckTime = -1; - - public ProcedureResult( - final NonceKey nonceKey, - final long startTime, - final long lastUpdate, - final RemoteProcedureException exception) { - this(nonceKey, exception, lastUpdate, startTime, null); - } - - public ProcedureResult( - final NonceKey nonceKey, - final long startTime, - final long lastUpdate, - final byte[] result) { - this(nonceKey, null, lastUpdate, startTime, result); - } - - public ProcedureResult( - final NonceKey nonceKey, - final RemoteProcedureException exception, - final long lastUpdate, - final long startTime, - final byte[] result) { - this.nonceKey = nonceKey; - this.exception = exception; - this.lastUpdate = lastUpdate; - this.startTime = startTime; - this.result = result; - } - - public NonceKey getNonceKey() { - return nonceKey; - } - - public boolean isFailed() { - return exception != null; - } - - public RemoteProcedureException getException() { - return exception; - } - - public boolean hasResultData() { - return result != null; - } - - public byte[] getResult() { - return result; - } - - public long getStartTime() { - return startTime; - } - - public long getLastUpdate() { - return lastUpdate; - } - - public long executionTime() { - return lastUpdate - startTime; - } - - public boolean hasClientAckTime() { - return clientAckTime > 0; - } - - public long getClientAckTime() { - return clientAckTime; - } - - @InterfaceAudience.Private - protected void setClientAckTime(final long timestamp) { - this.clientAckTime = timestamp; - } -} \ No newline at end of file diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/ProcedureTestingUtility.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/ProcedureTestingUtility.java index 34774ed8c28..45ab4bdcc5e 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/ProcedureTestingUtility.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/ProcedureTestingUtility.java @@ -28,15 +28,18 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.util.Threads; +import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; +import org.apache.hadoop.hbase.exceptions.TimeoutIOException; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.procedure2.store.NoopProcedureStore; import org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore; +import org.apache.hadoop.hbase.protobuf.generated.ErrorHandlingProtos.ForeignExceptionMessage; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; public class ProcedureTestingUtility { private static final Log LOG = LogFactory.getLog(ProcedureTestingUtility.class); @@ -166,23 +169,43 @@ public class ProcedureTestingUtility { public static void assertProcNotFailed(ProcedureExecutor procExecutor, long procId) { - ProcedureResult result = procExecutor.getResult(procId); + ProcedureInfo result = procExecutor.getResult(procId); assertTrue("expected procedure result", result != null); assertProcNotFailed(result); } - public static void assertProcNotFailed(final ProcedureResult result) { - Exception exception = result.getException(); - String msg = exception != null ? exception.toString() : "no exception found"; + public static void assertProcNotFailed(final ProcedureInfo result) { + ForeignExceptionMessage exception = result.getForeignExceptionMessage(); + String msg = exception != null ? result.getExceptionFullMessage() : "no exception found"; assertFalse(msg, result.isFailed()); } - public static void assertIsAbortException(final ProcedureResult result) { - LOG.info(result.getException()); + public static void assertIsAbortException(final ProcedureInfo result) { assertEquals(true, result.isFailed()); - Throwable cause = result.getException().getCause(); - assertTrue("expected abort exception, got "+ cause, - cause instanceof ProcedureAbortedException); + LOG.info(result.getExceptionFullMessage()); + Throwable cause = getExceptionCause(result); + assertTrue("expected abort exception, got " + cause, + cause instanceof ProcedureAbortedException); + } + + public static void assertIsTimeoutException(final ProcedureInfo result) { + assertEquals(true, result.isFailed()); + LOG.info(result.getExceptionFullMessage()); + Throwable cause = getExceptionCause(result); + assertTrue("expected TimeoutIOException, got " + cause, cause instanceof TimeoutIOException); + } + + public static void assertIsIllegalArgumentException(final ProcedureInfo result) { + assertEquals(true, result.isFailed()); + LOG.info(result.getExceptionFullMessage()); + Throwable cause = ProcedureTestingUtility.getExceptionCause(result); + assertTrue("expected IllegalArgumentIOException, got " + cause, + cause instanceof IllegalArgumentIOException); + } + + public static Throwable getExceptionCause(final ProcedureInfo procInfo) { + assert procInfo.getForeignExceptionMessage() != null; + return RemoteProcedureException.fromProto(procInfo.getForeignExceptionMessage()).getCause(); } public static class TestProcedure extends Procedure { diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecution.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecution.java index 0b2a3646504..a259f49f8a7 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecution.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecution.java @@ -21,13 +21,13 @@ package org.apache.hadoop.hbase.procedure2; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.TimeoutException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureState; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -35,14 +35,11 @@ import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.junit.After; import org.junit.Before; -import org.junit.Assert; import org.junit.Test; import org.junit.experimental.categories.Category; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; @Category(SmallTests.class) public class TestProcedureExecution { @@ -80,7 +77,7 @@ public class TestProcedureExecution { fs.delete(logDir, true); } - private static class TestProcedureException extends Exception { + private static class TestProcedureException extends IOException { public TestProcedureException(String msg) { super(msg); } } @@ -141,11 +138,9 @@ public class TestProcedureExecution { // subProc1 has a "null" subprocedure which is catched as InvalidArgument // failed state with 2 execute and 2 rollback LOG.info(state); - ProcedureResult result = procExecutor.getResult(rootId); - LOG.info(result.getException()); + ProcedureInfo result = procExecutor.getResult(rootId); assertTrue(state.toString(), result.isFailed()); - assertTrue(result.getException().toString(), - result.getException().getCause() instanceof IllegalArgumentException); + ProcedureTestingUtility.assertIsIllegalArgumentException(result); assertEquals(state.toString(), 4, state.size()); assertEquals("rootProc-execute", state.get(0)); @@ -164,7 +159,7 @@ public class TestProcedureExecution { // successful state, with 3 execute LOG.info(state); - ProcedureResult result = procExecutor.getResult(rootId); + ProcedureInfo result = procExecutor.getResult(rootId); ProcedureTestingUtility.assertProcNotFailed(result); assertEquals(state.toString(), 3, state.size()); } @@ -180,11 +175,12 @@ public class TestProcedureExecution { // the 3rd proc fail, rollback after 2 successful execution LOG.info(state); - ProcedureResult result = procExecutor.getResult(rootId); - LOG.info(result.getException()); + ProcedureInfo result = procExecutor.getResult(rootId); assertTrue(state.toString(), result.isFailed()); - assertTrue(result.getException().toString(), - result.getException().getCause() instanceof TestProcedureException); + LOG.info(result.getExceptionFullMessage()); + Throwable cause = ProcedureTestingUtility.getExceptionCause(result); + assertTrue("expected TestProcedureException, got " + cause, + cause instanceof TestProcedureException); assertEquals(state.toString(), 6, state.size()); assertEquals("rootProc-execute", state.get(0)); @@ -223,11 +219,12 @@ public class TestProcedureExecution { public void testRollbackRetriableFailure() { long procId = ProcedureTestingUtility.submitAndWait(procExecutor, new TestFaultyRollback()); - ProcedureResult result = procExecutor.getResult(procId); - LOG.info(result.getException()); + ProcedureInfo result = procExecutor.getResult(procId); assertTrue("expected a failure", result.isFailed()); - assertTrue(result.getException().toString(), - result.getException().getCause() instanceof TestProcedureException); + LOG.info(result.getExceptionFullMessage()); + Throwable cause = ProcedureTestingUtility.getExceptionCause(result); + assertTrue("expected TestProcedureException, got " + cause, + cause instanceof TestProcedureException); } public static class TestWaitingProcedure extends SequentialProcedure { @@ -306,11 +303,9 @@ public class TestProcedureExecution { long execTime = EnvironmentEdgeManager.currentTime() - startTime; LOG.info(state); assertTrue("we didn't wait enough execTime=" + execTime, execTime >= PROC_TIMEOUT_MSEC); - ProcedureResult result = procExecutor.getResult(rootId); - LOG.info(result.getException()); + ProcedureInfo result = procExecutor.getResult(rootId); assertTrue(state.toString(), result.isFailed()); - assertTrue(result.getException().toString(), - result.getException().getCause() instanceof TimeoutException); + ProcedureTestingUtility.assertIsTimeoutException(result); assertEquals(state.toString(), 2, state.size()); assertEquals("wproc-execute", state.get(0)); assertEquals("wproc-rollback", state.get(1)); @@ -323,11 +318,9 @@ public class TestProcedureExecution { proc.setTimeout(2500); long rootId = ProcedureTestingUtility.submitAndWait(procExecutor, proc); LOG.info(state); - ProcedureResult result = procExecutor.getResult(rootId); - LOG.info(result.getException()); + ProcedureInfo result = procExecutor.getResult(rootId); assertTrue(state.toString(), result.isFailed()); - assertTrue(result.getException().toString(), - result.getException().getCause() instanceof TimeoutException); + ProcedureTestingUtility.assertIsTimeoutException(result); assertEquals(state.toString(), 4, state.size()); assertEquals("wproc-execute", state.get(0)); assertEquals("wproc-child-execute", state.get(1)); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRecovery.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRecovery.java index 625357a97c4..0cb12919eaf 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRecovery.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRecovery.java @@ -30,6 +30,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.Bytes; @@ -196,7 +197,7 @@ public class TestProcedureRecovery { long restartTs = EnvironmentEdgeManager.currentTime(); restart(); waitProcedure(procId); - ProcedureResult result = procExecutor.getResult(procId); + ProcedureInfo result = procExecutor.getResult(procId); assertTrue(result.getLastUpdate() > restartTs); ProcedureTestingUtility.assertProcNotFailed(result); assertEquals(1, Bytes.toInt(result.getResult())); @@ -235,7 +236,7 @@ public class TestProcedureRecovery { assertTrue(procExecutor.isRunning()); // The procedure is completed - ProcedureResult result = procExecutor.getResult(procId); + ProcedureInfo result = procExecutor.getResult(procId); ProcedureTestingUtility.assertProcNotFailed(result); } @@ -282,7 +283,7 @@ public class TestProcedureRecovery { waitProcedure(procId); // The procedure is completed - ProcedureResult result = procExecutor.getResult(procId); + ProcedureInfo result = procExecutor.getResult(procId); ProcedureTestingUtility.assertIsAbortException(result); } @@ -303,7 +304,7 @@ public class TestProcedureRecovery { long procId2 = ProcedureTestingUtility.submitAndWait(procExecutor, proc2, nonceGroup, nonce); assertTrue(procId == procId2); - ProcedureResult result = procExecutor.getResult(procId2); + ProcedureInfo result = procExecutor.getResult(procId2); ProcedureTestingUtility.assertProcNotFailed(result); } @@ -450,7 +451,7 @@ public class TestProcedureRecovery { assertTrue(procExecutor.isRunning()); // The procedure is completed - ProcedureResult result = procExecutor.getResult(procId); + ProcedureInfo result = procExecutor.getResult(procId); ProcedureTestingUtility.assertProcNotFailed(result); assertEquals(15, Bytes.toInt(result.getResult())); } @@ -504,7 +505,7 @@ public class TestProcedureRecovery { assertTrue(procExecutor.isRunning()); // The procedure is completed - ProcedureResult result = procExecutor.getResult(procId); + ProcedureInfo result = procExecutor.getResult(procId); ProcedureTestingUtility.assertIsAbortException(result); } diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java index 61c58e188c2..d476c4f44bf 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java @@ -34,14 +34,11 @@ import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.LargeTests; import org.junit.After; -import org.junit.Assert; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; diff --git a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/MasterProtos.java b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/MasterProtos.java index 48dd9577133..d5bc30a754f 100644 --- a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/MasterProtos.java +++ b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/MasterProtos.java @@ -47327,6 +47327,1065 @@ public final class MasterProtos { // @@protoc_insertion_point(class_scope:hbase.pb.AbortProcedureResponse) } + public interface ListProceduresRequestOrBuilder + extends com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code hbase.pb.ListProceduresRequest} + */ + public static final class ListProceduresRequest extends + com.google.protobuf.GeneratedMessage + implements ListProceduresRequestOrBuilder { + // Use ListProceduresRequest.newBuilder() to construct. + private ListProceduresRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private ListProceduresRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final ListProceduresRequest defaultInstance; + public static ListProceduresRequest getDefaultInstance() { + return defaultInstance; + } + + public ListProceduresRequest getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListProceduresRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_ListProceduresRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_ListProceduresRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ListProceduresRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProceduresRequest(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private void initFields() { + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest other = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest) obj; + + boolean result = true; + result = result && + getUnknownFields().equals(other.getUnknownFields()); + return result; + } + + private int memoizedHashCode = 0; + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code hbase.pb.ListProceduresRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_ListProceduresRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_ListProceduresRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_ListProceduresRequest_descriptor; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest getDefaultInstanceForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest build() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest buildPartial() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest result = new org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest(this); + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest) { + return mergeFrom((org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest other) { + if (other == org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + // @@protoc_insertion_point(builder_scope:hbase.pb.ListProceduresRequest) + } + + static { + defaultInstance = new ListProceduresRequest(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:hbase.pb.ListProceduresRequest) + } + + public interface ListProceduresResponseOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // repeated .hbase.pb.Procedure procedure = 1; + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + java.util.List + getProcedureList(); + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure getProcedure(int index); + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + int getProcedureCount(); + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + java.util.List + getProcedureOrBuilderList(); + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureOrBuilder getProcedureOrBuilder( + int index); + } + /** + * Protobuf type {@code hbase.pb.ListProceduresResponse} + */ + public static final class ListProceduresResponse extends + com.google.protobuf.GeneratedMessage + implements ListProceduresResponseOrBuilder { + // Use ListProceduresResponse.newBuilder() to construct. + private ListProceduresResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private ListProceduresResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final ListProceduresResponse defaultInstance; + public static ListProceduresResponse getDefaultInstance() { + return defaultInstance; + } + + public ListProceduresResponse getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListProceduresResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + procedure_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + procedure_.add(input.readMessage(org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + procedure_ = java.util.Collections.unmodifiableList(procedure_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_ListProceduresResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_ListProceduresResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ListProceduresResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProceduresResponse(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + // repeated .hbase.pb.Procedure procedure = 1; + public static final int PROCEDURE_FIELD_NUMBER = 1; + private java.util.List procedure_; + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public java.util.List getProcedureList() { + return procedure_; + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public java.util.List + getProcedureOrBuilderList() { + return procedure_; + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public int getProcedureCount() { + return procedure_.size(); + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure getProcedure(int index) { + return procedure_.get(index); + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureOrBuilder getProcedureOrBuilder( + int index) { + return procedure_.get(index); + } + + private void initFields() { + procedure_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + for (int i = 0; i < getProcedureCount(); i++) { + if (!getProcedure(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < procedure_.size(); i++) { + output.writeMessage(1, procedure_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < procedure_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, procedure_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse other = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse) obj; + + boolean result = true; + result = result && getProcedureList() + .equals(other.getProcedureList()); + result = result && + getUnknownFields().equals(other.getUnknownFields()); + return result; + } + + private int memoizedHashCode = 0; + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (getProcedureCount() > 0) { + hash = (37 * hash) + PROCEDURE_FIELD_NUMBER; + hash = (53 * hash) + getProcedureList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code hbase.pb.ListProceduresResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_ListProceduresResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_ListProceduresResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getProcedureFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (procedureBuilder_ == null) { + procedure_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + procedureBuilder_.clear(); + } + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.internal_static_hbase_pb_ListProceduresResponse_descriptor; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse getDefaultInstanceForType() { + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse build() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse buildPartial() { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse result = new org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse(this); + int from_bitField0_ = bitField0_; + if (procedureBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + procedure_ = java.util.Collections.unmodifiableList(procedure_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.procedure_ = procedure_; + } else { + result.procedure_ = procedureBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse) { + return mergeFrom((org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse other) { + if (other == org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.getDefaultInstance()) return this; + if (procedureBuilder_ == null) { + if (!other.procedure_.isEmpty()) { + if (procedure_.isEmpty()) { + procedure_ = other.procedure_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProcedureIsMutable(); + procedure_.addAll(other.procedure_); + } + onChanged(); + } + } else { + if (!other.procedure_.isEmpty()) { + if (procedureBuilder_.isEmpty()) { + procedureBuilder_.dispose(); + procedureBuilder_ = null; + procedure_ = other.procedure_; + bitField0_ = (bitField0_ & ~0x00000001); + procedureBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getProcedureFieldBuilder() : null; + } else { + procedureBuilder_.addAllMessages(other.procedure_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getProcedureCount(); i++) { + if (!getProcedure(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // repeated .hbase.pb.Procedure procedure = 1; + private java.util.List procedure_ = + java.util.Collections.emptyList(); + private void ensureProcedureIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + procedure_ = new java.util.ArrayList(procedure_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure, org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.Builder, org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureOrBuilder> procedureBuilder_; + + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public java.util.List getProcedureList() { + if (procedureBuilder_ == null) { + return java.util.Collections.unmodifiableList(procedure_); + } else { + return procedureBuilder_.getMessageList(); + } + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public int getProcedureCount() { + if (procedureBuilder_ == null) { + return procedure_.size(); + } else { + return procedureBuilder_.getCount(); + } + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure getProcedure(int index) { + if (procedureBuilder_ == null) { + return procedure_.get(index); + } else { + return procedureBuilder_.getMessage(index); + } + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public Builder setProcedure( + int index, org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure value) { + if (procedureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcedureIsMutable(); + procedure_.set(index, value); + onChanged(); + } else { + procedureBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public Builder setProcedure( + int index, org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.Builder builderForValue) { + if (procedureBuilder_ == null) { + ensureProcedureIsMutable(); + procedure_.set(index, builderForValue.build()); + onChanged(); + } else { + procedureBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public Builder addProcedure(org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure value) { + if (procedureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcedureIsMutable(); + procedure_.add(value); + onChanged(); + } else { + procedureBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public Builder addProcedure( + int index, org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure value) { + if (procedureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProcedureIsMutable(); + procedure_.add(index, value); + onChanged(); + } else { + procedureBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public Builder addProcedure( + org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.Builder builderForValue) { + if (procedureBuilder_ == null) { + ensureProcedureIsMutable(); + procedure_.add(builderForValue.build()); + onChanged(); + } else { + procedureBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public Builder addProcedure( + int index, org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.Builder builderForValue) { + if (procedureBuilder_ == null) { + ensureProcedureIsMutable(); + procedure_.add(index, builderForValue.build()); + onChanged(); + } else { + procedureBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public Builder addAllProcedure( + java.lang.Iterable values) { + if (procedureBuilder_ == null) { + ensureProcedureIsMutable(); + super.addAll(values, procedure_); + onChanged(); + } else { + procedureBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public Builder clearProcedure() { + if (procedureBuilder_ == null) { + procedure_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + procedureBuilder_.clear(); + } + return this; + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public Builder removeProcedure(int index) { + if (procedureBuilder_ == null) { + ensureProcedureIsMutable(); + procedure_.remove(index); + onChanged(); + } else { + procedureBuilder_.remove(index); + } + return this; + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.Builder getProcedureBuilder( + int index) { + return getProcedureFieldBuilder().getBuilder(index); + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureOrBuilder getProcedureOrBuilder( + int index) { + if (procedureBuilder_ == null) { + return procedure_.get(index); } else { + return procedureBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public java.util.List + getProcedureOrBuilderList() { + if (procedureBuilder_ != null) { + return procedureBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(procedure_); + } + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.Builder addProcedureBuilder() { + return getProcedureFieldBuilder().addBuilder( + org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.getDefaultInstance()); + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.Builder addProcedureBuilder( + int index) { + return getProcedureFieldBuilder().addBuilder( + index, org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.getDefaultInstance()); + } + /** + * repeated .hbase.pb.Procedure procedure = 1; + */ + public java.util.List + getProcedureBuilderList() { + return getProcedureFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure, org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.Builder, org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureOrBuilder> + getProcedureFieldBuilder() { + if (procedureBuilder_ == null) { + procedureBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure, org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.Procedure.Builder, org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureOrBuilder>( + procedure_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + procedure_ = null; + } + return procedureBuilder_; + } + + // @@protoc_insertion_point(builder_scope:hbase.pb.ListProceduresResponse) + } + + static { + defaultInstance = new ListProceduresResponse(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:hbase.pb.ListProceduresResponse) + } + public interface SetQuotaRequestOrBuilder extends com.google.protobuf.MessageOrBuilder { @@ -52273,6 +53332,18 @@ public final class MasterProtos { org.apache.hadoop.hbase.protobuf.generated.MasterProtos.AbortProcedureRequest request, com.google.protobuf.RpcCallback done); + /** + * rpc ListProcedures(.hbase.pb.ListProceduresRequest) returns (.hbase.pb.ListProceduresResponse); + * + *
+       ** returns a list of procedures 
+       * 
+ */ + public abstract void listProcedures( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest request, + com.google.protobuf.RpcCallback done); + } public static com.google.protobuf.Service newReflectiveService( @@ -52678,6 +53749,14 @@ public final class MasterProtos { impl.abortProcedure(controller, request, done); } + @java.lang.Override + public void listProcedures( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest request, + com.google.protobuf.RpcCallback done) { + impl.listProcedures(controller, request, done); + } + }; } @@ -52800,6 +53879,8 @@ public final class MasterProtos { return impl.getSecurityCapabilities(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SecurityCapabilitiesRequest)request); case 49: return impl.abortProcedure(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.AbortProcedureRequest)request); + case 50: + return impl.listProcedures(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest)request); default: throw new java.lang.AssertionError("Can't get here."); } @@ -52914,6 +53995,8 @@ public final class MasterProtos { return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SecurityCapabilitiesRequest.getDefaultInstance(); case 49: return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.AbortProcedureRequest.getDefaultInstance(); + case 50: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -53028,6 +54111,8 @@ public final class MasterProtos { return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SecurityCapabilitiesResponse.getDefaultInstance(); case 49: return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.AbortProcedureResponse.getDefaultInstance(); + case 50: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -53659,6 +54744,18 @@ public final class MasterProtos { org.apache.hadoop.hbase.protobuf.generated.MasterProtos.AbortProcedureRequest request, com.google.protobuf.RpcCallback done); + /** + * rpc ListProcedures(.hbase.pb.ListProceduresRequest) returns (.hbase.pb.ListProceduresResponse); + * + *
+     ** returns a list of procedures 
+     * 
+ */ + public abstract void listProcedures( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest request, + com.google.protobuf.RpcCallback done); + public static final com.google.protobuf.Descriptors.ServiceDescriptor getDescriptor() { @@ -53931,6 +55028,11 @@ public final class MasterProtos { com.google.protobuf.RpcUtil.specializeCallback( done)); return; + case 50: + this.listProcedures(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest)request, + com.google.protobuf.RpcUtil.specializeCallback( + done)); + return; default: throw new java.lang.AssertionError("Can't get here."); } @@ -54045,6 +55147,8 @@ public final class MasterProtos { return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SecurityCapabilitiesRequest.getDefaultInstance(); case 49: return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.AbortProcedureRequest.getDefaultInstance(); + case 50: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -54159,6 +55263,8 @@ public final class MasterProtos { return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SecurityCapabilitiesResponse.getDefaultInstance(); case 49: return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.AbortProcedureResponse.getDefaultInstance(); + case 50: + return org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -54929,6 +56035,21 @@ public final class MasterProtos { org.apache.hadoop.hbase.protobuf.generated.MasterProtos.AbortProcedureResponse.class, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.AbortProcedureResponse.getDefaultInstance())); } + + public void listProcedures( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest request, + com.google.protobuf.RpcCallback done) { + channel.callMethod( + getDescriptor().getMethods().get(50), + controller, + request, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.getDefaultInstance(), + com.google.protobuf.RpcUtil.generalizeCallback( + done, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.class, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.getDefaultInstance())); + } } public static BlockingInterface newBlockingStub( @@ -55186,6 +56307,11 @@ public final class MasterProtos { com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.AbortProcedureRequest request) throws com.google.protobuf.ServiceException; + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse listProcedures( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest request) + throws com.google.protobuf.ServiceException; } private static final class BlockingStub implements BlockingInterface { @@ -55794,6 +56920,18 @@ public final class MasterProtos { org.apache.hadoop.hbase.protobuf.generated.MasterProtos.AbortProcedureResponse.getDefaultInstance()); } + + public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse listProcedures( + com.google.protobuf.RpcController controller, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest request) + throws com.google.protobuf.ServiceException { + return (org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse) channel.callBlockingMethod( + getDescriptor().getMethods().get(50), + controller, + request, + org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse.getDefaultInstance()); + } + } // @@protoc_insertion_point(class_scope:hbase.pb.MasterService) @@ -56239,6 +57377,16 @@ public final class MasterProtos { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_hbase_pb_AbortProcedureResponse_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_hbase_pb_ListProceduresRequest_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_hbase_pb_ListProceduresRequest_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_hbase_pb_ListProceduresResponse_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_hbase_pb_ListProceduresResponse_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_hbase_pb_SetQuotaRequest_descriptor; private static @@ -56285,288 +57433,293 @@ public final class MasterProtos { java.lang.String[] descriptorData = { "\n\014Master.proto\022\010hbase.pb\032\013HBase.proto\032\014C" + "lient.proto\032\023ClusterStatus.proto\032\023ErrorH" + - "andling.proto\032\013Quota.proto\"\234\001\n\020AddColumn" + + "andling.proto\032\017Procedure.proto\032\013Quota.pr" + + "oto\"\234\001\n\020AddColumnRequest\022\'\n\ntable_name\030\001" + + " \002(\0132\023.hbase.pb.TableName\0225\n\017column_fami" + + "lies\030\002 \002(\0132\034.hbase.pb.ColumnFamilySchema" + + "\022\026\n\013nonce_group\030\003 \001(\004:\0010\022\020\n\005nonce\030\004 \001(\004:" + + "\0010\"\023\n\021AddColumnResponse\"}\n\023DeleteColumnR" + + "equest\022\'\n\ntable_name\030\001 \002(\0132\023.hbase.pb.Ta" + + "bleName\022\023\n\013column_name\030\002 \002(\014\022\026\n\013nonce_gr", + "oup\030\003 \001(\004:\0010\022\020\n\005nonce\030\004 \001(\004:\0010\"\026\n\024Delete" + + "ColumnResponse\"\237\001\n\023ModifyColumnRequest\022\'" + + "\n\ntable_name\030\001 \002(\0132\023.hbase.pb.TableName\022" + + "5\n\017column_families\030\002 \002(\0132\034.hbase.pb.Colu" + + "mnFamilySchema\022\026\n\013nonce_group\030\003 \001(\004:\0010\022\020" + + "\n\005nonce\030\004 \001(\004:\0010\"\026\n\024ModifyColumnResponse" + + "\"n\n\021MoveRegionRequest\022)\n\006region\030\001 \002(\0132\031." + + "hbase.pb.RegionSpecifier\022.\n\020dest_server_" + + "name\030\002 \001(\0132\024.hbase.pb.ServerName\"\024\n\022Move" + + "RegionResponse\"\222\001\n\035DispatchMergingRegion", + "sRequest\022+\n\010region_a\030\001 \002(\0132\031.hbase.pb.Re" + + "gionSpecifier\022+\n\010region_b\030\002 \002(\0132\031.hbase." + + "pb.RegionSpecifier\022\027\n\010forcible\030\003 \001(\010:\005fa" + + "lse\" \n\036DispatchMergingRegionsResponse\"@\n" + + "\023AssignRegionRequest\022)\n\006region\030\001 \002(\0132\031.h" + + "base.pb.RegionSpecifier\"\026\n\024AssignRegionR" + + "esponse\"X\n\025UnassignRegionRequest\022)\n\006regi" + + "on\030\001 \002(\0132\031.hbase.pb.RegionSpecifier\022\024\n\005f" + + "orce\030\002 \001(\010:\005false\"\030\n\026UnassignRegionRespo" + + "nse\"A\n\024OfflineRegionRequest\022)\n\006region\030\001 ", + "\002(\0132\031.hbase.pb.RegionSpecifier\"\027\n\025Offlin" + + "eRegionResponse\"\177\n\022CreateTableRequest\022+\n" + + "\014table_schema\030\001 \002(\0132\025.hbase.pb.TableSche" + + "ma\022\022\n\nsplit_keys\030\002 \003(\014\022\026\n\013nonce_group\030\003 " + + "\001(\004:\0010\022\020\n\005nonce\030\004 \001(\004:\0010\"&\n\023CreateTableR" + + "esponse\022\017\n\007proc_id\030\001 \001(\004\"g\n\022DeleteTableR" + + "equest\022\'\n\ntable_name\030\001 \002(\0132\023.hbase.pb.Ta" + + "bleName\022\026\n\013nonce_group\030\002 \001(\004:\0010\022\020\n\005nonce" + + "\030\003 \001(\004:\0010\"&\n\023DeleteTableResponse\022\017\n\007proc" + + "_id\030\001 \001(\004\"\207\001\n\024TruncateTableRequest\022&\n\tta", + "bleName\030\001 \002(\0132\023.hbase.pb.TableName\022\035\n\016pr" + + "eserveSplits\030\002 \001(\010:\005false\022\026\n\013nonce_group" + + "\030\003 \001(\004:\0010\022\020\n\005nonce\030\004 \001(\004:\0010\"\027\n\025TruncateT" + + "ableResponse\"g\n\022EnableTableRequest\022\'\n\nta" + + "ble_name\030\001 \002(\0132\023.hbase.pb.TableName\022\026\n\013n" + + "once_group\030\002 \001(\004:\0010\022\020\n\005nonce\030\003 \001(\004:\0010\"&\n" + + "\023EnableTableResponse\022\017\n\007proc_id\030\001 \001(\004\"h\n" + + "\023DisableTableRequest\022\'\n\ntable_name\030\001 \002(\013" + + "2\023.hbase.pb.TableName\022\026\n\013nonce_group\030\002 \001" + + "(\004:\0010\022\020\n\005nonce\030\003 \001(\004:\0010\"\'\n\024DisableTableR", + "esponse\022\017\n\007proc_id\030\001 \001(\004\"\224\001\n\022ModifyTable" + "Request\022\'\n\ntable_name\030\001 \002(\0132\023.hbase.pb.T" + - "ableName\0225\n\017column_families\030\002 \002(\0132\034.hbas" + - "e.pb.ColumnFamilySchema\022\026\n\013nonce_group\030\003" + - " \001(\004:\0010\022\020\n\005nonce\030\004 \001(\004:\0010\"\023\n\021AddColumnRe" + - "sponse\"}\n\023DeleteColumnRequest\022\'\n\ntable_n" + - "ame\030\001 \002(\0132\023.hbase.pb.TableName\022\023\n\013column" + - "_name\030\002 \002(\014\022\026\n\013nonce_group\030\003 \001(\004:\0010\022\020\n\005n", - "once\030\004 \001(\004:\0010\"\026\n\024DeleteColumnResponse\"\237\001" + - "\n\023ModifyColumnRequest\022\'\n\ntable_name\030\001 \002(" + - "\0132\023.hbase.pb.TableName\0225\n\017column_familie" + - "s\030\002 \002(\0132\034.hbase.pb.ColumnFamilySchema\022\026\n" + - "\013nonce_group\030\003 \001(\004:\0010\022\020\n\005nonce\030\004 \001(\004:\0010\"" + - "\026\n\024ModifyColumnResponse\"n\n\021MoveRegionReq" + - "uest\022)\n\006region\030\001 \002(\0132\031.hbase.pb.RegionSp" + - "ecifier\022.\n\020dest_server_name\030\002 \001(\0132\024.hbas" + - "e.pb.ServerName\"\024\n\022MoveRegionResponse\"\222\001" + - "\n\035DispatchMergingRegionsRequest\022+\n\010regio", - "n_a\030\001 \002(\0132\031.hbase.pb.RegionSpecifier\022+\n\010" + - "region_b\030\002 \002(\0132\031.hbase.pb.RegionSpecifie" + - "r\022\027\n\010forcible\030\003 \001(\010:\005false\" \n\036DispatchMe" + - "rgingRegionsResponse\"@\n\023AssignRegionRequ" + - "est\022)\n\006region\030\001 \002(\0132\031.hbase.pb.RegionSpe" + - "cifier\"\026\n\024AssignRegionResponse\"X\n\025Unassi" + - "gnRegionRequest\022)\n\006region\030\001 \002(\0132\031.hbase." + - "pb.RegionSpecifier\022\024\n\005force\030\002 \001(\010:\005false" + - "\"\030\n\026UnassignRegionResponse\"A\n\024OfflineReg" + - "ionRequest\022)\n\006region\030\001 \002(\0132\031.hbase.pb.Re", - "gionSpecifier\"\027\n\025OfflineRegionResponse\"\177" + - "\n\022CreateTableRequest\022+\n\014table_schema\030\001 \002" + - "(\0132\025.hbase.pb.TableSchema\022\022\n\nsplit_keys\030" + - "\002 \003(\014\022\026\n\013nonce_group\030\003 \001(\004:\0010\022\020\n\005nonce\030\004" + - " \001(\004:\0010\"&\n\023CreateTableResponse\022\017\n\007proc_i" + - "d\030\001 \001(\004\"g\n\022DeleteTableRequest\022\'\n\ntable_n" + - "ame\030\001 \002(\0132\023.hbase.pb.TableName\022\026\n\013nonce_" + - "group\030\002 \001(\004:\0010\022\020\n\005nonce\030\003 \001(\004:\0010\"&\n\023Dele" + - "teTableResponse\022\017\n\007proc_id\030\001 \001(\004\"\207\001\n\024Tru" + - "ncateTableRequest\022&\n\ttableName\030\001 \002(\0132\023.h", - "base.pb.TableName\022\035\n\016preserveSplits\030\002 \001(" + - "\010:\005false\022\026\n\013nonce_group\030\003 \001(\004:\0010\022\020\n\005nonc" + - "e\030\004 \001(\004:\0010\"\027\n\025TruncateTableResponse\"g\n\022E" + - "nableTableRequest\022\'\n\ntable_name\030\001 \002(\0132\023." + - "hbase.pb.TableName\022\026\n\013nonce_group\030\002 \001(\004:" + - "\0010\022\020\n\005nonce\030\003 \001(\004:\0010\"&\n\023EnableTableRespo" + - "nse\022\017\n\007proc_id\030\001 \001(\004\"h\n\023DisableTableRequ" + - "est\022\'\n\ntable_name\030\001 \002(\0132\023.hbase.pb.Table" + - "Name\022\026\n\013nonce_group\030\002 \001(\004:\0010\022\020\n\005nonce\030\003 " + - "\001(\004:\0010\"\'\n\024DisableTableResponse\022\017\n\007proc_i", - "d\030\001 \001(\004\"\224\001\n\022ModifyTableRequest\022\'\n\ntable_" + - "name\030\001 \002(\0132\023.hbase.pb.TableName\022+\n\014table" + - "_schema\030\002 \002(\0132\025.hbase.pb.TableSchema\022\026\n\013" + - "nonce_group\030\003 \001(\004:\0010\022\020\n\005nonce\030\004 \001(\004:\0010\"\025" + - "\n\023ModifyTableResponse\"~\n\026CreateNamespace" + - "Request\022:\n\023namespaceDescriptor\030\001 \002(\0132\035.h" + - "base.pb.NamespaceDescriptor\022\026\n\013nonce_gro" + - "up\030\002 \001(\004:\0010\022\020\n\005nonce\030\003 \001(\004:\0010\"\031\n\027CreateN" + - "amespaceResponse\"Y\n\026DeleteNamespaceReque" + - "st\022\025\n\rnamespaceName\030\001 \002(\t\022\026\n\013nonce_group", - "\030\002 \001(\004:\0010\022\020\n\005nonce\030\003 \001(\004:\0010\"\031\n\027DeleteNam" + - "espaceResponse\"~\n\026ModifyNamespaceRequest" + - "\022:\n\023namespaceDescriptor\030\001 \002(\0132\035.hbase.pb" + - ".NamespaceDescriptor\022\026\n\013nonce_group\030\002 \001(" + - "\004:\0010\022\020\n\005nonce\030\003 \001(\004:\0010\"\031\n\027ModifyNamespac" + - "eResponse\"6\n\035GetNamespaceDescriptorReque" + - "st\022\025\n\rnamespaceName\030\001 \002(\t\"\\\n\036GetNamespac" + - "eDescriptorResponse\022:\n\023namespaceDescript" + - "or\030\001 \002(\0132\035.hbase.pb.NamespaceDescriptor\"" + - "!\n\037ListNamespaceDescriptorsRequest\"^\n Li", - "stNamespaceDescriptorsResponse\022:\n\023namesp" + - "aceDescriptor\030\001 \003(\0132\035.hbase.pb.Namespace" + - "Descriptor\"?\n&ListTableDescriptorsByName" + - "spaceRequest\022\025\n\rnamespaceName\030\001 \002(\t\"U\n\'L" + - "istTableDescriptorsByNamespaceResponse\022*" + - "\n\013tableSchema\030\001 \003(\0132\025.hbase.pb.TableSche" + - "ma\"9\n ListTableNamesByNamespaceRequest\022\025" + - "\n\rnamespaceName\030\001 \002(\t\"K\n!ListTableNamesB" + - "yNamespaceResponse\022&\n\ttableName\030\001 \003(\0132\023." + - "hbase.pb.TableName\"\021\n\017ShutdownRequest\"\022\n", - "\020ShutdownResponse\"\023\n\021StopMasterRequest\"\024" + - "\n\022StopMasterResponse\"\037\n\016BalanceRequest\022\r" + - "\n\005force\030\001 \001(\010\"\'\n\017BalanceResponse\022\024\n\014bala" + - "ncer_ran\030\001 \002(\010\"<\n\031SetBalancerRunningRequ" + - "est\022\n\n\002on\030\001 \002(\010\022\023\n\013synchronous\030\002 \001(\010\"8\n\032" + - "SetBalancerRunningResponse\022\032\n\022prev_balan" + - "ce_value\030\001 \001(\010\"\032\n\030IsBalancerEnabledReque" + - "st\",\n\031IsBalancerEnabledResponse\022\017\n\007enabl" + - "ed\030\001 \002(\010\"\027\n\025RunCatalogScanRequest\"-\n\026Run" + - "CatalogScanResponse\022\023\n\013scan_result\030\001 \001(\005", - "\"-\n\033EnableCatalogJanitorRequest\022\016\n\006enabl" + - "e\030\001 \002(\010\"2\n\034EnableCatalogJanitorResponse\022" + - "\022\n\nprev_value\030\001 \001(\010\" \n\036IsCatalogJanitorE" + - "nabledRequest\"0\n\037IsCatalogJanitorEnabled" + - "Response\022\r\n\005value\030\001 \002(\010\"B\n\017SnapshotReque" + - "st\022/\n\010snapshot\030\001 \002(\0132\035.hbase.pb.Snapshot" + - "Description\",\n\020SnapshotResponse\022\030\n\020expec" + - "ted_timeout\030\001 \002(\003\"\036\n\034GetCompletedSnapsho" + - "tsRequest\"Q\n\035GetCompletedSnapshotsRespon" + - "se\0220\n\tsnapshots\030\001 \003(\0132\035.hbase.pb.Snapsho", - "tDescription\"H\n\025DeleteSnapshotRequest\022/\n" + - "\010snapshot\030\001 \002(\0132\035.hbase.pb.SnapshotDescr" + - "iption\"\030\n\026DeleteSnapshotResponse\"I\n\026Rest" + - "oreSnapshotRequest\022/\n\010snapshot\030\001 \002(\0132\035.h" + - "base.pb.SnapshotDescription\"\031\n\027RestoreSn" + - "apshotResponse\"H\n\025IsSnapshotDoneRequest\022" + - "/\n\010snapshot\030\001 \001(\0132\035.hbase.pb.SnapshotDes" + - "cription\"^\n\026IsSnapshotDoneResponse\022\023\n\004do" + - "ne\030\001 \001(\010:\005false\022/\n\010snapshot\030\002 \001(\0132\035.hbas" + - "e.pb.SnapshotDescription\"O\n\034IsRestoreSna", + "ableName\022+\n\014table_schema\030\002 \002(\0132\025.hbase.p" + + "b.TableSchema\022\026\n\013nonce_group\030\003 \001(\004:\0010\022\020\n" + + "\005nonce\030\004 \001(\004:\0010\"\025\n\023ModifyTableResponse\"~" + + "\n\026CreateNamespaceRequest\022:\n\023namespaceDes" + + "criptor\030\001 \002(\0132\035.hbase.pb.NamespaceDescri" + + "ptor\022\026\n\013nonce_group\030\002 \001(\004:\0010\022\020\n\005nonce\030\003 " + + "\001(\004:\0010\"\031\n\027CreateNamespaceResponse\"Y\n\026Del" + + "eteNamespaceRequest\022\025\n\rnamespaceName\030\001 \002", + "(\t\022\026\n\013nonce_group\030\002 \001(\004:\0010\022\020\n\005nonce\030\003 \001(" + + "\004:\0010\"\031\n\027DeleteNamespaceResponse\"~\n\026Modif" + + "yNamespaceRequest\022:\n\023namespaceDescriptor" + + "\030\001 \002(\0132\035.hbase.pb.NamespaceDescriptor\022\026\n" + + "\013nonce_group\030\002 \001(\004:\0010\022\020\n\005nonce\030\003 \001(\004:\0010\"" + + "\031\n\027ModifyNamespaceResponse\"6\n\035GetNamespa" + + "ceDescriptorRequest\022\025\n\rnamespaceName\030\001 \002" + + "(\t\"\\\n\036GetNamespaceDescriptorResponse\022:\n\023" + + "namespaceDescriptor\030\001 \002(\0132\035.hbase.pb.Nam" + + "espaceDescriptor\"!\n\037ListNamespaceDescrip", + "torsRequest\"^\n ListNamespaceDescriptorsR" + + "esponse\022:\n\023namespaceDescriptor\030\001 \003(\0132\035.h" + + "base.pb.NamespaceDescriptor\"?\n&ListTable" + + "DescriptorsByNamespaceRequest\022\025\n\rnamespa" + + "ceName\030\001 \002(\t\"U\n\'ListTableDescriptorsByNa" + + "mespaceResponse\022*\n\013tableSchema\030\001 \003(\0132\025.h" + + "base.pb.TableSchema\"9\n ListTableNamesByN" + + "amespaceRequest\022\025\n\rnamespaceName\030\001 \002(\t\"K" + + "\n!ListTableNamesByNamespaceResponse\022&\n\tt" + + "ableName\030\001 \003(\0132\023.hbase.pb.TableName\"\021\n\017S", + "hutdownRequest\"\022\n\020ShutdownResponse\"\023\n\021St" + + "opMasterRequest\"\024\n\022StopMasterResponse\"\037\n" + + "\016BalanceRequest\022\r\n\005force\030\001 \001(\010\"\'\n\017Balanc" + + "eResponse\022\024\n\014balancer_ran\030\001 \002(\010\"<\n\031SetBa" + + "lancerRunningRequest\022\n\n\002on\030\001 \002(\010\022\023\n\013sync" + + "hronous\030\002 \001(\010\"8\n\032SetBalancerRunningRespo" + + "nse\022\032\n\022prev_balance_value\030\001 \001(\010\"\032\n\030IsBal" + + "ancerEnabledRequest\",\n\031IsBalancerEnabled" + + "Response\022\017\n\007enabled\030\001 \002(\010\"\027\n\025RunCatalogS" + + "canRequest\"-\n\026RunCatalogScanResponse\022\023\n\013", + "scan_result\030\001 \001(\005\"-\n\033EnableCatalogJanito" + + "rRequest\022\016\n\006enable\030\001 \002(\010\"2\n\034EnableCatalo" + + "gJanitorResponse\022\022\n\nprev_value\030\001 \001(\010\" \n\036" + + "IsCatalogJanitorEnabledRequest\"0\n\037IsCata" + + "logJanitorEnabledResponse\022\r\n\005value\030\001 \002(\010" + + "\"B\n\017SnapshotRequest\022/\n\010snapshot\030\001 \002(\0132\035." + + "hbase.pb.SnapshotDescription\",\n\020Snapshot" + + "Response\022\030\n\020expected_timeout\030\001 \002(\003\"\036\n\034Ge" + + "tCompletedSnapshotsRequest\"Q\n\035GetComplet" + + "edSnapshotsResponse\0220\n\tsnapshots\030\001 \003(\0132\035", + ".hbase.pb.SnapshotDescription\"H\n\025DeleteS" + + "napshotRequest\022/\n\010snapshot\030\001 \002(\0132\035.hbase" + + ".pb.SnapshotDescription\"\030\n\026DeleteSnapsho" + + "tResponse\"I\n\026RestoreSnapshotRequest\022/\n\010s" + + "napshot\030\001 \002(\0132\035.hbase.pb.SnapshotDescrip" + + "tion\"\031\n\027RestoreSnapshotResponse\"H\n\025IsSna" + "pshotDoneRequest\022/\n\010snapshot\030\001 \001(\0132\035.hba" + - "se.pb.SnapshotDescription\"4\n\035IsRestoreSn" + - "apshotDoneResponse\022\023\n\004done\030\001 \001(\010:\005false\"" + - "F\n\033GetSchemaAlterStatusRequest\022\'\n\ntable_" + - "name\030\001 \002(\0132\023.hbase.pb.TableName\"T\n\034GetSc" + - "hemaAlterStatusResponse\022\035\n\025yet_to_update" + - "_regions\030\001 \001(\r\022\025\n\rtotal_regions\030\002 \001(\r\"\213\001" + - "\n\032GetTableDescriptorsRequest\022(\n\013table_na" + - "mes\030\001 \003(\0132\023.hbase.pb.TableName\022\r\n\005regex\030" + - "\002 \001(\t\022!\n\022include_sys_tables\030\003 \001(\010:\005false", - "\022\021\n\tnamespace\030\004 \001(\t\"J\n\033GetTableDescripto" + - "rsResponse\022+\n\014table_schema\030\001 \003(\0132\025.hbase" + - ".pb.TableSchema\"[\n\024GetTableNamesRequest\022" + - "\r\n\005regex\030\001 \001(\t\022!\n\022include_sys_tables\030\002 \001" + - "(\010:\005false\022\021\n\tnamespace\030\003 \001(\t\"A\n\025GetTable" + - "NamesResponse\022(\n\013table_names\030\001 \003(\0132\023.hba" + - "se.pb.TableName\"\031\n\027GetClusterStatusReque" + - "st\"K\n\030GetClusterStatusResponse\022/\n\016cluste" + - "r_status\030\001 \002(\0132\027.hbase.pb.ClusterStatus\"" + - "\030\n\026IsMasterRunningRequest\"4\n\027IsMasterRun", - "ningResponse\022\031\n\021is_master_running\030\001 \002(\010\"" + - "I\n\024ExecProcedureRequest\0221\n\tprocedure\030\001 \002" + - "(\0132\036.hbase.pb.ProcedureDescription\"F\n\025Ex" + - "ecProcedureResponse\022\030\n\020expected_timeout\030" + - "\001 \001(\003\022\023\n\013return_data\030\002 \001(\014\"K\n\026IsProcedur" + - "eDoneRequest\0221\n\tprocedure\030\001 \001(\0132\036.hbase." + - "pb.ProcedureDescription\"`\n\027IsProcedureDo" + - "neResponse\022\023\n\004done\030\001 \001(\010:\005false\0220\n\010snaps" + - "hot\030\002 \001(\0132\036.hbase.pb.ProcedureDescriptio" + - "n\",\n\031GetProcedureResultRequest\022\017\n\007proc_i", - "d\030\001 \002(\004\"\371\001\n\032GetProcedureResultResponse\0229" + - "\n\005state\030\001 \002(\0162*.hbase.pb.GetProcedureRes" + - "ultResponse.State\022\022\n\nstart_time\030\002 \001(\004\022\023\n" + - "\013last_update\030\003 \001(\004\022\016\n\006result\030\004 \001(\014\0224\n\tex" + - "ception\030\005 \001(\0132!.hbase.pb.ForeignExceptio" + - "nMessage\"1\n\005State\022\r\n\tNOT_FOUND\020\000\022\013\n\007RUNN" + - "ING\020\001\022\014\n\010FINISHED\020\002\"M\n\025AbortProcedureReq" + - "uest\022\017\n\007proc_id\030\001 \002(\004\022#\n\025mayInterruptIfR" + - "unning\030\002 \001(\010:\004true\"6\n\026AbortProcedureResp" + - "onse\022\034\n\024is_procedure_aborted\030\001 \002(\010\"\315\001\n\017S", - "etQuotaRequest\022\021\n\tuser_name\030\001 \001(\t\022\022\n\nuse" + - "r_group\030\002 \001(\t\022\021\n\tnamespace\030\003 \001(\t\022\'\n\ntabl" + - "e_name\030\004 \001(\0132\023.hbase.pb.TableName\022\022\n\nrem" + - "ove_all\030\005 \001(\010\022\026\n\016bypass_globals\030\006 \001(\010\022+\n" + - "\010throttle\030\007 \001(\0132\031.hbase.pb.ThrottleReque" + - "st\"\022\n\020SetQuotaResponse\"J\n\037MajorCompactio" + - "nTimestampRequest\022\'\n\ntable_name\030\001 \002(\0132\023." + - "hbase.pb.TableName\"U\n(MajorCompactionTim" + - "estampForRegionRequest\022)\n\006region\030\001 \002(\0132\031" + - ".hbase.pb.RegionSpecifier\"@\n MajorCompac", - "tionTimestampResponse\022\034\n\024compaction_time" + - "stamp\030\001 \002(\003\"\035\n\033SecurityCapabilitiesReque" + - "st\"\354\001\n\034SecurityCapabilitiesResponse\022G\n\014c" + - "apabilities\030\001 \003(\01621.hbase.pb.SecurityCap" + - "abilitiesResponse.Capability\"\202\001\n\nCapabil" + - "ity\022\031\n\025SIMPLE_AUTHENTICATION\020\000\022\031\n\025SECURE" + - "_AUTHENTICATION\020\001\022\021\n\rAUTHORIZATION\020\002\022\026\n\022" + - "CELL_AUTHORIZATION\020\003\022\023\n\017CELL_VISIBILITY\020" + - "\0042\304#\n\rMasterService\022e\n\024GetSchemaAlterSta" + - "tus\022%.hbase.pb.GetSchemaAlterStatusReque", - "st\032&.hbase.pb.GetSchemaAlterStatusRespon" + - "se\022b\n\023GetTableDescriptors\022$.hbase.pb.Get" + - "TableDescriptorsRequest\032%.hbase.pb.GetTa" + - "bleDescriptorsResponse\022P\n\rGetTableNames\022" + - "\036.hbase.pb.GetTableNamesRequest\032\037.hbase." + - "pb.GetTableNamesResponse\022Y\n\020GetClusterSt" + - "atus\022!.hbase.pb.GetClusterStatusRequest\032" + - "\".hbase.pb.GetClusterStatusResponse\022V\n\017I" + - "sMasterRunning\022 .hbase.pb.IsMasterRunnin" + - "gRequest\032!.hbase.pb.IsMasterRunningRespo", - "nse\022D\n\tAddColumn\022\032.hbase.pb.AddColumnReq" + - "uest\032\033.hbase.pb.AddColumnResponse\022M\n\014Del" + - "eteColumn\022\035.hbase.pb.DeleteColumnRequest" + - "\032\036.hbase.pb.DeleteColumnResponse\022M\n\014Modi" + - "fyColumn\022\035.hbase.pb.ModifyColumnRequest\032" + - "\036.hbase.pb.ModifyColumnResponse\022G\n\nMoveR" + - "egion\022\033.hbase.pb.MoveRegionRequest\032\034.hba" + - "se.pb.MoveRegionResponse\022k\n\026DispatchMerg" + - "ingRegions\022\'.hbase.pb.DispatchMergingReg" + - "ionsRequest\032(.hbase.pb.DispatchMergingRe", - "gionsResponse\022M\n\014AssignRegion\022\035.hbase.pb" + - ".AssignRegionRequest\032\036.hbase.pb.AssignRe" + - "gionResponse\022S\n\016UnassignRegion\022\037.hbase.p" + - "b.UnassignRegionRequest\032 .hbase.pb.Unass" + - "ignRegionResponse\022P\n\rOfflineRegion\022\036.hba" + - "se.pb.OfflineRegionRequest\032\037.hbase.pb.Of" + - "flineRegionResponse\022J\n\013DeleteTable\022\034.hba" + - "se.pb.DeleteTableRequest\032\035.hbase.pb.Dele" + - "teTableResponse\022P\n\rtruncateTable\022\036.hbase" + - ".pb.TruncateTableRequest\032\037.hbase.pb.Trun", - "cateTableResponse\022J\n\013EnableTable\022\034.hbase" + - ".pb.EnableTableRequest\032\035.hbase.pb.Enable" + - "TableResponse\022M\n\014DisableTable\022\035.hbase.pb" + - ".DisableTableRequest\032\036.hbase.pb.DisableT" + - "ableResponse\022J\n\013ModifyTable\022\034.hbase.pb.M" + - "odifyTableRequest\032\035.hbase.pb.ModifyTable" + - "Response\022J\n\013CreateTable\022\034.hbase.pb.Creat" + - "eTableRequest\032\035.hbase.pb.CreateTableResp" + - "onse\022A\n\010Shutdown\022\031.hbase.pb.ShutdownRequ" + - "est\032\032.hbase.pb.ShutdownResponse\022G\n\nStopM", - "aster\022\033.hbase.pb.StopMasterRequest\032\034.hba" + - "se.pb.StopMasterResponse\022>\n\007Balance\022\030.hb" + - "ase.pb.BalanceRequest\032\031.hbase.pb.Balance" + - "Response\022_\n\022SetBalancerRunning\022#.hbase.p" + - "b.SetBalancerRunningRequest\032$.hbase.pb.S" + - "etBalancerRunningResponse\022\\\n\021IsBalancerE" + - "nabled\022\".hbase.pb.IsBalancerEnabledReque" + - "st\032#.hbase.pb.IsBalancerEnabledResponse\022" + - "S\n\016RunCatalogScan\022\037.hbase.pb.RunCatalogS" + - "canRequest\032 .hbase.pb.RunCatalogScanResp", - "onse\022e\n\024EnableCatalogJanitor\022%.hbase.pb." + - "EnableCatalogJanitorRequest\032&.hbase.pb.E" + - "nableCatalogJanitorResponse\022n\n\027IsCatalog" + - "JanitorEnabled\022(.hbase.pb.IsCatalogJanit" + - "orEnabledRequest\032).hbase.pb.IsCatalogJan" + - "itorEnabledResponse\022^\n\021ExecMasterService" + - "\022#.hbase.pb.CoprocessorServiceRequest\032$." + - "hbase.pb.CoprocessorServiceResponse\022A\n\010S" + - "napshot\022\031.hbase.pb.SnapshotRequest\032\032.hba" + - "se.pb.SnapshotResponse\022h\n\025GetCompletedSn", - "apshots\022&.hbase.pb.GetCompletedSnapshots" + - "Request\032\'.hbase.pb.GetCompletedSnapshots" + - "Response\022S\n\016DeleteSnapshot\022\037.hbase.pb.De" + - "leteSnapshotRequest\032 .hbase.pb.DeleteSna" + - "pshotResponse\022S\n\016IsSnapshotDone\022\037.hbase." + - "pb.IsSnapshotDoneRequest\032 .hbase.pb.IsSn" + - "apshotDoneResponse\022V\n\017RestoreSnapshot\022 ." + - "hbase.pb.RestoreSnapshotRequest\032!.hbase." + - "pb.RestoreSnapshotResponse\022h\n\025IsRestoreS" + - "napshotDone\022&.hbase.pb.IsRestoreSnapshot", - "DoneRequest\032\'.hbase.pb.IsRestoreSnapshot" + - "DoneResponse\022P\n\rExecProcedure\022\036.hbase.pb" + - ".ExecProcedureRequest\032\037.hbase.pb.ExecPro" + - "cedureResponse\022W\n\024ExecProcedureWithRet\022\036" + - ".hbase.pb.ExecProcedureRequest\032\037.hbase.p" + - "b.ExecProcedureResponse\022V\n\017IsProcedureDo" + - "ne\022 .hbase.pb.IsProcedureDoneRequest\032!.h" + - "base.pb.IsProcedureDoneResponse\022V\n\017Modif" + - "yNamespace\022 .hbase.pb.ModifyNamespaceReq" + - "uest\032!.hbase.pb.ModifyNamespaceResponse\022", - "V\n\017CreateNamespace\022 .hbase.pb.CreateName" + - "spaceRequest\032!.hbase.pb.CreateNamespaceR" + - "esponse\022V\n\017DeleteNamespace\022 .hbase.pb.De" + - "leteNamespaceRequest\032!.hbase.pb.DeleteNa" + - "mespaceResponse\022k\n\026GetNamespaceDescripto" + - "r\022\'.hbase.pb.GetNamespaceDescriptorReque" + - "st\032(.hbase.pb.GetNamespaceDescriptorResp" + - "onse\022q\n\030ListNamespaceDescriptors\022).hbase" + - ".pb.ListNamespaceDescriptorsRequest\032*.hb" + - "ase.pb.ListNamespaceDescriptorsResponse\022", - "\206\001\n\037ListTableDescriptorsByNamespace\0220.hb" + - "ase.pb.ListTableDescriptorsByNamespaceRe" + - "quest\0321.hbase.pb.ListTableDescriptorsByN" + - "amespaceResponse\022t\n\031ListTableNamesByName" + - "space\022*.hbase.pb.ListTableNamesByNamespa" + - "ceRequest\032+.hbase.pb.ListTableNamesByNam" + - "espaceResponse\022A\n\010SetQuota\022\031.hbase.pb.Se" + - "tQuotaRequest\032\032.hbase.pb.SetQuotaRespons" + - "e\022x\n\037getLastMajorCompactionTimestamp\022).h" + - "base.pb.MajorCompactionTimestampRequest\032", - "*.hbase.pb.MajorCompactionTimestampRespo" + - "nse\022\212\001\n(getLastMajorCompactionTimestampF" + - "orRegion\0222.hbase.pb.MajorCompactionTimes" + - "tampForRegionRequest\032*.hbase.pb.MajorCom" + - "pactionTimestampResponse\022_\n\022getProcedure" + - "Result\022#.hbase.pb.GetProcedureResultRequ" + - "est\032$.hbase.pb.GetProcedureResultRespons" + - "e\022h\n\027getSecurityCapabilities\022%.hbase.pb." + - "SecurityCapabilitiesRequest\032&.hbase.pb.S" + - "ecurityCapabilitiesResponse\022S\n\016AbortProc", - "edure\022\037.hbase.pb.AbortProcedureRequest\032 " + - ".hbase.pb.AbortProcedureResponseBB\n*org." + - "apache.hadoop.hbase.protobuf.generatedB\014" + - "MasterProtosH\001\210\001\001\240\001\001" + "se.pb.SnapshotDescription\"^\n\026IsSnapshotD" + + "oneResponse\022\023\n\004done\030\001 \001(\010:\005false\022/\n\010snap" + + "shot\030\002 \001(\0132\035.hbase.pb.SnapshotDescriptio", + "n\"O\n\034IsRestoreSnapshotDoneRequest\022/\n\010sna" + + "pshot\030\001 \001(\0132\035.hbase.pb.SnapshotDescripti" + + "on\"4\n\035IsRestoreSnapshotDoneResponse\022\023\n\004d" + + "one\030\001 \001(\010:\005false\"F\n\033GetSchemaAlterStatus" + + "Request\022\'\n\ntable_name\030\001 \002(\0132\023.hbase.pb.T" + + "ableName\"T\n\034GetSchemaAlterStatusResponse" + + "\022\035\n\025yet_to_update_regions\030\001 \001(\r\022\025\n\rtotal" + + "_regions\030\002 \001(\r\"\213\001\n\032GetTableDescriptorsRe" + + "quest\022(\n\013table_names\030\001 \003(\0132\023.hbase.pb.Ta" + + "bleName\022\r\n\005regex\030\002 \001(\t\022!\n\022include_sys_ta", + "bles\030\003 \001(\010:\005false\022\021\n\tnamespace\030\004 \001(\t\"J\n\033" + + "GetTableDescriptorsResponse\022+\n\014table_sch" + + "ema\030\001 \003(\0132\025.hbase.pb.TableSchema\"[\n\024GetT" + + "ableNamesRequest\022\r\n\005regex\030\001 \001(\t\022!\n\022inclu" + + "de_sys_tables\030\002 \001(\010:\005false\022\021\n\tnamespace\030" + + "\003 \001(\t\"A\n\025GetTableNamesResponse\022(\n\013table_" + + "names\030\001 \003(\0132\023.hbase.pb.TableName\"\031\n\027GetC" + + "lusterStatusRequest\"K\n\030GetClusterStatusR" + + "esponse\022/\n\016cluster_status\030\001 \002(\0132\027.hbase." + + "pb.ClusterStatus\"\030\n\026IsMasterRunningReque", + "st\"4\n\027IsMasterRunningResponse\022\031\n\021is_mast" + + "er_running\030\001 \002(\010\"I\n\024ExecProcedureRequest" + + "\0221\n\tprocedure\030\001 \002(\0132\036.hbase.pb.Procedure" + + "Description\"F\n\025ExecProcedureResponse\022\030\n\020" + + "expected_timeout\030\001 \001(\003\022\023\n\013return_data\030\002 " + + "\001(\014\"K\n\026IsProcedureDoneRequest\0221\n\tprocedu" + + "re\030\001 \001(\0132\036.hbase.pb.ProcedureDescription" + + "\"`\n\027IsProcedureDoneResponse\022\023\n\004done\030\001 \001(" + + "\010:\005false\0220\n\010snapshot\030\002 \001(\0132\036.hbase.pb.Pr" + + "ocedureDescription\",\n\031GetProcedureResult", + "Request\022\017\n\007proc_id\030\001 \002(\004\"\371\001\n\032GetProcedur" + + "eResultResponse\0229\n\005state\030\001 \002(\0162*.hbase.p" + + "b.GetProcedureResultResponse.State\022\022\n\nst" + + "art_time\030\002 \001(\004\022\023\n\013last_update\030\003 \001(\004\022\016\n\006r" + + "esult\030\004 \001(\014\0224\n\texception\030\005 \001(\0132!.hbase.p" + + "b.ForeignExceptionMessage\"1\n\005State\022\r\n\tNO" + + "T_FOUND\020\000\022\013\n\007RUNNING\020\001\022\014\n\010FINISHED\020\002\"M\n\025" + + "AbortProcedureRequest\022\017\n\007proc_id\030\001 \002(\004\022#" + + "\n\025mayInterruptIfRunning\030\002 \001(\010:\004true\"6\n\026A" + + "bortProcedureResponse\022\034\n\024is_procedure_ab", + "orted\030\001 \002(\010\"\027\n\025ListProceduresRequest\"@\n\026" + + "ListProceduresResponse\022&\n\tprocedure\030\001 \003(" + + "\0132\023.hbase.pb.Procedure\"\315\001\n\017SetQuotaReque" + + "st\022\021\n\tuser_name\030\001 \001(\t\022\022\n\nuser_group\030\002 \001(" + + "\t\022\021\n\tnamespace\030\003 \001(\t\022\'\n\ntable_name\030\004 \001(\013" + + "2\023.hbase.pb.TableName\022\022\n\nremove_all\030\005 \001(" + + "\010\022\026\n\016bypass_globals\030\006 \001(\010\022+\n\010throttle\030\007 " + + "\001(\0132\031.hbase.pb.ThrottleRequest\"\022\n\020SetQuo" + + "taResponse\"J\n\037MajorCompactionTimestampRe" + + "quest\022\'\n\ntable_name\030\001 \002(\0132\023.hbase.pb.Tab", + "leName\"U\n(MajorCompactionTimestampForReg" + + "ionRequest\022)\n\006region\030\001 \002(\0132\031.hbase.pb.Re" + + "gionSpecifier\"@\n MajorCompactionTimestam" + + "pResponse\022\034\n\024compaction_timestamp\030\001 \002(\003\"" + + "\035\n\033SecurityCapabilitiesRequest\"\354\001\n\034Secur" + + "ityCapabilitiesResponse\022G\n\014capabilities\030" + + "\001 \003(\01621.hbase.pb.SecurityCapabilitiesRes" + + "ponse.Capability\"\202\001\n\nCapability\022\031\n\025SIMPL" + + "E_AUTHENTICATION\020\000\022\031\n\025SECURE_AUTHENTICAT" + + "ION\020\001\022\021\n\rAUTHORIZATION\020\002\022\026\n\022CELL_AUTHORI", + "ZATION\020\003\022\023\n\017CELL_VISIBILITY\020\0042\231$\n\rMaster" + + "Service\022e\n\024GetSchemaAlterStatus\022%.hbase." + + "pb.GetSchemaAlterStatusRequest\032&.hbase.p" + + "b.GetSchemaAlterStatusResponse\022b\n\023GetTab" + + "leDescriptors\022$.hbase.pb.GetTableDescrip" + + "torsRequest\032%.hbase.pb.GetTableDescripto" + + "rsResponse\022P\n\rGetTableNames\022\036.hbase.pb.G" + + "etTableNamesRequest\032\037.hbase.pb.GetTableN" + + "amesResponse\022Y\n\020GetClusterStatus\022!.hbase" + + ".pb.GetClusterStatusRequest\032\".hbase.pb.G", + "etClusterStatusResponse\022V\n\017IsMasterRunni" + + "ng\022 .hbase.pb.IsMasterRunningRequest\032!.h" + + "base.pb.IsMasterRunningResponse\022D\n\tAddCo" + + "lumn\022\032.hbase.pb.AddColumnRequest\032\033.hbase" + + ".pb.AddColumnResponse\022M\n\014DeleteColumn\022\035." + + "hbase.pb.DeleteColumnRequest\032\036.hbase.pb." + + "DeleteColumnResponse\022M\n\014ModifyColumn\022\035.h" + + "base.pb.ModifyColumnRequest\032\036.hbase.pb.M" + + "odifyColumnResponse\022G\n\nMoveRegion\022\033.hbas" + + "e.pb.MoveRegionRequest\032\034.hbase.pb.MoveRe", + "gionResponse\022k\n\026DispatchMergingRegions\022\'" + + ".hbase.pb.DispatchMergingRegionsRequest\032" + + "(.hbase.pb.DispatchMergingRegionsRespons" + + "e\022M\n\014AssignRegion\022\035.hbase.pb.AssignRegio" + + "nRequest\032\036.hbase.pb.AssignRegionResponse" + + "\022S\n\016UnassignRegion\022\037.hbase.pb.UnassignRe" + + "gionRequest\032 .hbase.pb.UnassignRegionRes" + + "ponse\022P\n\rOfflineRegion\022\036.hbase.pb.Offlin" + + "eRegionRequest\032\037.hbase.pb.OfflineRegionR" + + "esponse\022J\n\013DeleteTable\022\034.hbase.pb.Delete", + "TableRequest\032\035.hbase.pb.DeleteTableRespo" + + "nse\022P\n\rtruncateTable\022\036.hbase.pb.Truncate" + + "TableRequest\032\037.hbase.pb.TruncateTableRes" + + "ponse\022J\n\013EnableTable\022\034.hbase.pb.EnableTa" + + "bleRequest\032\035.hbase.pb.EnableTableRespons" + + "e\022M\n\014DisableTable\022\035.hbase.pb.DisableTabl" + + "eRequest\032\036.hbase.pb.DisableTableResponse" + + "\022J\n\013ModifyTable\022\034.hbase.pb.ModifyTableRe" + + "quest\032\035.hbase.pb.ModifyTableResponse\022J\n\013" + + "CreateTable\022\034.hbase.pb.CreateTableReques", + "t\032\035.hbase.pb.CreateTableResponse\022A\n\010Shut" + + "down\022\031.hbase.pb.ShutdownRequest\032\032.hbase." + + "pb.ShutdownResponse\022G\n\nStopMaster\022\033.hbas" + + "e.pb.StopMasterRequest\032\034.hbase.pb.StopMa" + + "sterResponse\022>\n\007Balance\022\030.hbase.pb.Balan" + + "ceRequest\032\031.hbase.pb.BalanceResponse\022_\n\022" + + "SetBalancerRunning\022#.hbase.pb.SetBalance" + + "rRunningRequest\032$.hbase.pb.SetBalancerRu" + + "nningResponse\022\\\n\021IsBalancerEnabled\022\".hba" + + "se.pb.IsBalancerEnabledRequest\032#.hbase.p", + "b.IsBalancerEnabledResponse\022S\n\016RunCatalo" + + "gScan\022\037.hbase.pb.RunCatalogScanRequest\032 " + + ".hbase.pb.RunCatalogScanResponse\022e\n\024Enab" + + "leCatalogJanitor\022%.hbase.pb.EnableCatalo" + + "gJanitorRequest\032&.hbase.pb.EnableCatalog" + + "JanitorResponse\022n\n\027IsCatalogJanitorEnabl" + + "ed\022(.hbase.pb.IsCatalogJanitorEnabledReq" + + "uest\032).hbase.pb.IsCatalogJanitorEnabledR" + + "esponse\022^\n\021ExecMasterService\022#.hbase.pb." + + "CoprocessorServiceRequest\032$.hbase.pb.Cop", + "rocessorServiceResponse\022A\n\010Snapshot\022\031.hb" + + "ase.pb.SnapshotRequest\032\032.hbase.pb.Snapsh" + + "otResponse\022h\n\025GetCompletedSnapshots\022&.hb" + + "ase.pb.GetCompletedSnapshotsRequest\032\'.hb" + + "ase.pb.GetCompletedSnapshotsResponse\022S\n\016" + + "DeleteSnapshot\022\037.hbase.pb.DeleteSnapshot" + + "Request\032 .hbase.pb.DeleteSnapshotRespons" + + "e\022S\n\016IsSnapshotDone\022\037.hbase.pb.IsSnapsho" + + "tDoneRequest\032 .hbase.pb.IsSnapshotDoneRe" + + "sponse\022V\n\017RestoreSnapshot\022 .hbase.pb.Res", + "toreSnapshotRequest\032!.hbase.pb.RestoreSn" + + "apshotResponse\022h\n\025IsRestoreSnapshotDone\022" + + "&.hbase.pb.IsRestoreSnapshotDoneRequest\032" + + "\'.hbase.pb.IsRestoreSnapshotDoneResponse" + + "\022P\n\rExecProcedure\022\036.hbase.pb.ExecProcedu" + + "reRequest\032\037.hbase.pb.ExecProcedureRespon" + + "se\022W\n\024ExecProcedureWithRet\022\036.hbase.pb.Ex" + + "ecProcedureRequest\032\037.hbase.pb.ExecProced" + + "ureResponse\022V\n\017IsProcedureDone\022 .hbase.p" + + "b.IsProcedureDoneRequest\032!.hbase.pb.IsPr", + "ocedureDoneResponse\022V\n\017ModifyNamespace\022 " + + ".hbase.pb.ModifyNamespaceRequest\032!.hbase" + + ".pb.ModifyNamespaceResponse\022V\n\017CreateNam" + + "espace\022 .hbase.pb.CreateNamespaceRequest" + + "\032!.hbase.pb.CreateNamespaceResponse\022V\n\017D" + + "eleteNamespace\022 .hbase.pb.DeleteNamespac" + + "eRequest\032!.hbase.pb.DeleteNamespaceRespo" + + "nse\022k\n\026GetNamespaceDescriptor\022\'.hbase.pb" + + ".GetNamespaceDescriptorRequest\032(.hbase.p" + + "b.GetNamespaceDescriptorResponse\022q\n\030List", + "NamespaceDescriptors\022).hbase.pb.ListName" + + "spaceDescriptorsRequest\032*.hbase.pb.ListN" + + "amespaceDescriptorsResponse\022\206\001\n\037ListTabl" + + "eDescriptorsByNamespace\0220.hbase.pb.ListT" + + "ableDescriptorsByNamespaceRequest\0321.hbas" + + "e.pb.ListTableDescriptorsByNamespaceResp" + + "onse\022t\n\031ListTableNamesByNamespace\022*.hbas" + + "e.pb.ListTableNamesByNamespaceRequest\032+." + + "hbase.pb.ListTableNamesByNamespaceRespon" + + "se\022A\n\010SetQuota\022\031.hbase.pb.SetQuotaReques", + "t\032\032.hbase.pb.SetQuotaResponse\022x\n\037getLast" + + "MajorCompactionTimestamp\022).hbase.pb.Majo" + + "rCompactionTimestampRequest\032*.hbase.pb.M" + + "ajorCompactionTimestampResponse\022\212\001\n(getL" + + "astMajorCompactionTimestampForRegion\0222.h" + + "base.pb.MajorCompactionTimestampForRegio" + + "nRequest\032*.hbase.pb.MajorCompactionTimes" + + "tampResponse\022_\n\022getProcedureResult\022#.hba" + + "se.pb.GetProcedureResultRequest\032$.hbase." + + "pb.GetProcedureResultResponse\022h\n\027getSecu", + "rityCapabilities\022%.hbase.pb.SecurityCapa" + + "bilitiesRequest\032&.hbase.pb.SecurityCapab" + + "ilitiesResponse\022S\n\016AbortProcedure\022\037.hbas" + + "e.pb.AbortProcedureRequest\032 .hbase.pb.Ab" + + "ortProcedureResponse\022S\n\016ListProcedures\022\037" + + ".hbase.pb.ListProceduresRequest\032 .hbase." + + "pb.ListProceduresResponseBB\n*org.apache." + + "hadoop.hbase.protobuf.generatedB\014MasterP" + + "rotosH\001\210\001\001\240\001\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -57101,44 +58254,56 @@ public final class MasterProtos { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_hbase_pb_AbortProcedureResponse_descriptor, new java.lang.String[] { "IsProcedureAborted", }); - internal_static_hbase_pb_SetQuotaRequest_descriptor = + internal_static_hbase_pb_ListProceduresRequest_descriptor = getDescriptor().getMessageTypes().get(88); + internal_static_hbase_pb_ListProceduresRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_hbase_pb_ListProceduresRequest_descriptor, + new java.lang.String[] { }); + internal_static_hbase_pb_ListProceduresResponse_descriptor = + getDescriptor().getMessageTypes().get(89); + internal_static_hbase_pb_ListProceduresResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_hbase_pb_ListProceduresResponse_descriptor, + new java.lang.String[] { "Procedure", }); + internal_static_hbase_pb_SetQuotaRequest_descriptor = + getDescriptor().getMessageTypes().get(90); internal_static_hbase_pb_SetQuotaRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_hbase_pb_SetQuotaRequest_descriptor, new java.lang.String[] { "UserName", "UserGroup", "Namespace", "TableName", "RemoveAll", "BypassGlobals", "Throttle", }); internal_static_hbase_pb_SetQuotaResponse_descriptor = - getDescriptor().getMessageTypes().get(89); + getDescriptor().getMessageTypes().get(91); internal_static_hbase_pb_SetQuotaResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_hbase_pb_SetQuotaResponse_descriptor, new java.lang.String[] { }); internal_static_hbase_pb_MajorCompactionTimestampRequest_descriptor = - getDescriptor().getMessageTypes().get(90); + getDescriptor().getMessageTypes().get(92); internal_static_hbase_pb_MajorCompactionTimestampRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_hbase_pb_MajorCompactionTimestampRequest_descriptor, new java.lang.String[] { "TableName", }); internal_static_hbase_pb_MajorCompactionTimestampForRegionRequest_descriptor = - getDescriptor().getMessageTypes().get(91); + getDescriptor().getMessageTypes().get(93); internal_static_hbase_pb_MajorCompactionTimestampForRegionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_hbase_pb_MajorCompactionTimestampForRegionRequest_descriptor, new java.lang.String[] { "Region", }); internal_static_hbase_pb_MajorCompactionTimestampResponse_descriptor = - getDescriptor().getMessageTypes().get(92); + getDescriptor().getMessageTypes().get(94); internal_static_hbase_pb_MajorCompactionTimestampResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_hbase_pb_MajorCompactionTimestampResponse_descriptor, new java.lang.String[] { "CompactionTimestamp", }); internal_static_hbase_pb_SecurityCapabilitiesRequest_descriptor = - getDescriptor().getMessageTypes().get(93); + getDescriptor().getMessageTypes().get(95); internal_static_hbase_pb_SecurityCapabilitiesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_hbase_pb_SecurityCapabilitiesRequest_descriptor, new java.lang.String[] { }); internal_static_hbase_pb_SecurityCapabilitiesResponse_descriptor = - getDescriptor().getMessageTypes().get(94); + getDescriptor().getMessageTypes().get(96); internal_static_hbase_pb_SecurityCapabilitiesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_hbase_pb_SecurityCapabilitiesResponse_descriptor, @@ -57153,6 +58318,7 @@ public final class MasterProtos { org.apache.hadoop.hbase.protobuf.generated.ClientProtos.getDescriptor(), org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.getDescriptor(), org.apache.hadoop.hbase.protobuf.generated.ErrorHandlingProtos.getDescriptor(), + org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.getDescriptor(), org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.getDescriptor(), }, assigner); } diff --git a/hbase-protocol/src/main/protobuf/Master.proto b/hbase-protocol/src/main/protobuf/Master.proto index 16e3b3a1d19..e12f5e5e312 100644 --- a/hbase-protocol/src/main/protobuf/Master.proto +++ b/hbase-protocol/src/main/protobuf/Master.proto @@ -30,6 +30,7 @@ import "HBase.proto"; import "Client.proto"; import "ClusterStatus.proto"; import "ErrorHandling.proto"; +import "Procedure.proto"; import "Quota.proto"; /* Column-level protobufs */ @@ -430,6 +431,13 @@ message AbortProcedureResponse { required bool is_procedure_aborted = 1; } +message ListProceduresRequest { +} + +message ListProceduresResponse { + repeated Procedure procedure = 1; +} + message SetQuotaRequest { optional string user_name = 1; optional string user_group = 2; @@ -706,4 +714,8 @@ service MasterService { /** Abort a procedure */ rpc AbortProcedure(AbortProcedureRequest) returns(AbortProcedureResponse); + + /** returns a list of procedures */ + rpc ListProcedures(ListProceduresRequest) + returns(ListProceduresResponse); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 2f7b6bcb3c8..bc73ea7a851 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -64,6 +64,7 @@ import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.NamespaceNotFoundException; import org.apache.hadoop.hbase.PleaseHoldException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerLoad; import org.apache.hadoop.hbase.ServerName; @@ -2480,6 +2481,11 @@ public class HMaster extends HRegionServer implements MasterServices, Server { return this.procedureExecutor.abort(procId, mayInterruptIfRunning); } + @Override + public List listProcedures() throws IOException { + return this.procedureExecutor.listProcedures(); + } + @Override public List listTableDescriptorsByNamespace(String name) throws IOException { ensureNamespaceExists(name); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index 9ff36c567c3..e1bc09ae265 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -34,6 +34,7 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.PleaseHoldException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.ServerLoad; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -48,7 +49,6 @@ import org.apache.hadoop.hbase.ipc.RpcServer.BlockingServiceAndInterface; import org.apache.hadoop.hbase.ipc.ServerRpcController; import org.apache.hadoop.hbase.procedure.MasterProcedureManager; import org.apache.hadoop.hbase.procedure2.Procedure; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.RequestConverter; import org.apache.hadoop.hbase.protobuf.ResponseConverter; @@ -116,6 +116,8 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotDoneReq import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsSnapshotDoneResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespaceDescriptorsRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListNamespaceDescriptorsResponse; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresRequest; +import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListProceduresResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListTableDescriptorsByNamespaceRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListTableDescriptorsByNamespaceResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.ListTableNamesByNamespaceRequest; @@ -1008,15 +1010,15 @@ public class MasterRpcServices extends RSRpcServices master.checkInitialized(); GetProcedureResultResponse.Builder builder = GetProcedureResultResponse.newBuilder(); - Pair v = master.getMasterProcedureExecutor() + Pair v = master.getMasterProcedureExecutor() .getResultOrProcedure(request.getProcId()); if (v.getFirst() != null) { - ProcedureResult result = v.getFirst(); + ProcedureInfo result = v.getFirst(); builder.setState(GetProcedureResultResponse.State.FINISHED); builder.setStartTime(result.getStartTime()); builder.setLastUpdate(result.getLastUpdate()); if (result.isFailed()) { - builder.setException(result.getException().convert()); + builder.setException(result.getForeignExceptionMessage()); } if (result.hasResultData()) { builder.setResult(ByteStringer.wrap(result.getResult())); @@ -1049,6 +1051,22 @@ public class MasterRpcServices extends RSRpcServices return response.build(); } + @Override + public ListProceduresResponse listProcedures( + RpcController rpcController, + ListProceduresRequest request) throws ServiceException { + try { + ListProceduresResponse.Builder response = + ListProceduresResponse.newBuilder(); + for(ProcedureInfo p: master.listProcedures()) { + response.addProcedure(ProcedureInfo.convertToProcedureProto(p)); + } + return response.build(); + } catch (IOException e) { + throw new ServiceException(e); + } + } + @Override public ListNamespaceDescriptorsResponse listNamespaceDescriptors(RpcController c, ListNamespaceDescriptorsRequest request) throws ServiceException { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java index 1bfd0bc8b05..48726869c55 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java @@ -26,6 +26,7 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.NamespaceDescriptor; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.TableDescriptors; import org.apache.hadoop.hbase.TableName; @@ -323,6 +324,13 @@ public interface MasterServices extends Server { */ public boolean abortProcedure(final long procId, final boolean mayInterruptIfRunning); + /** + * List procedures + * @return procedure list + * @throws IOException + */ + public List listProcedures() throws IOException; + /** * Get a namespace descriptor by name * @param name name of namespace descriptor diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ProcedureSyncWait.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ProcedureSyncWait.java index 1e94744be50..5c03a4a3bee 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ProcedureSyncWait.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ProcedureSyncWait.java @@ -24,12 +24,12 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CoordinatedStateException; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.classification.InterfaceAudience; @@ -41,7 +41,7 @@ import org.apache.hadoop.hbase.master.RegionState.State; import org.apache.hadoop.hbase.master.ServerManager; import org.apache.hadoop.hbase.procedure2.Procedure; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; +import org.apache.hadoop.hbase.procedure2.RemoteProcedureException; import org.apache.hadoop.hbase.quotas.MasterQuotaManager; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.Threads; @@ -78,11 +78,12 @@ public final class ProcedureSyncWait { // Dev Consideration: are we waiting forever, or we can set up some timeout value? Threads.sleepWithoutInterrupt(250); } - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); if (result != null) { if (result.isFailed()) { // If the procedure fails, we should always have an exception captured. Throw it. - throw result.getException().unwrapRemoteException(); + throw RemoteProcedureException.fromProto( + result.getForeignExceptionMessage()).unwrapRemoteException(); } return result.getResult(); } else { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java index 8a5c3da8be8..cb79c8dcc34 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java @@ -26,7 +26,6 @@ import static org.junit.Assert.fail; import java.io.IOException; import java.util.List; import java.util.Random; -import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.logging.Log; @@ -42,6 +41,7 @@ import org.apache.hadoop.hbase.testclassification.LargeTests; import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.NotServingRegionException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableExistsException; import org.apache.hadoop.hbase.TableName; @@ -68,7 +68,6 @@ import org.junit.experimental.categories.Category; import com.google.protobuf.ServiceException; - /** * Class to test HBaseAdmin. * Spins up the minicluster once at test start and then takes it down afterward. @@ -763,4 +762,10 @@ public class TestAdmin2 { boolean abortResult = admin.abortProcedure(procId, true); assertFalse(abortResult); } + + @Test(timeout = 300000) + public void testListProcedures() throws Exception { + ProcedureInfo[] procList = admin.listProcedures(); + assertTrue(procList.length >= 0); + } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java index 17da9ca3661..a2887d32be0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java @@ -48,6 +48,7 @@ import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MetaMockingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -423,6 +424,11 @@ public class TestCatalogJanitor { return false; //To change body of implemented methods use File | Settings | File Templates. } + @Override + public List listProcedures() throws IOException { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + @Override public List listTableDescriptorsByNamespace(String name) throws IOException { return null; //To change body of implemented methods use File | Settings | File Templates. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestAddColumnFamilyProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestAddColumnFamilyProcedure.java index e09c8386496..97a287ef71f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestAddColumnFamilyProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestAddColumnFamilyProcedure.java @@ -28,9 +28,9 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.InvalidFamilyOperationException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.AddColumnFamilyState; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -152,10 +152,11 @@ public class TestAddColumnFamilyProcedure { ProcedureTestingUtility.waitProcedure(procExec, procId2); // Second add should fail with InvalidFamilyOperationException - ProcedureResult result = procExec.getResult(procId2); + ProcedureInfo result = procExec.getResult(procId2); assertTrue(result.isFailed()); - LOG.debug("Add failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof InvalidFamilyOperationException); + LOG.debug("Add failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof InvalidFamilyOperationException); // Do the same add the existing column family - this time offline UTIL.getHBaseAdmin().disableTable(tableName); @@ -169,8 +170,9 @@ public class TestAddColumnFamilyProcedure { // Second add should fail with InvalidFamilyOperationException result = procExec.getResult(procId3); assertTrue(result.isFailed()); - LOG.debug("Add failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof InvalidFamilyOperationException); + LOG.debug("Add failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof InvalidFamilyOperationException); } @Test(timeout=60000) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java index 7797b898cd8..e0027ee05c5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java @@ -32,9 +32,9 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.NamespaceExistException; import org.apache.hadoop.hbase.NamespaceNotFoundException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.constraint.ConstraintException; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.CreateNamespaceState; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -125,10 +125,11 @@ public class TestCreateNamespaceProcedure { ProcedureTestingUtility.waitProcedure(procExec, procId2); // Second create should fail with NamespaceExistException - ProcedureResult result = procExec.getResult(procId2); + ProcedureInfo result = procExec.getResult(procId2); assertTrue(result.isFailed()); - LOG.debug("Create namespace failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof NamespaceExistException); + LOG.debug("Create namespace failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof NamespaceExistException); } @Test(timeout=60000) @@ -143,10 +144,11 @@ public class TestCreateNamespaceProcedure { nonce); // Wait the completion ProcedureTestingUtility.waitProcedure(procExec, procId); - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); assertTrue(result.isFailed()); - LOG.debug("Create namespace failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof NamespaceExistException); + LOG.debug("Create namespace failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof NamespaceExistException); } @Test(timeout=60000) @@ -165,10 +167,10 @@ public class TestCreateNamespaceProcedure { nonce); // Wait the completion ProcedureTestingUtility.waitProcedure(procExec, procId); - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); assertTrue(result.isFailed()); - LOG.debug("Create namespace failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof ConstraintException); + LOG.debug("Create namespace failed with exception: " + result.getExceptionFullMessage()); + assertTrue(ProcedureTestingUtility.getExceptionCause(result) instanceof ConstraintException); } @Test(timeout=60000) @@ -187,10 +189,10 @@ public class TestCreateNamespaceProcedure { nonce); // Wait the completion ProcedureTestingUtility.waitProcedure(procExec, procId); - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); assertTrue(result.isFailed()); - LOG.debug("Create namespace failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof ConstraintException); + LOG.debug("Create namespace failed with exception: " + result.getExceptionFullMessage()); + assertTrue(ProcedureTestingUtility.getExceptionCause(result) instanceof ConstraintException); } @Test(timeout=60000) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedure.java index e7efc2b5b29..d5e79cf4699 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedure.java @@ -28,9 +28,9 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.InvalidFamilyOperationException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteColumnFamilyState; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -150,10 +150,11 @@ public class TestDeleteColumnFamilyProcedure { ProcedureTestingUtility.waitProcedure(procExec, procId2); // Second delete should fail with InvalidFamilyOperationException - ProcedureResult result = procExec.getResult(procId2); + ProcedureInfo result = procExec.getResult(procId2); assertTrue(result.isFailed()); - LOG.debug("Delete online failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof InvalidFamilyOperationException); + LOG.debug("Delete online failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof InvalidFamilyOperationException); // Try again, this time with table disabled. UTIL.getHBaseAdmin().disableTable(tableName); @@ -166,8 +167,9 @@ public class TestDeleteColumnFamilyProcedure { // Expect fail with InvalidFamilyOperationException result = procExec.getResult(procId2); assertTrue(result.isFailed()); - LOG.debug("Delete offline failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof InvalidFamilyOperationException); + LOG.debug("Delete offline failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof InvalidFamilyOperationException); } @Test(timeout=60000) @@ -218,10 +220,11 @@ public class TestDeleteColumnFamilyProcedure { // Wait the completion ProcedureTestingUtility.waitProcedure(procExec, procId1); - ProcedureResult result = procExec.getResult(procId1); + ProcedureInfo result = procExec.getResult(procId1); assertTrue(result.isFailed()); - LOG.debug("Delete failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof InvalidFamilyOperationException); + LOG.debug("Delete failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof InvalidFamilyOperationException); } @Test(timeout=60000) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java index dc250fb573b..e9fbddc9f38 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java @@ -32,10 +32,10 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.NamespaceNotFoundException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.constraint.ConstraintException; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -123,10 +123,11 @@ public class TestDeleteNamespaceProcedure { // Wait the completion ProcedureTestingUtility.waitProcedure(procExec, procId); // Expect fail with NamespaceNotFoundException - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); assertTrue(result.isFailed()); - LOG.debug("Delete namespace failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof NamespaceNotFoundException); + LOG.debug("Delete namespace failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof NamespaceNotFoundException); } @Test(timeout=60000) @@ -140,10 +141,10 @@ public class TestDeleteNamespaceProcedure { nonce); // Wait the completion ProcedureTestingUtility.waitProcedure(procExec, procId); - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); assertTrue(result.isFailed()); - LOG.debug("Delete namespace failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof ConstraintException); + LOG.debug("Delete namespace failed with exception: " + result.getExceptionFullMessage()); + assertTrue(ProcedureTestingUtility.getExceptionCause(result) instanceof ConstraintException); } @Test(timeout=60000) @@ -162,10 +163,10 @@ public class TestDeleteNamespaceProcedure { nonce); // Wait the completion ProcedureTestingUtility.waitProcedure(procExec, procId); - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); assertTrue(result.isFailed()); - LOG.debug("Delete namespace failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof ConstraintException); + LOG.debug("Delete namespace failed with exception: " + result.getExceptionFullMessage()); + assertTrue(ProcedureTestingUtility.getExceptionCause(result) instanceof ConstraintException); } @Test(timeout=60000) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteTableProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteTableProcedure.java index a215c21148c..4a1c4350b84 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteTableProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteTableProcedure.java @@ -25,11 +25,11 @@ import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotDisabledException; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -141,10 +141,10 @@ public class TestDeleteTableProcedure { UTIL.getHBaseCluster().getMaster(), tableName, regions, "f"); // Second delete should fail with TableNotFound - ProcedureResult result = procExec.getResult(procId2); + ProcedureInfo result = procExec.getResult(procId2); assertTrue(result.isFailed()); - LOG.debug("Delete failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof TableNotFoundException); + LOG.debug("Delete failed with exception: " + result.getExceptionFullMessage()); + assertTrue(ProcedureTestingUtility.getExceptionCause(result) instanceof TableNotFoundException); } @Test(timeout=60000) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDisableTableProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDisableTableProcedure.java index 7f49e11bbcb..078db92193f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDisableTableProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDisableTableProcedure.java @@ -26,10 +26,10 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotEnabledException; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DisableTableState; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -125,10 +125,11 @@ public class TestDisableTableProcedure { procExec.getEnvironment(), tableName, false), nonceGroup + 1, nonce + 1); // Wait the completion ProcedureTestingUtility.waitProcedure(procExec, procId2); - ProcedureResult result = procExec.getResult(procId2); + ProcedureInfo result = procExec.getResult(procId2); assertTrue(result.isFailed()); - LOG.debug("Disable failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof TableNotEnabledException); + LOG.debug("Disable failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof TableNotEnabledException); // Disable the table - expect failure from ProcedurePrepareLatch try { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestEnableTableProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestEnableTableProcedure.java index 7f8687abd45..820024678b4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestEnableTableProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestEnableTableProcedure.java @@ -26,10 +26,10 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotDisabledException; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.EnableTableState; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -140,10 +140,11 @@ public class TestEnableTableProcedure { new EnableTableProcedure(procExec.getEnvironment(), tableName, false), nonceGroup, nonce); ProcedureTestingUtility.waitProcedure(procExec, procId1); - ProcedureResult result = procExec.getResult(procId1); + ProcedureInfo result = procExec.getResult(procId1); assertTrue(result.isFailed()); - LOG.debug("Enable failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof TableNotDisabledException); + LOG.debug("Enable failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof TableNotDisabledException); // Enable the table with skipping table state check flag (simulate recovery scenario) long procId2 = procExec.submitProcedure( diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyColumnFamilyProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyColumnFamilyProcedure.java index c7f05f1f8d7..12b2ad8cae7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyColumnFamilyProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyColumnFamilyProcedure.java @@ -28,9 +28,9 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.InvalidFamilyOperationException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.ModifyColumnFamilyState; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -145,10 +145,11 @@ public class TestModifyColumnFamilyProcedure { // Wait the completion ProcedureTestingUtility.waitProcedure(procExec, procId1); - ProcedureResult result = procExec.getResult(procId1); + ProcedureInfo result = procExec.getResult(procId1); assertTrue(result.isFailed()); - LOG.debug("Modify failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof InvalidFamilyOperationException); + LOG.debug("Modify failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof InvalidFamilyOperationException); } @Test(timeout=60000) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java index 3eaaa84abdd..c38eab88234 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java @@ -29,9 +29,9 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.NamespaceNotFoundException; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.constraint.ConstraintException; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.ModifyNamespaceState; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -149,10 +149,11 @@ public class TestModifyNamespaceProcedure { ProcedureTestingUtility.waitProcedure(procExec, procId); // Expect fail with NamespaceNotFoundException - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); assertTrue(result.isFailed()); - LOG.debug("modify namespace failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof NamespaceNotFoundException); + LOG.debug("modify namespace failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof NamespaceNotFoundException); } @Test(timeout=60000) @@ -174,10 +175,10 @@ public class TestModifyNamespaceProcedure { nonce); // Wait the completion ProcedureTestingUtility.waitProcedure(procExec, procId); - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); assertTrue(result.isFailed()); - LOG.debug("Modify namespace failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof ConstraintException); + LOG.debug("Modify namespace failed with exception: " + result.getExceptionFullMessage()); + assertTrue(ProcedureTestingUtility.getExceptionCause(result) instanceof ConstraintException); } @Test(timeout=60000) @@ -199,10 +200,10 @@ public class TestModifyNamespaceProcedure { nonce); // Wait the completion ProcedureTestingUtility.waitProcedure(procExec, procId); - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); assertTrue(result.isFailed()); - LOG.debug("Modify namespace failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof ConstraintException); + LOG.debug("Modify namespace failed with exception: " + result.getExceptionFullMessage()); + assertTrue(ProcedureTestingUtility.getExceptionCause(result) instanceof ConstraintException); } @Test(timeout = 60000) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java index eea22ce5f9e..a49c23c9b9a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java @@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.master.procedure; import java.util.Random; +import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -27,9 +28,11 @@ import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; +import org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureState; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.junit.After; import org.junit.AfterClass; @@ -180,6 +183,41 @@ public class TestProcedureAdmin { assertFalse(abortResult); } + @Test(timeout=60000) + public void testListProcedure() throws Exception { + final TableName tableName = TableName.valueOf("testListProcedure"); + final ProcedureExecutor procExec = getMasterProcedureExecutor(); + + MasterProcedureTestingUtility.createTable(procExec, tableName, null, "f"); + ProcedureTestingUtility.waitNoProcedureRunning(procExec); + ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); + + long procId = procExec.submitProcedure( + new DisableTableProcedure(procExec.getEnvironment(), tableName, false), nonceGroup, nonce); + + List listProcedures = procExec.listProcedures(); + assertTrue(listProcedures.size() >= 1); + boolean found = false; + for (ProcedureInfo procInfo: listProcedures) { + if (procInfo.getProcId() == procId) { + assertTrue(procInfo.getProcState() == ProcedureState.RUNNABLE); + found = true; + } else { + assertTrue(procInfo.getProcState() == ProcedureState.FINISHED); + } + } + assertTrue(found); + + ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, false); + ProcedureTestingUtility.restart(procExec); + ProcedureTestingUtility.waitNoProcedureRunning(procExec); + ProcedureTestingUtility.assertProcNotFailed(procExec, procId); + listProcedures = procExec.listProcedures(); + for (ProcedureInfo procInfo: listProcedures) { + assertTrue(procInfo.getProcState() == ProcedureState.FINISHED); + } + } + private ProcedureExecutor getMasterProcedureExecutor() { return UTIL.getHBaseCluster().getMaster().getMasterProcedureExecutor(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTruncateTableProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTruncateTableProcedure.java index 2500ccae260..08442ce19b0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTruncateTableProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTruncateTableProcedure.java @@ -25,11 +25,11 @@ import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotDisabledException; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; -import org.apache.hadoop.hbase.procedure2.ProcedureResult; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.TruncateTableState; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -101,10 +101,10 @@ public class TestTruncateTableProcedure { new TruncateTableProcedure(procExec.getEnvironment(), tableName, true)); // Second delete should fail with TableNotFound - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); assertTrue(result.isFailed()); - LOG.debug("Truncate failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof TableNotFoundException); + LOG.debug("Truncate failed with exception: " + result.getExceptionFullMessage()); + assertTrue(ProcedureTestingUtility.getExceptionCause(result) instanceof TableNotFoundException); } @Test(timeout=60000) @@ -118,10 +118,11 @@ public class TestTruncateTableProcedure { new TruncateTableProcedure(procExec.getEnvironment(), tableName, false)); // Second delete should fail with TableNotDisabled - ProcedureResult result = procExec.getResult(procId); + ProcedureInfo result = procExec.getResult(procId); assertTrue(result.isFailed()); - LOG.debug("Truncate failed with exception: " + result.getException()); - assertTrue(result.getException().getCause() instanceof TableNotDisabledException); + LOG.debug("Truncate failed with exception: " + result.getExceptionFullMessage()); + assertTrue( + ProcedureTestingUtility.getExceptionCause(result) instanceof TableNotDisabledException); } @Test(timeout=60000)