Examples of TException


Examples of com.evernote.thrift.TException

    try {
      for (int bufflen = 0; (bufflen = data.read(buffer)) >= 0;) {
        trans_.write(buffer, 0, bufflen);
      }
    } catch (IOException e) {
      throw new TException("Failed to read from stream", e);
    }
  }
View Full Code Here

Examples of com.facebook.presto.hive.shaded.org.apache.thrift.TException

      @Override
      public boolean process(final TProtocol inProt, final TProtocol outProt) throws TException {
        TTransport trans = inProt.getTransport();
        if (!(trans instanceof TSaslServerTransport)) {
          throw new TException("Unexpected non-SASL transport " + trans.getClass());
        }
        TSaslServerTransport saslTrans = (TSaslServerTransport)trans;
        SaslServer saslServer = saslTrans.getSaslServer();
        String authId = saslServer.getAuthorizationID();
        authenticationMethod.set(AuthenticationMethod.KERBEROS);
        LOG.debug("AUTH ID ======>" + authId);
        String endUser = authId;

        if(saslServer.getMechanismName().equals("DIGEST-MD5")) {
          try {
            TokenIdentifier tokenId = SaslRpcServer.getIdentifier(authId,
                secretManager);
            endUser = tokenId.getUser().getUserName();
            authenticationMethod.set(AuthenticationMethod.TOKEN);
          } catch (InvalidToken e) {
            throw new TException(e.getMessage());
          }
        }
        Socket socket = ((TSocket)(saslTrans.getUnderlyingTransport())).getSocket();
        remoteAddress.set(socket.getInetAddress());
        UserGroupInformation clientUgi = null;
View Full Code Here

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

Examples of com.facebook.thrift.TException

    }
  }

  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

Examples of com.facebook.thrift.TException

    }
    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

Examples of com.facebook.thrift.TException

    }
  }

  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

Examples of com.facebook.thrift.TException

    }
  }


  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

Examples of com.facebook.thrift.TException

    }
    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

Examples of com.facebook.thrift.TException

    }
    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

Examples of com.facebook.thrift.TException

    // 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
TOP
Copyright © 2018 www.massapi.com. 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.