Package co.nubetech.crux.util

Examples of co.nubetech.crux.util.CruxException


      valueBytes = Bytes.toBytes(valueLong);
    } else if (valueTypeClassName.equals("java.lang.Short")) {
      short valueShort = Short.parseShort(value);
      valueBytes = Bytes.toBytes(valueShort);
    } else {
      throw new CruxException("The type " + valueTypeClassName
          + " is not supported");
    }
    return valueBytes;
  }
View Full Code Here


    byte[] valueBytes = null;
    if (value != null) {
      try {
        valueBytes = getBytes(valueTypeClassName, value);
      } catch (Exception e) {
        throw new CruxException(e);
      }
    }// value null
    if (sentBytes != null) {
      if (valueBytes != null) {
        sentBytes = Bytes.add(sentBytes, valueBytes);
View Full Code Here

              GroupingAggregationProtocol.class, scan.getStartRow(), scan.getStopRow(),
                batchCall, callback);
          }
          catch(Throwable e) {
            e.printStackTrace();
            throw new CruxException("Error executing query", e);
          }
          return new CruxScannerListImpl(callback.getAggregates());
        }
        else {
          ResultScanner resultScanner = hTable.getScanner(scan);
          scanner = new CruxScannerResultScannerImpl(resultScanner, report);
        }
      }     
    } catch (Exception e) {
      e.printStackTrace();
      throw new CruxException(e);
    }
    return scanner;
  }
View Full Code Here

      try {
        hTable.close();
      }
      catch(Exception e) {
        e.printStackTrace();
        throw new CruxException(e);
      }
    }
  }
View Full Code Here

      transaction.begin();
      session.saveOrUpdate(reportDesignFunction);
      transaction.commit();
    } catch (JDBCException e) {
      transaction.rollback();
      throw new CruxException(e.getSQLException().getMessage(), e);
    }
    return reportDesignFunction.getId();
  }
View Full Code Here

      transaction.begin();
      session.delete(reportDesignFunction);
      transaction.commit();
    } catch (JDBCException e) {
      transaction.rollback();
      throw new CruxException(e.getSQLException().getMessage(), e);
    }
    return id;
  }
View Full Code Here

    Configuration conf = Utility.getConfiguration(conn);
    HBaseAdmin admin;
    try {
      admin = new HBaseAdmin(conf);
    } catch (MasterNotRunningException e) {
      throw new CruxException(e);
    } catch (ZooKeeperConnectionException e) {
      throw new CruxException(e);
    }
    logger.debug("Got hbase admin " + admin);
    return admin;
  }
View Full Code Here

    HTableDescriptor[] tableDescriptor;
    try {
      tableDescriptor = admin.listTables();
     
    } catch (IOException e) {
      throw new CruxException(e);
    }
    int length = tableDescriptor.length;
    ArrayList<String> tableList = new ArrayList<String>();
    for (int i = 0; i < length; i++) {
      String table = tableDescriptor[i].getNameAsString();
View Full Code Here

      logger.debug("Id to find analysis is: " + id);
      analysis = (Analysis) session.get(Analysis.class, id);
      analysis.getId();
    } catch (NullPointerException e) {
      logger.debug(id + " not exists.");
      throw new CruxException(
          "Selected analysis does not exists in the database.", e);
    }
    return analysis;
  }
View Full Code Here

      //hTable.close();
      logger.debug("Column Descriptor is " + columnDescriptor);
      return columnDescriptor;
    } catch (Exception e) {
      e.printStackTrace();
      throw new CruxException(e);
    } finally {
      if (hTablePool != null) {
        try {
          if (hTableInterface != null) {
            hTableInterface.close();
          }
          hbaseConnectionPool.returnObject(conn, hTablePool);
        } catch (Exception e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
          throw new CruxException(e1);
        }
      }
    }
     
  }
View Full Code Here

TOP

Related Classes of co.nubetech.crux.util.CruxException

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.