Examples of TApplicationException


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

    final TMessage msg = in.readMessageBegin();
    final ProcessFunction<Iface, ? extends  TBase> fn = functions.get(msg.name);
    if (fn == null) {
      TProtocolUtil.skip(in, TType.STRUCT);
      in.readMessageEnd();
      TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD,
          "Invalid method name: '"+msg.name+"'");
      out.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
      x.write(out);
      out.writeMessageEnd();
      out.getTransport().flush();
      return true;
    }
    TUGIContainingTransport ugiTrans = (TUGIContainingTransport)in.getTransport();
View Full Code Here

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

    set_ugi_args args = (set_ugi_args)method.invoke(fn, new Object[0]);
    try {
      args.read(iprot);
    } catch (TProtocolException e) {
      iprot.readMessageEnd();
      TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR,
          e.getMessage());
      oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
      x.write(oprot);
      oprot.writeMessageEnd();
      oprot.getTransport().flush();
      return;
    }
    iprot.readMessageEnd();
View Full Code Here

Examples of com.facebook.thrift.TApplicationException

        return db.getTables(pattern);
      } catch(MetaException e) {
        this.incrementCounter("exceptions");
        LOG.error("Got exception in get_tables: " + e.getMessage());
        e.printStackTrace();
        throw new TApplicationException("MetaException getting tables:" + e.getMessage());
      } catch(RuntimeException e) {
        LOG.fatal("get_tables got a runtime exception: " + e.getMessage());
        MetaStoreUtils.printStackTrace(e);
        throw new MetaException("get_tables had an internal Java RuntimeException: " + e.getMessage());
      }
View Full Code Here

Examples of com.facebook.thrift.TApplicationException

        return new FileStore(conf_).getDatabases();
      } catch(MetaException e) {
        this.incrementCounter("exceptions");
        LOG.error("Got exception in get_dbs: " + e.getMessage());
        e.printStackTrace();
        throw new TApplicationException("MetaException getting dbs:" + e.getMessage());
      } catch(RuntimeException e) {
        LOG.fatal("get_dbs got a runtime exception: " + e.getMessage());
        MetaStoreUtils.printStackTrace(e);
        throw new MetaException("get_dbs had an internal Java RuntimeException: " + e.getMessage());
      }
View Full Code Here

Examples of com.facebook.thrift.TApplicationException

        return db.getTables(pattern);
      } catch(MetaException e) {
        this.incrementCounter("exceptions");
        LOG.error("Got exception in get_tables: " + e.getMessage());
        e.printStackTrace();
        throw new TApplicationException("MetaException getting tables:" + e.getMessage());
      } catch(RuntimeException e) {
        LOG.fatal("get_tables got a runtime exception: " + e.getMessage());
        MetaStoreUtils.printStackTrace(e);
        throw new MetaException("get_tables had an internal Java RuntimeException: " + e.getMessage());
      }
View Full Code Here

Examples of com.facebook.thrift.TApplicationException

        return new FileStore(conf_).getDatabases();
      } catch(MetaException e) {
        this.incrementCounter("exceptions");
        LOG.error("Got exception in get_dbs: " + e.getMessage());
        e.printStackTrace();
        throw new TApplicationException("MetaException getting dbs:" + e.getMessage());
      } catch(RuntimeException e) {
        LOG.fatal("get_dbs got a runtime exception: " + e.getMessage());
        MetaStoreUtils.printStackTrace(e);
        throw new MetaException("get_dbs had an internal Java RuntimeException: " + e.getMessage());
      }
View Full Code Here

Examples of org.apache.thrift.TApplicationException

            // TODO: check for non-null return from a void function?
            return null;
        }

        if (results == null) {
            throw new TApplicationException(TApplicationException.MISSING_RESULT, name + " failed: unknown result");
        }
        return results;
    }
View Full Code Here

Examples of org.apache.thrift.TApplicationException

    {
        long start = nanoTime();

        TMessage message = in.readMessageBegin();
        if (message.type == EXCEPTION) {
            TApplicationException exception = TApplicationException.read(in);
            in.readMessageEnd();
            throw exception;
        }
        if (message.type != REPLY) {
            throw new TApplicationException(INVALID_MESSAGE_TYPE,
                                            "Received invalid message type " + message.type + " from server");
        }
        if (!message.name.equals(this.name)) {
            throw new TApplicationException(WRONG_METHOD_NAME,
                                            "Wrong method name in reply: expected " + this.name + " but received " + message.name);
        }
        if (message.seqid != sequenceId) {
            throw new TApplicationException(BAD_SEQUENCE_ID, name + " failed: out of sequence response");
        }

        stats.addInvokeTime(nanosSince(start));
    }
View Full Code Here

Examples of org.apache.thrift.TApplicationException

            ThriftMethodHandler methodHandler = methods.get(method);

            try {
                if (methodHandler == null) {
                    throw new TApplicationException(UNKNOWN_METHOD, "Unknown method : '" + method + "'");
                }
                return methodHandler.invoke(protocolFactory, channel, sequenceId.getAndIncrement(), args);
            }
            catch (TException e) {
                Class<? extends TException> thrownType = e.getClass();
View Full Code Here

Examples of org.apache.thrift.TApplicationException

      scheduler.notifyScheduler();
      sessionNotifier.deleteSession(handle);

    } catch (RuntimeException e) {
      LOG.error("Error in sessionEnd of " + handle, e);
      throw new TApplicationException(e.getMessage());
    }
  }
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.