Package com.facebook.thrift

Examples of com.facebook.thrift.TException


            Thread.sleep(1000);
          } catch(InterruptedException ignore) { }
        }
      }
      if(!open) {
        throw new TException("could not connect to meta store");
      }
    } else if(store.getScheme().equals("file")) {
      client = new MetaStoreServer.ThriftMetaStoreHandler("temp_server", this.conf);
      try {
        // for some reason setOption in FB303 doesn't allow one to throw a TException,
        // so I'm having it throw a RuntimeException since that doesn't require changing
        // the method signature.
        client.setOption("metastore.path",store.toASCIIString());
      } catch(RuntimeException e) {
        System.err.println("Could not setoption metastore.path to " + store.getPath());
        throw new TException("could not set metastore path to: " + store.getPath());
      }
    } else {
      throw new TException("Unknown scheme to connect to MetaStore: " + store.getScheme());
    }
  }
View Full Code Here


    }
  }

  public List<String> getTables(String dbName, String tablePattern) throws MetaException, UnknownTableException, TException, UnknownDBException  {

    TException firstException = null;
    for(URI store: this.metastoreUris) {
      try {
        this.open(store);
        List<String> ret = client.get_tables(dbName, tablePattern);
        this.close();
View Full Code Here

    }
    throw firstException;
  }

  public void dropTable(String tableName, boolean deleteData) throws MetaException, UnknownTableException, TException  {
    TException firstException = null;
    String dbName = "default";
    // Ignore deleteData for now
    for(URI store: this.metastoreUris) {
      try {
        this.open(store);
View Full Code Here

    }
  }

  public void createTable(String tableName, Properties schema) throws MetaException, UnknownTableException, TException  {

    TException firstException = null;
    String dbName = "default";
    HashMap<String, String> hm = new HashMap<String, String> ();
    for(Enumeration<?> e = schema.propertyNames();
        e.hasMoreElements() ; ) {
      String key = (String)e.nextElement();
View Full Code Here

    }
  }


  public Properties getSchema(String tableName) throws MetaException, TException, NoSuchObjectException {
    TException firstException = null;
    for(URI store: this.metastoreUris) {
      try {
        this.open(store);
        Map<String, String> schema_map = client.get_schema(tableName);
        Properties p = new Properties();
View Full Code Here

    }
    throw firstException;
  }

  public boolean tableExists(String tableName) throws MetaException,TException, UnknownDBException {
    TException firstException = null;
    String dbName = "default";
    for(URI store: this.metastoreUris) {
      try {
        this.open(store);
        boolean ret = client.table_exists(dbName, tableName);
View Full Code Here

    }
    throw firstException;
  }

  public List<FieldSchema> get_fields(String tableName) throws MetaException,UnknownTableException, TException {
    TException firstException = null;
    String dbName = "default";
    for(URI store: this.metastoreUris) {
      try {
        this.open(store);
        List<FieldSchema> fields = client.get_fields(dbName, tableName);
View Full Code Here

    // nesting not allowed!
    if(map.keyType == TType.STRUCT ||
       map.keyType == TType.MAP ||
       map.keyType == TType.LIST ||
       map.keyType == TType.SET) {
      throw new TException("Not implemented: nested structures");
    }
    // nesting not allowed!
    if(map.valueType == TType.STRUCT ||
       map.valueType == TType.MAP ||
       map.valueType == TType.LIST ||
       map.valueType == TType.SET) {
      throw new TException("Not implemented: nested structures");
    }

    firstInnerField = true;
    isMap = true;
    inner = true;
View Full Code Here

  public void writeListBegin(TList list) throws TException {
    if(list.elemType == TType.STRUCT ||
       list.elemType == TType.MAP ||
       list.elemType == TType.LIST ||
       list.elemType == TType.SET) {
      throw new TException("Not implemented: nested structures");
    }
    firstInnerField = true;
    inner = true;
  }
View Full Code Here

  public void writeSetBegin(TSet set) throws TException {
    if(set.elemType == TType.STRUCT ||
       set.elemType == TType.MAP ||
       set.elemType == TType.LIST ||
       set.elemType == TType.SET) {
      throw new TException("Not implemented: nested structures");
    }
    firstInnerField = true;
    inner = true;
  }
View Full Code Here

TOP

Related Classes of com.facebook.thrift.TException

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.