Package org.apache.hadoop.hive.metastore.api

Examples of org.apache.hadoop.hive.metastore.api.MetaException


      FileInputStream fis = new FileInputStream(schemaFile);
      schema.load(fis);
      fis.close();
    } catch (IOException e) {
      LOG.error(StringUtils.stringifyException(e));
      throw new MetaException("got IOException trying to get table schema for : " + tableName + " - " + e);
    }

    return schema;
  }
View Full Code Here


      // IGNORE FOR NOW            throw new MetaException("trying to overwrite table " + tableName + " already exists");
    }

    File dir = getSchemaDir(parent.getName(), tableName);
    if(!  dir.mkdirs() && !overwrite) {
      throw new MetaException("could not create: " + dir);
    }
    try {
      FileOutputStream fos = new FileOutputStream(schemaFile);
      schema.store(fos,"meta data");
      fos.close();
    } catch(IOException e) {
      LOG.error(StringUtils.stringifyException(e));
      throw new MetaException(e.getMessage());
    }
  }
View Full Code Here

  protected void rename(DB parent, String tableName, DB newParent, String newTableName) throws MetaException {
    File currentF = getSchemaDir(parent.getName(), tableName);
    File newF = getSchemaDir(newParent.getName(), newTableName);
    boolean renameTo = currentF.renameTo(newF);
    if(!renameTo) {
      throw new MetaException("Rename failed");
    }
  }
View Full Code Here

  public ArrayList<String> getTablesByPattern(DB parent, String tablePattern) throws MetaException {

    ArrayList<String> names = new ArrayList<String> ();

    if(tablePattern == null || tablePattern.length() == 0) {
      throw new MetaException("Empty table name");
    }

    tablePattern += ".dir$";
    Pattern tpat = Pattern.compile(tablePattern);

    File msPath = getDBDir(parent.getName());

    String tpaths[] = msPath.list();

    if(tpaths == null) {
      LOG.fatal("Internal fatal err - bad db dir: " + msPath);
      throw new MetaException("Internal fatal err - bad db dir: " + msPath);
    }

    for(int i = 0; tpaths != null && i < tpaths.length; i++) {
      Matcher m = tpat.matcher(tpaths[i]);
      if(m.matches()) {
View Full Code Here

  public List<String> getTables(String dbName, String pattern) throws MetaException {
    try {
      return this.getTablesByPattern(new DB(dbName, conf), pattern);
    } catch (UnknownDBException e) {
      LOG.error(StringUtils.stringifyException(e));
      throw new MetaException("Unknown database " + dbName);
    }
  }
View Full Code Here

  }

  public void alterTable(String dbname, String name, Table newTable) throws InvalidObjectException,
      MetaException {
    // TODO Auto-generated method stub
    throw new MetaException("Not yet implemented");
  }
View Full Code Here

  public boolean dropTable(String dbName, String tableName) throws MetaException {
    try {
      new DB(dbName, conf).getTable(tableName, false).drop();
    } catch (Exception e) {
      LOG.error(StringUtils.stringifyException(e));
      throw new MetaException(e.getMessage());
    }
    return true;
  }
View Full Code Here

    try {
      Properties p = new DB(dbName, conf).getTable(tableName, true).getSchema();
      return MetaStoreUtils.getTable(conf, p);
    } catch (Exception e) {
      LOG.error(StringUtils.stringifyException(e));
      throw new MetaException(e.getMessage());
    }
  }
View Full Code Here

  }

  public Partition getPartition(String dbName, String tableName, List<String> part_vals)
      throws MetaException {
    // TODO Auto-generated method stub
    throw new MetaException("Not yet implemented");
  }
View Full Code Here

  }

  public List<Partition> getPartitions(String dbName, String tableName, int max)
      throws MetaException {
    // TODO Auto-generated method stub
    throw new MetaException("Not yet implemented");
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.metastore.api.MetaException

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.