You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Andrzej <bo...@wp.pl> on 2017/09/29 17:08:12 UTC

Is possible make shared object from HBase sources?

I don't know why program hangs at:
hTable->Put(*std::move(put))
is I have written standalone test program, it was not errors.

Secondly: standalone program puts column more, *more faster* than two 
programs communicate by tcp and even udp.
Is one solution: shared object, but I have tried it a month ago. 
Problems was with Position Independent Code (PIC).
Problem is with libevent.a library.
It is possible change it , maybe by modify dockerfile?


Re: Is possible make shared object from HBase sources?

Posted by Sambhaji Sawant <sa...@gmail.com>.
Hello guys
Can you please suggest how can I use Multitenancy in HBase.I was searching
it but cannot get proper information. Please post some information related
to the multitenancy in hbase


On Sat, Sep 30, 2017 at 12:02 AM, Andrzej <bo...@wp.pl> wrote:

> W dniu 29.09.2017 o 20:15, Ted Yu pisze:
>
>> I didn't get the 'final link failed: Bad value' error when building on
>> docker.
>>
>> Consider rebuilding docker VM.
>>
>
> I start time consuming process rebuilding docker by command "build
> --no-cache" I must also change dockerfile to change PIC of libevent?
>

Re: Is possible make shared object from HBase sources?

Posted by Ted Yu <yu...@gmail.com>.
From https://buckbuild.com/rule/cxx_library.html , it seems to
support shared PIC-enabled build on Android.

bq. it is main, it is not shared library?

I added main() because you started with cxx_binary in BUCK which requires
main().

I did a quick search but haven't found build target in BUCK which
generates shared
PIC-enabled output.

Consider using make / CMake.

On Sat, Sep 30, 2017 at 12:17 AM, Andrzej <bo...@wp.pl> wrote:

> W dniu 30.09.2017 o 06:46, Ted Yu pisze:
>
>> https://pastebin.com/PPGkuxGS
>>
>
> > int main(int argc, char *argv[]) {
>
> I see, it is main, it is not shared library?
>
>
>> In BUCK, there is no need for compiler_flags and linker_flags
>>
>
> Compiler flags and linker flags to compilation .so file instead executable
> binary.
> Code pastebin.com/PPGkuxGS creates executable or shared library?
>

Re: Is possible make shared object from HBase sources?

Posted by Andrzej <bo...@wp.pl>.
W dniu 30.09.2017 o 06:46, Ted Yu pisze:
> https://pastebin.com/PPGkuxGS

 > int main(int argc, char *argv[]) {

I see, it is main, it is not shared library?

> 
> In BUCK, there is no need for compiler_flags and linker_flags

Compiler flags and linker flags to compilation .so file instead 
executable binary.
Code pastebin.com/PPGkuxGS creates executable or shared library?

Re: Is possible make shared object from HBase sources?

Posted by Ted Yu <yu...@gmail.com>.
Was there particular reason you used the following ?

extern "C" {

I was able to build the following:

https://pastebin.com/PPGkuxGS

In BUCK, there is no need for compiler_flags and linker_flags

See if the above formation works for you.

On Fri, Sep 29, 2017 at 8:28 PM, Andrzej <bo...@wp.pl> wrote:

> W dniu 30.09.2017 o 01:07, Ted Yu pisze:
>
>> If you can generate a (minimal) patch (without revealing your IP) which
>> fails (buck) building reliably, I will surely investigate.
>>
>> Minimal example with only one method which uses Configuration and Client:
> https://gist.github.com/borneq/9cdb03dba4ba29c971bf5bea73857446
>
> Thanks,
>

Re: Is possible make shared object from HBase sources?

Posted by Andrzej <bo...@wp.pl>.
W dniu 30.09.2017 o 01:07, Ted Yu pisze:
> If you can generate a (minimal) patch (without revealing your IP) which
> fails (buck) building reliably, I will surely investigate.
> 
Minimal example with only one method which uses Configuration and Client:
https://gist.github.com/borneq/9cdb03dba4ba29c971bf5bea73857446

Thanks,

Re: Is possible make shared object from HBase sources?

Posted by Ted Yu <yu...@gmail.com>.
If you can generate a (minimal) patch (without revealing your IP) which
fails (buck) building reliably, I will surely investigate.

Cheers

On Fri, Sep 29, 2017 at 2:33 PM, Andrzej <bo...@wp.pl> wrote:

> W dniu 29.09.2017 o 21:40, Andrzej pisze:
>
>> This is gist of my shared object:
>> https://gist.github.com/borneq/7148a6f13af736869fd9b1038b85e690
>> It compiling but is linking error - libevent.a is not PIC
>>
>>
> My changed BUCK file HBASE-14850/hbase-native-client/third-party/BUCK
> https://pastebin.com/7jDZTTPN
> Note: I have add compiler_flags=['-fPIC'] and changed force_static to
> False but not helps...
>

Re: Is possible make shared object from HBase sources?

Posted by Andrzej <bo...@wp.pl>.
W dniu 29.09.2017 o 21:40, Andrzej pisze:
> This is gist of my shared object:
> https://gist.github.com/borneq/7148a6f13af736869fd9b1038b85e690
> It compiling but is linking error - libevent.a is not PIC
> 

My changed BUCK file HBASE-14850/hbase-native-client/third-party/BUCK
https://pastebin.com/7jDZTTPN
Note: I have add compiler_flags=['-fPIC'] and changed force_static to 
False but not helps...

Re: Is possible make shared object from HBase sources?

Posted by Andrzej <bo...@wp.pl>.
W dniu 29.09.2017 o 21:32, Andrzej pisze:
> I have changed HBASE-14850/hbase-native-client/third-party/BUCK
> 
> def add_system_libs(names=[],
>                      lib_dir="/usr/lib/x86_64-linux-gnu",
>                      deps=[],
>                      exported_deps=[],
>                      exported_linker_flags=[],
>                      compiler_flags=['-fPIC']):<-------------HERE
> 
> and force_static=False,
> 
> But still error

This is gist of my shared object:
https://gist.github.com/borneq/7148a6f13af736869fd9b1038b85e690
It compiling but is linking error - libevent.a is not PIC

Re: Is possible make shared object from HBase sources?

Posted by Andrzej <bo...@wp.pl>.
W dniu 29.09.2017 o 20:32, Andrzej pisze:
> I start time consuming process rebuilding docker by command "build 
> --no-cache" I must also change dockerfile to change PIC of libevent?

I have changed HBASE-14850/hbase-native-client/third-party/BUCK

def add_system_libs(names=[],
                     lib_dir="/usr/lib/x86_64-linux-gnu",
                     deps=[],
                     exported_deps=[],
                     exported_linker_flags=[],
                     compiler_flags=['-fPIC']):<-------------HERE

and force_static=False,

But still error

Re: Is possible make shared object from HBase sources?

Posted by Andrzej <bo...@wp.pl>.
W dniu 29.09.2017 o 20:15, Ted Yu pisze:
> I didn't get the 'final link failed: Bad value' error when building on
> docker.
> 
> Consider rebuilding docker VM.

I start time consuming process rebuilding docker by command "build 
--no-cache" I must also change dockerfile to change PIC of libevent?

Re: Is possible make shared object from HBase sources?

Posted by Ted Yu <yu...@gmail.com>.
I didn't get the 'final link failed: Bad value' error when building on
docker.

Consider rebuilding docker VM.

FYI

On Fri, Sep 29, 2017 at 11:01 AM, Andrzej <bo...@wp.pl> wrote:

> W dniu 29.09.2017 o 19:12, Ted Yu pisze:
>
>> bq. Problem is with libevent.a library
>>
>> Can you share more details on what you found ?
>>
>> I did a quick search but didn't find how libevent.a is involved.
>>
>>
> Compiling with Buck and Docker:
> [+] BUILDING...12.4s [16%] (89/91 JOBS, 2 UPDATED, 2 [2.2%] CACHE MISS)
>  |=> //NativeLib:NativeLib#binary...  2.0s (running c++ link[1.9s])
> /usr/bin/ld: /usr/src/hbase/hbase-native-client/buck-out/gen/third-party/
> gen_libevent/gen_libevent/libevent.a(event.o): relocation R_X86_64_PC32
> against symbol `event_global_current_base_' can not be used when making a
> shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: Bad value
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
>

Re: Is possible make shared object from HBase sources?

Posted by Andrzej <bo...@wp.pl>.
W dniu 29.09.2017 o 19:12, Ted Yu pisze:
> bq. Problem is with libevent.a library
> 
> Can you share more details on what you found ?
> 
> I did a quick search but didn't find how libevent.a is involved.
> 

Compiling with Buck and Docker:
[+] BUILDING...12.4s [16%] (89/91 JOBS, 2 UPDATED, 2 [2.2%] CACHE MISS)
  |=> //NativeLib:NativeLib#binary...  2.0s (running c++ link[1.9s])
/usr/bin/ld: 
/usr/src/hbase/hbase-native-client/buck-out/gen/third-party/gen_libevent/gen_libevent/libevent.a(event.o): 
relocation R_X86_64_PC32 against symbol `event_global_current_base_' can 
not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)


Re: Is possible make shared object from HBase sources?

Posted by Ted Yu <yu...@gmail.com>.
bq. Problem is with libevent.a library

Can you share more details on what you found ?

I did a quick search but didn't find how libevent.a is involved.

On Fri, Sep 29, 2017 at 10:08 AM, Andrzej <bo...@wp.pl> wrote:

> I don't know why program hangs at:
> hTable->Put(*std::move(put))
> is I have written standalone test program, it was not errors.
>
> Secondly: standalone program puts column more, *more faster* than two
> programs communicate by tcp and even udp.
> Is one solution: shared object, but I have tried it a month ago. Problems
> was with Position Independent Code (PIC).
> Problem is with libevent.a library.
> It is possible change it , maybe by modify dockerfile?
>
>