Java 类org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsProcedureDoneResponse 实例源码

项目:ditb    文件:HBaseAdmin.java   
/**
 * Check the current state of the specified procedure.
 * <p>
 * There are three possible states:
 * <ol>
 * <li>running - returns <tt>false</tt></li>
 * <li>finished - returns <tt>true</tt></li>
 * <li>finished with error - throws the exception that caused the procedure to fail</li>
 * </ol>
 * <p>
 *
 * @param signature The signature that uniquely identifies a procedure
 * @param instance The instance name of the procedure
 * @param props Property/Value pairs of properties passing to the procedure
 * @return true if the specified procedure is finished successfully, false if it is still running
 * @throws IOException if the specified procedure finished with error
 */
@Override
public boolean isProcedureFinished(String signature, String instance, Map<String, String> props)
    throws IOException {
  final ProcedureDescription.Builder builder = ProcedureDescription.newBuilder();
  builder.setSignature(signature).setInstance(instance);
  for (Entry<String, String> entry : props.entrySet()) {
    NameStringPair pair = NameStringPair.newBuilder().setName(entry.getKey())
        .setValue(entry.getValue()).build();
    builder.addConfiguration(pair);
  }
  final ProcedureDescription desc = builder.build();
  return executeCallable(
      new MasterCallable<IsProcedureDoneResponse>(getConnection()) {
        @Override
        public IsProcedureDoneResponse call(int callTimeout) throws ServiceException {
          PayloadCarryingRpcController controller = rpcControllerFactory.newController();
          controller.setCallTimeout(callTimeout);
          return master.isProcedureDone(controller, IsProcedureDoneRequest
              .newBuilder().setProcedure(desc).build());
        }
      }).getDone();
}
项目:pbase    文件:MasterRpcServices.java   
/**
 * Checks if the specified procedure is done.
 * @return true if the procedure is done,
 *   false if the procedure is in the process of completing
 * @throws ServiceException if invalid procedure, or
 *  a failed procedure with progress failure reason.
 */
@Override
public IsProcedureDoneResponse isProcedureDone(RpcController controller,
    IsProcedureDoneRequest request) throws ServiceException {
  try {
    master.checkInitialized();
    ProcedureDescription desc = request.getProcedure();
    MasterProcedureManager mpm = master.mpmHost.getProcedureManager(
      desc.getSignature());
    if (mpm == null) {
      throw new ServiceException("The procedure is not registered: "
        + desc.getSignature());
    }
    LOG.debug("Checking to see if procedure from request:"
      + desc.getSignature() + " is done");

    IsProcedureDoneResponse.Builder builder =
      IsProcedureDoneResponse.newBuilder();
    boolean done = mpm.isProcedureDone(desc);
    builder.setDone(done);
    return builder.build();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:pbase    文件:HBaseAdmin.java   
/**
 * Check the current state of the specified procedure.
 * <p>
 * There are three possible states:
 * <ol>
 * <li>running - returns <tt>false</tt></li>
 * <li>finished - returns <tt>true</tt></li>
 * <li>finished with error - throws the exception that caused the procedure to fail</li>
 * </ol>
 * <p>
 *
 * @param signature The signature that uniquely identifies a procedure
 * @param instance The instance name of the procedure
 * @param props Property/Value pairs of properties passing to the procedure
 * @return true if the specified procedure is finished successfully, false if it is still running
 * @throws IOException if the specified procedure finished with error
 */
@Override
public boolean isProcedureFinished(String signature, String instance, Map<String, String> props)
    throws IOException {
  final ProcedureDescription.Builder builder = ProcedureDescription.newBuilder();
  builder.setSignature(signature).setInstance(instance);
  for (Entry<String, String> entry : props.entrySet()) {
    NameStringPair pair = NameStringPair.newBuilder().setName(entry.getKey())
        .setValue(entry.getValue()).build();
    builder.addConfiguration(pair);
  }
  final ProcedureDescription desc = builder.build();
  return executeCallable(
      new MasterCallable<IsProcedureDoneResponse>(getConnection()) {
        @Override
        public IsProcedureDoneResponse call(int callTimeout) throws ServiceException {
          return master.isProcedureDone(null, IsProcedureDoneRequest
              .newBuilder().setProcedure(desc).build());
        }
      }).getDone();
}
项目:HIndex    文件:HMaster.java   
/**
 * Checks if the specified procedure is done.
 * @return true if the procedure is done,
 *   false if the procedure is in the process of completing
 * @throws ServiceException if invalid procedure, or
 *  a failed procedure with progress failure reason.
 */
@Override
public IsProcedureDoneResponse isProcedureDone(RpcController controller,
    IsProcedureDoneRequest request) throws ServiceException {
  ProcedureDescription desc = request.getProcedure();
  MasterProcedureManager mpm = this.mpmHost.getProcedureManager(desc
      .getSignature());
  if (mpm == null) {
    throw new ServiceException("The procedure is not registered: "
        + desc.getSignature());
  }
  LOG.debug("Checking to see if procedure from request:"
      + desc.getSignature() + " is done");

  try {
    IsProcedureDoneResponse.Builder builder = IsProcedureDoneResponse
        .newBuilder();
    boolean done = mpm.isProcedureDone(desc);
    builder.setDone(done);
    return builder.build();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:HIndex    文件:HBaseAdmin.java   
/**
 * Check the current state of the specified procedure.
 * <p>
 * There are three possible states:
 * <ol>
 * <li>running - returns <tt>false</tt></li>
 * <li>finished - returns <tt>true</tt></li>
 * <li>finished with error - throws the exception that caused the procedure to fail</li>
 * </ol>
 * <p>
 *
 * @param signature The signature that uniquely identifies a procedure
 * @param instance The instance name of the procedure
 * @param props Property/Value pairs of properties passing to the procedure
 * @return true if the specified procedure is finished successfully, false if it is still running
 * @throws IOException if the specified procedure finished with error
 */
public boolean isProcedureFinished(String signature, String instance, Map<String, String> props)
    throws IOException {
  final ProcedureDescription.Builder builder = ProcedureDescription.newBuilder();
  builder.setSignature(signature).setInstance(instance);
  for (String key : props.keySet()) {
    NameStringPair pair = NameStringPair.newBuilder().setName(key)
        .setValue(props.get(key)).build();
    builder.addConfiguration(pair);
  }
  final ProcedureDescription desc = builder.build();
  return executeCallable(
      new MasterCallable<IsProcedureDoneResponse>(getConnection()) {
        @Override
        public IsProcedureDoneResponse call() throws ServiceException {
          return master.isProcedureDone(null, IsProcedureDoneRequest
              .newBuilder().setProcedure(desc).build());
        }
      }).getDone();
}
项目:PyroDB    文件:MasterRpcServices.java   
/**
 * Checks if the specified procedure is done.
 * @return true if the procedure is done,
 *   false if the procedure is in the process of completing
 * @throws ServiceException if invalid procedure, or
 *  a failed procedure with progress failure reason.
 */
@Override
public IsProcedureDoneResponse isProcedureDone(RpcController controller,
    IsProcedureDoneRequest request) throws ServiceException {
  try {
    master.checkInitialized();
    ProcedureDescription desc = request.getProcedure();
    MasterProcedureManager mpm = master.mpmHost.getProcedureManager(
      desc.getSignature());
    if (mpm == null) {
      throw new ServiceException("The procedure is not registered: "
        + desc.getSignature());
    }
    LOG.debug("Checking to see if procedure from request:"
      + desc.getSignature() + " is done");

    IsProcedureDoneResponse.Builder builder =
      IsProcedureDoneResponse.newBuilder();
    boolean done = mpm.isProcedureDone(desc);
    builder.setDone(done);
    return builder.build();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:PyroDB    文件:HBaseAdmin.java   
/**
 * Check the current state of the specified procedure.
 * <p>
 * There are three possible states:
 * <ol>
 * <li>running - returns <tt>false</tt></li>
 * <li>finished - returns <tt>true</tt></li>
 * <li>finished with error - throws the exception that caused the procedure to fail</li>
 * </ol>
 * <p>
 *
 * @param signature The signature that uniquely identifies a procedure
 * @param instance The instance name of the procedure
 * @param props Property/Value pairs of properties passing to the procedure
 * @return true if the specified procedure is finished successfully, false if it is still running
 * @throws IOException if the specified procedure finished with error
 */
public boolean isProcedureFinished(String signature, String instance, Map<String, String> props)
    throws IOException {
  final ProcedureDescription.Builder builder = ProcedureDescription.newBuilder();
  builder.setSignature(signature).setInstance(instance);
  for (Entry<String, String> entry : props.entrySet()) {
    NameStringPair pair = NameStringPair.newBuilder().setName(entry.getKey())
        .setValue(entry.getValue()).build();
    builder.addConfiguration(pair);
  }
  final ProcedureDescription desc = builder.build();
  return executeCallable(
      new MasterCallable<IsProcedureDoneResponse>(getConnection()) {
        @Override
        public IsProcedureDoneResponse call(int callTimeout) throws ServiceException {
          return master.isProcedureDone(null, IsProcedureDoneRequest
              .newBuilder().setProcedure(desc).build());
        }
      }).getDone();
}