Package org.cloudera.htrace

Examples of org.cloudera.htrace.SpanReceiver


    for (String className : receiverNames) {
      className = className.trim();

      try {
        implClass = Class.forName(className);
        SpanReceiver receiver = loadInstance(implClass);
        if (receiver != null) {
          receivers.add(receiver);
          LOG.info("SpanReceiver " + className + " was loaded successfully.");
        }
View Full Code Here


    }
  }

  private SpanReceiver loadInstance(Class<?> implClass)
      throws IOException {
    SpanReceiver impl = null;
    try {
      Object o = implClass.newInstance();
      impl = (SpanReceiver)o;
      impl.configure(new HBaseHTraceConfiguration(this.conf));
    } catch (SecurityException e) {
      throw new IOException(e);
    } catch (IllegalArgumentException e) {
      throw new IOException(e);
    } catch (RuntimeException e) {
View Full Code Here

    }
  }

  private SpanReceiver loadInstance(Class<?> implClass)
      throws IOException {
    SpanReceiver impl;
    try {
      Object o = ReflectionUtils.newInstance(implClass, conf);
      impl = (SpanReceiver)o;
    } catch (SecurityException e) {
      throw new IOException(e);
View Full Code Here

     * @throws Exception on failure
     */
    @Test
    public void testWriteSpans() throws Exception {
        // get a receiver for the spans
        SpanReceiver receiver = TracingCompat.newTraceMetricSource();
        // which also needs to a source for the metrics system
        Metrics.getManager().registerSource("testWriteSpans-source", "source for testWriteSpans",
            receiver);

        // watch our sink so we know when commits happen
        CountDownLatch latch = new CountDownLatch(1);
        waitForCommit(latch);

        // write some spans
        TraceScope trace = Trace.startSpan("Start write test", Sampler.ALWAYS);
        Span span = trace.getSpan();

        // add a child with some annotations
        Span child = span.child("child 1");
        child.addTimelineAnnotation("timeline annotation");
        TracingCompat.addAnnotation(child, "test annotation", 10);
        child.stop();

        // sleep a little bit to get some time difference
        Thread.sleep(100);

        trace.close();

        // pass the trace on
        receiver.receiveSpan(span);

        // wait for the tracer to actually do the write
        latch.await();

        // look for the writes to make sure they were made
View Full Code Here

    for (String className : receiverNames) {
      className = className.trim();

      try {
        implClass = Class.forName(className);
        SpanReceiver receiver = loadInstance(implClass);
        if (receiver != null) {
          receivers.add(receiver);
          LOG.info("SpanReceiver " + className + " was loaded successfully.");
        }
View Full Code Here

    }
  }

  private SpanReceiver loadInstance(Class<?> implClass)
      throws IOException {
    SpanReceiver impl = null;
    try {
      Object o = implClass.newInstance();
      impl = (SpanReceiver)o;
      impl.configure(new HBaseHTraceConfiguration(this.conf));
    } catch (SecurityException e) {
      throw new IOException(e);
    } catch (IllegalArgumentException e) {
      throw new IOException(e);
    } catch (RuntimeException e) {
View Full Code Here

TOP

Related Classes of org.cloudera.htrace.SpanReceiver

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.