Package org.apache.avro

Examples of org.apache.avro.AvroRemoteException


    private void sleep() throws AvroRemoteException {
      try {
        Thread.sleep(delay.get());
      } catch (InterruptedException e) {
        throw new AvroRemoteException("Interrupted while sleeping", e);
      }
    }
View Full Code Here


        counterGroup.incrementAndGet("batch.empty");
        status = Status.BACKOFF;
      } else {
        if (!client.appendBatch(batch).equals(
            org.apache.flume.source.avro.Status.OK)) {
          throw new AvroRemoteException("RPC communication returned FAILED");
        }
      }

      transaction.commit();
      counterGroup.incrementAndGet("batch.success");
View Full Code Here

    @Override
    public Status append(AvroFlumeEvent event) throws AvroRemoteException {
      logger.info("Throwing: Received event from append(): {}",
          new String(event.getBody().array(), Charset.forName("UTF8")));
      throw new AvroRemoteException("Handler smash!");
    }
View Full Code Here

    @Override
    public Status appendBatch(List<AvroFlumeEvent> events) throws
        AvroRemoteException {
      logger.info("Throwing: Received {} events from appendBatch()",
          events.size());
      throw new AvroRemoteException("Handler smash!");
    }
View Full Code Here

        do {
            try {
                Status status = (batch == null) ? client.append(avroEvent) : client.appendBatch(batch);
                if (!status.equals(Status.OK)) {
                    throw new AvroRemoteException("RPC communication failed to " + agents[current].getHost() +
                        ":" + agents[current].getPort());
                }
                return;
            } catch (Exception ex) {
                if (i == retries - 1) {
View Full Code Here

    } catch (Exception e) {
      if (e instanceof RuntimeException)
        throw (RuntimeException)e;
      if (e instanceof IOException)
        throw (IOException)e;
      throw new AvroRemoteException(e);
    }
  }
View Full Code Here

    } catch (Exception e) {
      if (e instanceof RuntimeException)
        throw (RuntimeException)e;
      if (e instanceof IOException)
        throw (IOException)e;
      throw new AvroRemoteException(e);
    }
  }
View Full Code Here

    throws IOException {
    Object error = new GenericDatumReader<Object>(writer, reader, data)
      .read(null,in);
    if (error instanceof CharSequence)
      return new AvroRuntimeException(error.toString()); // system error
    return new AvroRemoteException(error);
  }
View Full Code Here

      return future.get();
    } catch (ExecutionException e) {
      if (e.getCause() instanceof Exception) {
        throw (Exception)e.getCause();
      } else {
        throw new AvroRemoteException(e.getCause());
      }
    }
  }
View Full Code Here

            Throwable error = callFuture.getError();
            if (error != null) {
              if (error instanceof Exception) {
                throw (Exception) error;
              } else {
                throw new AvroRemoteException(error);
              }
            }
          }
          return;
        }
View Full Code Here

TOP

Related Classes of org.apache.avro.AvroRemoteException

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.