hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Biju G.S Nair" <bijun...@acm.org>
Subject Re: HTrace
Date Wed, 05 Mar 2014 19:51:46 GMT
Thanks Masatake.

The org.apache.hadoop.hbase.trace.SpanReceiverHost is available only in the
server jar. If we intend to keep the client and server components in
separate jars this call need to be included in the client jar as well.





Thanks,
Biju
Tel#: 978-707-5066


On Wed, Mar 5, 2014 at 1:29 PM, Masatake Iwasaki <
iwasakims@oss.nttdata.co.jp> wrote:

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message