Esempio n. 1
0
  /** Check if ingest of the given node is running */
  public static boolean isIngestAlive(AvatarNode node) throws IOException {
    try {
      if (node.reportAvatar() == Avatar.ACTIVE) {
        return false;
      }
      Standby s = node.getStandby();
      Field ingestThreadField;

      ingestThreadField = Standby.class.getDeclaredField("ingestThread");
      ingestThreadField.setAccessible(true);
      Thread ingest = (Thread) ingestThreadField.get(s);

      return ingest.isAlive();
    } catch (Throwable t) {
      LOG.warn("Exception: ", t);
      throw new IOException("Failed to check ingest state");
    }
  }