Package com.facebook.thrift

Examples of com.facebook.thrift.TException


    }
    internalWriteString(str);
  }

  public void writeBinary(byte[] bin) throws TException {
    throw new TException("Ctl separated protocol cannot support writing Binary data!");
  }
View Full Code Here


    else
      return ret;
  }

  public byte[] readBinary() throws TException {
    throw new TException("Not implemented for control separated data");
  }
View Full Code Here

      sortOrder = "";
    }
    for(int i=0; i<sortOrder.length(); i++) {
      char c = sortOrder.charAt(i);
      if (c != '+' && c != '-') {
        throw new TException(Constants.SERIALIZATION_SORT_ORDER + " should be a string consists of only '+' and '-'!");
      }
    }
    LOG.info("Sort order is \"" + sortOrder + "\"");
  }
View Full Code Here

  public void writeString(String str) throws TException {
    byte[] dat;
    try {
      dat = str.getBytes("UTF-8");
    } catch (UnsupportedEncodingException uex) {
      throw new TException("JVM DOES NOT SUPPORT UTF-8: " + uex.getMessage());
    }
    writeRawBytes(nonNullByte, 0, 1);
    int begin = 0;
    int i = 0;
    for (; i < dat.length; i++) {
View Full Code Here

    }
    try {
      String r = new String(stringBytes, 0, i, "UTF-8");
      return r;
    } catch (UnsupportedEncodingException uex) {
      throw new TException("JVM DOES NOT SUPPORT UTF-8: " + uex.getMessage());
    }
  }
View Full Code Here

            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

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.