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

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


      public boolean create_index(Index index_def)
          throws IndexAlreadyExistsException, MetaException {
        this.incrementCounter("create_index");
        logStartFunction("truncate_table: db=" + index_def.getTableName() + " tbl=" + index_def.getTableName() + " name=" + index_def.getIndexName());
        // TODO Auto-generated method stub
        throw new MetaException("Not yet implemented");
      }
View Full Code Here


        try {
          Deserializer s = MetaStoreUtils.getDeserializer(this.hiveConf, tbl);
          return MetaStoreUtils.getFieldsFromDeserializer(tableName, s);
        } catch(SerDeException e) {
          StringUtils.stringifyException(e);
          throw new MetaException(e.getMessage());
        }
      }
View Full Code Here

  public static final Log LOG = LogFactory.getLog("hive.metastore.warehouse");

  public Warehouse(Configuration conf) throws MetaException {
    String whRootString =  HiveConf.getVar(conf, HiveConf.ConfVars.METASTOREWAREHOUSE);
    if(StringUtils.isBlank(whRootString)) {
      throw new MetaException(HiveConf.ConfVars.METASTOREWAREHOUSE.varname + " is not set in the config or blank");
    }
    whRoot = new Path(whRootString);
    URI uri = whRoot.toUri();
    // if the METASTOREWAREHOUSE value doesn't have schema and authority specified then inherit
    // from fs.default.name in hadoop-site.xml
View Full Code Here

      if (fs.delete(f, true)) {
        LOG.info("Deleted the diretory " + f);
        return true;
      }
      if(fs.exists(f)) {
        throw new MetaException("Unable to delete directory: " + f);
      }
    } catch (FileNotFoundException e) {
      return true; //ok even if there is not data
    } catch (IOException e) {
      MetaStoreUtils.logAndThrowMetaException(e);
View Full Code Here

  public static String makePartName(Map<String, String> spec) throws MetaException {
    StringBuffer suffixBuf = new StringBuffer();
    for(Entry<String, String> e: spec.entrySet()) {
      if(e.getValue() == null  || e.getValue().length() == 0) {
        throw new MetaException("Partition spec is incorrect. " + spec);
      }
      suffixBuf.append(e.getKey() + "=" + e.getValue() + "/");
    }
    return suffixBuf.toString();
  }
View Full Code Here

    return true;
  }

  public static String makePartName(List<FieldSchema> partCols, List<String> vals) throws MetaException {
    if ((partCols.size() != vals.size()) || (partCols.size() == 0)) {
      throw new MetaException("Invalid partition key & values");
    }
    StringBuilder name = new StringBuilder();
    for(int i=0; i< partCols.size(); i++) {
      if(i > 0) {
        name.append('/');
View Full Code Here

      } catch(URISyntaxException e) {
        MetaStoreUtils.logAndThrowMetaException(e);
      }
    } else {
      LOG.error("NOT getting uris from conf");
      throw new MetaException("MetaStoreURIs not found in conf file");
    }
    // finally open the store
    this.open();
  }
View Full Code Here

      if (open) {
        break;
      }
    }
    if(!open) {
      throw new MetaException("Could not connect to meta store using any of the URIs provided");
    }
    LOG.info("Connected to metastore.");
  }
View Full Code Here

          Thread.sleep(1000);
        } catch(InterruptedException ignore) { }
      }
    }
    if(!open) {
      throw new MetaException("could not connect to meta store");
    }
  }
View Full Code Here

  public boolean createDatabase(Database db) throws MetaException {
    // ignores the location param
    boolean mkdir = getDBDir(db.getName()).mkdir();
    if(!mkdir) {
      throw new MetaException("Unable to create directory for database " + db.getName());
    }
    return mkdir;
  }
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.