hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Masatake Iwasaki <iwasak...@oss.nttdata.co.jp>
Subject Re: HTrace
Date Wed, 05 Mar 2014 18:29:03 GMT
Hi Biju,

 > 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>

Please try configuration like below.::

   <property>
     <name>hbase.trace.spanreceiver.classes</name>
     <value>org.cloudera.htrace.impl.LocalFileSpanReceiver</value>
   </property>

   <property>
     <name>hbase.local-file-span-receiver.path</name>
     <value>/var/log/hbase/htrace.out</value>
   </property>

and add lines for receivers initialization to your client code before starting trace.::

   import org.apache.hadoop.hbase.trace.SpanReceiverHost;
   ...
   private SpanReceiverHost spanReceiverHost;
   ...
   spanReceiverHost = SpanReceiverHost.getInstance(conf);

I will file a JIRA to fix documentation later.


Regards,
Masatake Iwasaki




(3/5/14, 9:08), Biju G.S Nair wrote:
> 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
View raw message