Package com.dp.nebula.wormhole.common

Examples of com.dp.nebula.wormhole.common.WormholeException


    }
  }

  private void checkStatus(String htable) throws IOException {
    if (!admin.isMasterRunning()) {
      throw new WormholeException("hbase master is not running",
          JobStatus.PRE_CHECK_FAILED.getStatus());
    }
    if (!admin.isTableAvailable(htable)) {
      throw new WormholeException(String.format(
          "htable %s is not available", htable),
          JobStatus.PRE_CHECK_FAILED.getStatus());
    }
    if (!admin.tableExists(htable)) {
      throw new WormholeException(String.format(
          "htable %s doesn't exist", htable),
          JobStatus.PRE_CHECK_FAILED.getStatus());
    }
    if (!admin.isTableEnabled(htable)) {
      throw new WormholeException(String.format("htable %s is disabled",
          htable), JobStatus.PRE_CHECK_FAILED.getStatus());
    }
  }
View Full Code Here


          proxy.close();
        }
      } catch (IOException e1) {
      }
      logger.error(e);
      throw new WormholeException(e.getMessage(),
          JobStatus.READ_FAILED.getStatus());
    }
  }
View Full Code Here

        line = lineSender.createNewLine();
      }
      lineSender.flush();
    } catch (IOException e) {
      logger.error("HBase Reader fetch line error " + e.toString());
      throw new WormholeException(e, JobStatus.READ_DATA_EXCEPTION.getStatus());
    } finally {
      try {
        proxy.close();
      } catch (IOException e) {
      }
View Full Code Here

      conn = DriverManager.getConnection(this.path, this.username,
          this.password);
      stmt = conn.createStatement();
    } catch (ClassNotFoundException ce) {
      LOG.error("hive driver class not found, " + ce.getMessage());
      throw new WormholeException(ce,
          JobStatus.READ_CONNECTION_FAILED.getStatus());
    } catch (SQLException se) {
      LOG.error("hive get connection error, " + se.getMessage());
      throw new WormholeException(se,
          JobStatus.READ_CONNECTION_FAILED.getStatus());
    }
  }
View Full Code Here

    Properties p = createProperties();
    try {
      DBSource.register(GreenplumReader.class, this.ip, this.port, this.dbname, p);
      conn = DBSource.getConnection(GreenplumReader.class, ip, port, dbname);
    } catch (Exception e) {
      throw new WormholeException(e, JobStatus.READ_CONNECTION_FAILED.getStatus() + GreenplumReader.ERROR_CODE_ADD);
    }
  }
View Full Code Here

      if (null != rs) {
          try {
          DBUtils.closeResultSet(rs);
        } catch (SQLException e) {
          logger.error("GreenplumReader close resultset error ");
          throw new WormholeException(e,JobStatus.READ_FAILED.getStatus()+GreenplumReader.ERROR_CODE_ADD)
        }
            }
          try {
          conn.close();
        } catch (SQLException e) {
View Full Code Here

            log.warn("Close RAMStorage for " + getStat().getId()
                + ". Queue:" + info() + " Timeout times:"
                + getStat().getLineRRefused());
            setPushClosed(true);
          }
          throw new WormholeException("",
              JobStatus.WRITE_OUT_OF_TIME.getStatus());
        }
      }
    } catch (InterruptedException e) {
      return false;
View Full Code Here

            log.warn("Close RAMStorage for " + getStat().getId()
                + ". Queue:" + info() + " Timeout times:"
                + getStat().getLineRRefused());
            setPushClosed(true);
          }
          throw new WormholeException("",
              JobStatus.WRITE_OUT_OF_TIME.getStatus());
        }
      }
    } catch (InterruptedException e) {
      return false;
View Full Code Here

            log.warn("Close RAMStorage for " + getStat().getId()
                + ". Queue:" + info() + " Timeout times:"
                + getStat().getLineRRefused());
            setPushClosed(true);
          }
          throw new WormholeException("",
              JobStatus.READ_OUT_OF_TIME.getStatus());
        }
      }
    } catch (InterruptedException e) {
      return 0;
View Full Code Here

    } else if (1 == mode) {
      try {
        LOG.info("mode 1, delete table data");
        client.deleteTableData(htable);
      } catch (IOException e) {
        throw new WormholeException(e,
            JobStatus.PRE_CHECK_FAILED.getStatus());
      }
    } else if (2 == mode) {
      try {
        LOG.info("mode 2, truncate and recreate table");
        client.truncateTable(htable);
      } catch (IOException e) {
        throw new WormholeException(e,
            JobStatus.PRE_CHECK_FAILED.getStatus());
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.dp.nebula.wormhole.common.WormholeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.