hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Biju G.S Nair" <gs.b...@gmail.com>
Subject HTrace
Date Wed, 05 Mar 2014 17:08:00 GMT
Trying to understand the process to enable HTrace. Following is the change
to hbase-site.xml
  <property>
    <name>hbase.trace.spanreceiver.localfilespanreceiver.filename</name>
    <value>/var/log/hbase/htrace.out</value>
  </property>

Following is a simple code to trace a get call

public static void main(String[] args) throws IOException {

           Configuration conf = HBaseConfiguration.create();

          TraceScope getSpan = Trace.startSpan("Gets", Sampler.ALWAYS);

    try{

          System.out.println("Is tracing on :"+Trace.isTracing());

          HTable table = new HTable(conf, "t1");

         Get get = new Get(Bytes.toBytes("r1"));

         Result res = table.get(get);

         System.out.println(res.toString());

         table.close();

         } catch(Exception e) {

                    getSpan.close();

         } finally {

        getSpan.close();

   }

}
Is something missed
?
No trace file is getting
generated
. Thanks in advance.

Thanks,
Biju

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message