Giter VIP home page Giter VIP logo

chenxingqiang / hbasethriftpython Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ihazem/hbasethriftpython

0.0 0.0 0.0 8.05 MB

HBase Thrift Python Code and Examples

Thrift 2.80% Python 4.87% CMake 0.87% Makefile 21.39% Ruby 2.98% M4 1.22% Shell 3.12% Batchfile 0.44% Dockerfile 0.38% C++ 34.89% C 6.64% Lex 0.62% Yacc 0.20% C# 5.95% Pascal 3.32% Java 7.27% PHP 2.63% Emacs Lisp 0.04% Vim Script 0.02% TeX 0.35%

hbasethriftpython's Introduction

HBaseThriftPython

Install thrift on Mac:

$ brew install thrift

Install thrift on Linux:

$ yum install thrift

Generate HBase Thrift Bindings for Python

Create Project working directory

$ cd /Volumes/Files-Pics-Vids/Files/Files/Hazem/Professional/Career/Cloudera/Development/Git/Projects/
$ mkdir HBaseThrift
$ cd HBaseThrift/

To generate the bindings for Python, use the HBase IDL (Interface Definition Language). Target language libraries for C++, Java, Ruby, PHP, (and more) are generated by running this file through the Thrift compiler with the appropriate flags. This will create a dir ‘gen-py/hbase’ that will have the Python libraries used by all your Python code as it interacts with HBase

$ thrift -gen py /Volumes/Files-Pics-Vids/Files/Files/Hazem/Professional/Career/Cloudera/Development/Git/Projects/hbase/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift

On CDH Cluster

thrift -gen py /opt/cloudera/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373/lib/hue/apps/hbase/thrift/Hbase.thrift

Save Hbase.thrift file for future reference

$ cp /Volumes/Files-Pics-Vids/Files/Files/Hazem/Professional/Career/Cloudera/Development/Git/Projects/hbase/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift .
$ mv gen-py/* .
$ rm -rf gen-py/

get the Thrift code for the language (Python) that contains all the classes for connection to Thrift and its protocols. This code can be found at /path/to/thrift/thrift-0.9.0/lib/py/src/.

$ wget http://archive.apache.org/dist/thrift/0.12.0/thrift-0.12.0.tar.gz
$ tar -xzf thrift-0.12.0.tar.gz
$ mkdir thrift
$ cp -rp thrift-0.12.0/lib/py/src/* ./thrift/

If you need to install hbase python module

pip3 install hbase-thrift

References:

https://blog.cloudera.com/how-to-use-the-hbase-thrift-interface-part-1/

hbasethriftpython's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.