Coder Social home page Coder Social logo

adaltas / node-hbase Goto Github PK

View Code? Open in Web Editor NEW
242.0 29.0 101.0 377 KB

Asynchronous HBase client for NodeJs using REST

Home Page: https://hbase.js.org

License: MIT License

CoffeeScript 98.86% Shell 0.28% Dockerfile 0.86%
nodejs hbase bigdata driver rest

node-hbase's Introduction

Build Status

Node.js HBase is a Node.JS client for the Apache HBase database. It use the Rest API (Stargate) to communicate with HBase. Currently, all the API is implemented and the data exchange format is JSON (but protocol buffer could follow).

Apache HBase is part of the Hadoop ecosystem. It describes itself as the Hadoop database optimized for random, realtime read/write access to big data. It is an open-source, distributed, versioned, column-oriented store modeled after Google Bigtable.

Client features include:

  • Intuitive API following Apache HBase naming conventions
  • Documentation and tests
  • Full Implementation of the REST API
  • Transparent encoding/decoding of values
  • Scanner and filter support implementing the stream.Readable API
  • Kerberos Support

About HBase

Apache HBase is part of the Hadoop ecosystem from the Apache Software Foundation. It is a column oriented database (think NoSql) that really scale and is modelled after Google papers and its BigTable database.

Installing

From your project directoy, via npm:

npm install hbase
# Or without the krb5 optional dependency
npm install hbase --no-optional

Documentation

  • Index
    Getting started
  • Client
    Server information and object factory
  • Connection
    HTTP REST requests
  • Row
    CRUD operation on rows and columns
  • Scanner
    Retrieve multiple rows and columns
  • Table
    Create, modify and delete HBase tables

Quick example

The following code initialise a new HBase instance, create a table and a column family, insert a record and read it.

const hbase = require('hbase')
// Instantiate a new client
client = hbase({ host: '127.0.0.1', port: 8080 })
// Create a table
client
.table('my_table' )
.create('my_column_family', function(err, success){
  // Insert a record
  client
  .table('my_table' )
  .row('my_row')
  .put('my_column_family:my_column', 'my value', function(err, success){
    // Read a record
    client
    .table('my_table' )
    .row('my_row')
    .get('my_column_family', function(err, [cell]){
      // Validate the result
      assert(cell.key, 'my_row')
      assert(cell.column, 'my_column_family:my_column')
      assert(cell.$, 'my value')
    })
  })
})

Or shortly as:

// Instantiate a new client
require('hbase')({ host: '127.0.0.1', port: 8080 })
// Create a table
.table('my_table' )
.create('my_column_family', function(err, success){
  // Insert a record
  this.put('my_column_family:my_column', 'my value', function(err, success){
    // Read a record
    this.get('my_column_family', function(err, [[cell]]){
      // Validate the result
      // ...
    })
  })
})

Using Kerberos/SPNEGO

Options accepts a krb5 object. Password and keytab authentication are supported. Refer to the krb5 package for additionnal information on how to configure the krb5 option.

Using a keytab:

const hbase = require('hbase');
hbase({
  host: '127.0.0.1',
  port: 8080,
  "krb5": {
    "principal": "{username}@{REALM}",
    "keytab": "{path/to/keytab}",
    "service_principal": "HTTP@{fqdn}"
  }
})
.version();

Using a password:

const hbase = require('hbase');
hbase({
  host: '127.0.0.1',
  port: 8080,
  "krb5": {
    "principal": "{username}@{REALM}",
    "password": "{password}",
    "service_principal": "HTTP@{fqdn}"
  }
})
.version();

Scanner and Filters

The scanner implement the stream.Readable API. For ease of usage, an optional callback argument may be provided. For example:

client
.table('node_table')
.scan({
  startRow: 'my_row',
  maxVersions: 1
}, function(err, rows){
  console.log(err, rows);
});

is equivalent to:

const rows = [];
scanner = client
.table('node_table')
.scan({
  startRow: 'my_row',
  maxVersions: 1
});
scanner.on('readable', function(){
  while(chunk = scanner.read()){
    rows.push(chunk);
  }
});
scanner.on('error', function(err){
  console.log(err);
});
scanner.on('end', function(){
  console.log(rows);
});

It can be quite a pain to figure out what options can be sent with a scanner request. You will find a lot of examples inside the Scanner test and also look at the examples published by Marc Trudel.

More documentation

Related projects

Contributors

This package is developed by Adaltas.

node-hbase's People

Contributors

iderr avatar lsarrazin avatar mihirkurdekar avatar msiebuhr avatar rreivax avatar wdavidw avatar whizz avatar yellowbrickc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-hbase's Issues

Example, not working...

/Users/h0x91b/Desktop/HBASE/nodejs/node_modules/hbase/lib/hbase-table.js:16
args = Array.prototype.slice.call(arguments_);
^
ReferenceError: arguments_ is not defined
at Table.create (/Users/h0x91b/Desktop/HBASE/nodejs/node_modules/hbase/lib/hbase-table.js:16:37)
at Object. (/Users/h0x91b/Desktop/HBASE/nodejs/index.js:7:2)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)

I greped in source and found 10+ "arguments_", is it ok?

Does the FilterList support two ValueFilter?

Does the FilterList support two ValueFilter? Such as:

var filter = {
    op: 'MUST_PASS_ALL',
    type: 'FilterList',
    filters: [
    {
        op: 'EQUAL',
        type: 'ValueFilter',
        comparator: {
            value: '0',
            type: 'BinaryComparator'
        }
    }
    ,   
    {
        op: 'EQUAL',
        type: 'ValueFilter',
        comparator: {
            value: '0.1.0',
            type: 'BinaryComparator'
        }
    }
    ]
}

Thanks!

encode RFC3986

Hi,

I found our URI contains special character: !'()*.
So could you please add encodeURIComponentRFC3986 function and then replace original encodeURIComponent in utils.coffee?

encodeURIComponentRFC3986: (str) ->
return encodeURIComponent(str).replace(/[!'()*]/g, (c) ->
return '%' + c.charCodeAt(0).toString(16);
);

Error 403 when trying to connect to HBase (using Kerberos)

Here is the full text of the error:

Error 403 org.apache.hadoop.security.authentication.client.AuthenticationException: java.lang.NullPointerException

Here's how I'm setting up the connection and trying to read the data:

const hbase = require('hbase');

const client = hbase({
  host: 'my.server.net',
  port: 8080,
  krb5: {
    principal: 'my-principal',
    keytab: '/path/to/keytab',
    service_principal: 'my-service-principal',
  }
});

client.tables((err, data) => {
  if (err) {
    console.log('Error');
    console.log(err);
  } else {
    console.log('The data is');
    console.log(data);
  }
})

Running Debian 8.6 in a Docker container. Kerberos ticket was set up via krb5 package. I can view the ticket from the command line by running klist.

Output from curl --negotiate -u : 'http://my.server.net:8080/version' is:

rest 0.0.3 
[JVM: Oracle Corporation 1.8.0_111-25.111-b15]
[OS: Linux 3.10.0-514.26.2.el7.x86_64 amd64] 
[Server: jetty/6.1.26.hwx] 
[Jersey: 1.9]

Output from curl --negotiate -u : 'http://my.server.net:8080/version/cluster' is:

1.1.2.2.6.0.3-8

Google Cloud BigTable

Is node-hbase suitable for Cloud BigTable?

If so does it communicate with the Cloud BigTable HBase Client (Java).
As it reads on the BigTable website "The Cloud Bigtable HBase client enables your application to connect to Cloud Bigtable through the Apache HBase API."

If so, is there a (recommended) way to bypass such a client and connect directly to the DB with node-hbase.

Thanks.

Pre-Spliting While Table Creation

Hello,
I tried pre-spliting while creating table using node-hbase . Following is my schema for column family.

var _cfSchema=       { 
                        name                :   _cf,
                        BLOCKSIZE           :   '65536',
                        BLOOMFILTER         :   'NONE',
                        BLOCKCACHE          :   'true',
                        ENCODE_ON_DISK      :   'false',
                        COMPRESSION         :   'NONE',
                        VERSIONS            :   '1',
                        REPLICATION_SCOPE   :   '0',
                        TTL                 :   '2147483647',
                        IN_MEMORY           :   'false',
                        SPLITS              :["h","q","z"]

            };

Splits changes are not getting reflected for table.
I also tried

var _tableSchema={};
            _tableSchema.name=_tableName;
            _tableSchema.IS_META='false';
            _tableSchema.IS_ROOT='false'; 
                       _tableSchema.SPLITS = ["h","q","z"];

It also not working for me.
Please can you let me know if i am putting these param at wrong places ?

NPM install failing due to [email protected]

Since the bumb from [email protected] to [email protected], the npm install is failing due to the change from [email protected] to [email protected].

The exact error message is "fatal error C1083: Cannot open include file: 'gssapi.h': No such file or directory (compiling source file ..\src\krb5.cc)". I tried installing the complete visual studio compile chain, python2.7 and even MIT Kerberos, but the error remains the same.
"npm install [email protected] --no-optional" is working fine, but since i cannot specify the "--no-optional" in the package.json, this will not suffice.

How to scan table reversed

Hello, I am trying to read a table order by rowkey desc.How to use scan method read the table by reversed rowkey. thanks

can I get multi rows in one request

excuse me, if I want to get all rows which row_key like "a_xxx"(such as a_001, a_002, a_100,...), how can I get all of these rows with one request? thanks

there are many connections to hbase

hello, I write a module to do all action in hbase: it create one client, and then do all action with this client. So I think that it should be just one connection to hbase, but I found taht there are 4000 connection to hbase, and most of it are TIME_WAIT status, it that something wrong. Here is my code

var config = GMAPI.config;
var Promise = require('bluebird');
var hbase = require('hbase');

var client = hbase({host: config.HBASE.hostname, port: config.HBASE.port});



// =====================================================================================================================
function get(table, rowKey, column, callback) {
    client.table(table).row(rowKey).get(column, {v:1}, function(err, data) {
        if (err) {
            if (err.code==404) callback(new Error('the mail does not exist!'));
            else callback(err);
            return;
        }

        var res = {};
        res.column = data[0].column.toString('utf-8');
        res.timestamp = data[0].timestamp;
        res.value = data[0].$.toString('utf-8');

        callback(null, res);
    });
};

function put(table, rowData, callback) {
    client.table(table).row().put(rowData, callback);
};


// =====================================================================================================================
module.exports = {
    /**
   * get email content from hbase with callback function
   * @function getMailContent
   * @param {String} rowKey
   * @param {Function} callback
   */
    getMailContent: function(rowKey, callback) {
        get(config.HBASE.mailTable, rowKey, config.HBASE.mailContentCol, callback);
    },

    /**
   * update email status and effect data to hbase
   * @function updateStatusData
   * @param {Array} rowData
   * @param {Function} callback
   */
    updateStatusData: function(rowData, callback) {
        put(config.HBASE.mailStatusTable, rowData, callback);
    },

    /**
   * get email content from hbase, return a Promise
   * @function getMailContentAsync
   * @param {String} rowKey
     * @return Promise
   */
    getMailContentAsync: function(rowKey) {
        return Promise.promisify(this.getMailContent)(rowKey);
    },

    /**
   * update email status and effect data to hbase, return a Promise
   * @function updateStatusDataAsync
   * @param {Array} rowData
   * @return Promise
   */
    updateStatusDataAsync: function(rowData) {
        return Promise.promisify(this.updateStatusData)(rowData);
    },

    /**
   * put email data to hbase
   * @function putMail
   * @param {Array} rowData
   * @param {Function} callback
   */
    putMail: function(rowData, callback) {
        put(config.HBASE.mailTable, rowData, callback);
    },

    /**
   * put email data to hbase, return a Promise
   * @function putMailAsync
   * @param {Array} rowData
   * @param {Function} callback
   */
    putMailAsync: function(rowData) {
        return Promise.promisify(this.putMail)(rowData);
    },

    /**
   * get email lp content from hbase, return a Promise
   * @function getMailContentAsync
   * @param {String} rowKey
     * @return Promise
   */
    getLpContentAsync: function(rowKey, column) {
        return Promise.promisify(get)(config.HBASE.mailTable, rowKey, column);
    }
}

batch not working for scan

Here is my code:

hbase({protocol:'http', host: 'whhdp03.wh.tvh.ca', port: 8080})
    .table('pageviews_hbase')
    .scan({
         batch:100,
        maxVersions: 1,
    }, function (err, rows){
        console.log('request error: ', err)       
        console.log('# of rows pulled', rows.length);
    })

results into INTERNAL ERROR 500.

I have 793 rows in database I am expecting this to result 4800+ lines.

If I removes batch property then it shows 1000 lines.

which port i should use

excuse me, i have no idea about hbase({ host: '127.0.0.1', port: 8080 }), i want to know which port i should use,,the Master port? or HBase Master web port, or others. wish your answer, thanks

Scanner returning incorrect result on re-runs

Hi, I was working with the scanner.
When I run this code for the first time on the server, it gives me the correct number of records. But every re-run after that, the number of records read changes.

Also, would appreciate if you could provide an example to use scanner.get for the same instead.

var latest = ''
var callback = function (err) {
    if (err)
        console.error(err);
    var scanner = client
        .table(tblName)
        .scan({
            batch: '1000',
            maxVersions: 1,
            startRow: latest,
            filter: {
                "type": "FirstKeyOnlyFilter"
            }
        },
            function (err, cells) {
                if (err)
                    console.error(err);
                else{
                    if (cells.length > 1) {
                        cells.splice(0, 1);
                        records = records.concat(cells);
                        latest = cells[cells.length - 1]['key']
                        console.log(cells.length);
                        scanner.delete(callback);
                    }
                    else {
                        console.log(records.length, "length");
                        scanner.delete(function (err) {
                            if (err)
                                console.error(err);
                        })
                    }
                }
            });
}

var scanner = client
    .table(tblName)
    .scan({
        batch: 1000,
        filter: {
            "type": "FirstKeyOnlyFilter"
        }
    }, function (err, cells) {
        if (err)
            console.error(err);
        else {
            if (cells.length > 1) {
                records = records.concat(cells);
                latest = cells[cells.length - 1]['key'];
                console.log(cells.length);
                scanner.delete(callback);
            }
        }
    });

User customization of HTTP(S) request options

Hello,
since HBase REST may run in many different settings, node-hbase should enable the user to pass options to HTTP(S) requests. For example, node-hbase can only handle HBase REST if it is accessed through the base URL, SSL certificates cannot be passed to the HTTPS requests, etc. The inability to customize connections limits the usability of this package.
To overcome this limitation, I propose that the options object passed to the Client class should be passed to the Connection class while preserving the properties necessary for node-hbase's operation. Although I understand the rationale of abstracting away the specifics of making HTTP(S) requests, the multitude of possible HBase REST configurations may require more control (and responsibility) over these requests from the user's side. For example, the HBase REST I use can be accessed through an nginx reverse proxy that requires a specific path and client-side SSL authentication.
What do you think? I submitted a PR with the proposed changes: #52. Could you take a look at it? I did some refactoring to make the Connection object more (unit)testable, added tests, added a Docker image based on sixeyed/hbase-stargate with an nginx reverse proxy to test custom paths, and also modified the Jenkins build accordingly.

hbase-rest-reverse-proxy can't used

const hbase = require('hbase');
client = hbase({ host: '127.0.0.1', port: 8080 });
client
.table('my_table' )
.create('my_column_family', function(err, success){
//success===null why???
})

what's the matter?
2019-02-20_015406

SingleColumnValueFilter is not encoded correctly

The SingleColumnValueFilter has additional parameters, family and qualifier, which need to be base64 encoded before making the request to hbase. The current implementation of sending filters only encodes fields named 'value' that contain a string plus some other restrictions. I recommend the following fix in hbase-scanner.js to allow for a more flexible solution:

if(params.filter){
        var fieldsToEncode = {
          value: true, // generic, used for many filters
          family: true, // SingleColumnValueFilter to specify what column to search
          qualifier: true, // SingleColumnValueFilter to specify what column to search
        };
        var encode = function(obj){
            for(var k in obj){
                if(fieldsToEncode[k] && (!obj['type'] || obj['type'] !== 'RegexStringComparator' && obj['type'] !== 'PageFilter' )){
                    obj[k] = utils.base64.encode(obj[k]);
                }else if(typeof obj[k] === 'object'){
                    encode(obj[k]);
                }
            }
        }
        encode(params.filter);
        params.filter = JSON.stringify(params.filter);
    }

Connection Time Out Handling

Hi ,Is there any timeout handling or option we can set. As if Hbase is not responding for request for log time node js client still waiting for that .

Thanks in advance

The example in the README file don't work

The example in the README file don't work.

Any suggestions?

node hbase.js 

/Users/jonas/git/colmsjo/wip/node_modules/hbase/lib/hbase-table.js:16
  args = Array.prototype.slice.call(arguments_);
                                    ^
ReferenceError: arguments_ is not defined
    at Table.create (/Users/jonas/git/colmsjo/wip/node_modules/hbase/lib/hbase-table.js:16:37)
    at Object.<anonymous> (/Users/jonas/git/colmsjo/wip/NodeJS/hbase.js:6:6)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

Versions used:

Gizur-Laptop-5:NodeJS jonas$ node -v
v0.8.4
Gizur-Laptop-5:NodeJS jonas$ npm -v
1.1.62

getting "has no method get"

Getting an error while trying to use node.js with node-hbase module:

here's my code:

var hbase = require('hbase');
hbase({
host: '192.168.1.107',
port: 8000
}).getVersionCluster( function( error, versionCluster ){
console.log( versionCluster );
})
Here's the error:

/home/user1/node.js.server/node_modules/hbase/lib/client.js:117
return this.connection.get("/version/cluster", callback);

TypeError: Object [object Object] has no method 'get'
at Client.getVersionCluster (/home/user1/node.js.server/node_modules/hbase/lib/client.js:117:26)
at Object. (/home/user1/node.js.server/hbTest.js:5:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:497:10)
at process._tickCallback (node.js:427:13)

Assertion error when trying to connec to hbase

I have hadoop and hbase 1.1.2 set up on my vmware ubuntu system. I am trying to connect to hbase to insert a table with rows but keep ending up with an assertion error. I am using the sample code from the npm package website:


var assert = require('assert');
var hbase = require('hbase');
 
hbase({ host: '127.0.0.1', port: 8080 })
.table('my_table' )
.create('my_column_family', function(err, success){
  this
  .row('my_row')
  .put('my_column_family:my_column', 'my value', function(err, success){
    this.get('my_column_family', function(err, cells){
      this.exists(function(err, exists){
        assert.ok(exists);
      });
    });
  });
});

do not set default port if not set

Hi,
we use an HBase/Rest-Service on AWS and we don't have a port to supply as option. What do you think about the idea to only set the fallback if the host is missing too or is set to localhost?

We would implement this if it's ok for you.

Cheers

SingleColumnValueFilter Syntax

Hello David,

Could you please help me get the syntax right for the following query.

scanner = client
            .table('UserLog')
            .scan({
                //startRow: '1437696000000',
                //maxVersions: 1,
                filter: {
                    "op": "MUST_PASS_ALL",
                    "type": "FilterList",
                    "filters": [
                        {
                            "op": "EQUAL",
                            "type": "SingleColumnValueFilter",
                            "family": "entry",
                            "qualifier": "merchantId",
                            "comparator": {
                                "value": "30",
                                "type": "BinaryComparator"
                            },
                            "ifMissing": true,
                            "latestVersion": true
                        },
                        {
                            "op": "EQUAL",
                            "type": "SingleColumnValueFilter",
                            "family": "entry",
                            "qualifier": "tag",
                            "comparator": {
                                "value": "CloseOut, Transaction",
                                "type": "BinaryComparator"
                            },
                            "ifMissing": true,
                            "latestVersion": true
                        },
                        {
                            "op": "GREATER_OR_EQUAL",
                            "type": "SingleColumnValueFilter",
                            "family": "entry",
                            "qualifier": "addedTime",
                            "comparator": {
                                "value": "1437696000000",
                                "type": "BinaryComparator"
                            },
                            "ifMissing": true,
                            "latestVersion": true
                        },
                        {
                            "op": "LESS_OR_EQUAL",
                            "type": "SingleColumnValueFilter",
                            "family": "entry",
                            "qualifier": "addedTime",
                            "comparator": {
                                "value": "1437764400000",
                                "type": "BinaryComparator"
                            },
                            "ifMissing": true,
                            "latestVersion": true
                        }
                    ]
                }
            });

Many thanks,
Karthik

scan with support of batch/startTime/endTime options

It said in document it support batch/startTime/endTime options but it actually did not support.
Related JS codes need to update.

scanner.js
Scanner.prototype.init = function(callback) {
params = {};
  if (params.batch == null) {
    params.batch = 1000;
  }
key = "/" + this.options.table + "/scanner";
  encoding
}

after update(I just write js codes not coffee script)

scanner.js
Scanner.prototype.init = function(callback) {
params = {};
//update for batch options 
 params.batch = isNaN(this.options.batch)?1000: Number(this.options.batch);
key = "/" + this.options.table + "/scanner";
encoding = this.options.encoding === 'undefined' ? this.options.encoding : this.client.options.encoding;
//update for startTime/endTime options 
 if (this.options.startTime) {
    params.startTime = this.options.startTime;
  }
  if (this.options.endTime) {
    params.endTime = this.options.endTime;
  }
}

HBase 0.98 compatibility with node module

Hello, I am trying to implement CRUD operations with Hbase 0.98. For creation of tables and insertion of data it is working fine. But while retriving it is giving 404- not found response. I checked through hbase shell, data is present. I want to know whether 0.98 is supported or not with this module.

client.getVersion is not a function

Hi I have installed hbase module with sudo npm install hbase --no-optional .

I was running follwing code

var hbase = require('hbase');

var client = new hbase.Client({
host: 'myIP',
port: 8080
});

console.log("Got Client"+ client)

client.getVersion( function( error, version ){
console.log( version );
} );

Rest service is running on host and port . But getting following error

client.getVersion is not a function
at Object. (/home/sohanvir/Desktop/hbase-node.js:10:9)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3

broken installation

Tried to install this on 2 different computers (Macbook Pro with Yosemite) and got this errors:

โœ— npm install hbase --save
npm http request GET https://registry.npmjs.org/hbase
npm http 200 https://registry.npmjs.org/hbase
npm http fetch GET https://registry.npmjs.org/hbase/-/hbase-0.2.2.tgz
npm http fetch 200 https://registry.npmjs.org/hbase/-/hbase-0.2.2.tgz
npm http request GET https://registry.npmjs.org/krb5
npm http 304 https://registry.npmjs.org/krb5

> [email protected] preinstall /Users/lironshmuel/Workspace/playground/node_modules/hbase/node_modules/krb5
> coffee -b -o lib src


> [email protected] install /Users/lironshmuel/Workspace/playground/node_modules/hbase/node_modules/krb5
> node-gyp rebuild

  CXX(target) Release/obj.target/krb5/src/krb5.o
In file included from ../src/krb5.cc:1:
../src/krb5.h:58:79: error: no type named 'AccessorInfo' in namespace 'v8'
  static v8::Handle<v8::Value> getToken(Local<v8::String> property, const v8::AccessorInfo& info);
                                                                          ~~~~^
../src/krb5.h:59:77: error: no type named 'AccessorInfo' in namespace 'v8'
  static v8::Handle<v8::Value> getErr(Local<v8::String> property, const v8::AccessorInfo& info);
                                                                        ~~~~^
../src/krb5.h:62:39: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
  static v8::Handle<Value> Init(const v8::Arguments& args);
                                      ^~~~~~~~~~~~~
                                      v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/krb5.cc:1:
../src/krb5.h:63:45: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
  static v8::Handle<Value> ByPassword(const v8::Arguments& args);
                                            ^~~~~~~~~~~~~
                                            v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/krb5.cc:1:
../src/krb5.h:64:43: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
  static v8::Handle<Value> ByKeyTab(const v8::Arguments& args);
                                          ^~~~~~~~~~~~~
                                          v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/krb5.cc:1:
../src/krb5.h:65:43: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
  static v8::Handle<Value> GenToken(const v8::Arguments& args);
                                          ^~~~~~~~~~~~~
                                          v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/krb5.cc:1:
../src/krb5.h:66:42: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
  static v8::Handle<Value> Destroy(const v8::Arguments& args);
                                         ^~~~~~~~~~~~~
                                         v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/krb5.cc:1:
../src/krb5.h:68:43: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
  static v8::Handle<Value> InitSync(const v8::Arguments& args);
                                          ^~~~~~~~~~~~~
                                          v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/krb5.cc:1:
../src/krb5.h:69:49: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
  static v8::Handle<Value> ByPasswordSync(const v8::Arguments& args);
                                                ^~~~~~~~~~~~~
                                                v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/krb5.cc:1:
../src/krb5.h:70:47: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
  static v8::Handle<Value> ByKeyTabSync(const v8::Arguments& args);
                                              ^~~~~~~~~~~~~
                                              v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/krb5.cc:1:
../src/krb5.h:71:47: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
  static v8::Handle<Value> GenTokenSync(const v8::Arguments& args);
                                              ^~~~~~~~~~~~~
                                              v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/krb5.cc:1:
../src/krb5.h:72:46: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
  static v8::Handle<Value> DestroySync(const v8::Arguments& args);
                                             ^~~~~~~~~~~~~
                                             v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/krb5.cc:1:
../src/krb5.h:74:38: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
  static v8::Handle<Value> New(const Arguments& args);
                                     ^~~~~~~~~
                                     v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/krb5.cc:1:
../src/krb5.h:84:17: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
  UvBaton(const v8::Arguments& args);
                ^~~~~~~~~~~~~
                v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/krb5.cc:26:15: warning: 'krb5_cc_default' is deprecated: use GSS.framework [-Wdeprecated-declarations]
  this->err = krb5_cc_default(this->context, &this->cache);
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1736:31: note: 'krb5_cc_default' has been explicitly
      marked deprecated here
krb5_error_code KRB5_CALLCONV krb5_cc_default
                              ^
../src/krb5.cc:30:14: warning: 'krb5_cc_get_name' is deprecated: use GSS.framework [-Wdeprecated-declarations]
  if(!exists(krb5_cc_get_name(this->context, this->cache))){
             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1286:1: note: 'krb5_cc_get_name' has been explicitly
      marked deprecated here
krb5_cc_get_name (krb5_context context, krb5_ccache cache) KERBEROS_APPLE_DEPRECATED("use GSS.framework");
^
../src/krb5.cc:31:17: warning: 'krb5_cc_initialize' is deprecated: use GSS.framework [-Wdeprecated-declarations]
    this->err = krb5_cc_initialize(this->context, this->cache, this->client_principal);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1292:1: note: 'krb5_cc_initialize' has been explicitly
      marked deprecated here
krb5_cc_initialize(krb5_context context, krb5_ccache cache,
^
../src/krb5.cc:42:17: warning: 'krb5_cc_resolve' is deprecated: use GSS.framework [-Wdeprecated-declarations]
    this->err = krb5_cc_resolve(this->context, name, &cache);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1728:31: note: 'krb5_cc_resolve' has been explicitly
      marked deprecated here
krb5_error_code KRB5_CALLCONV krb5_cc_resolve
                              ^
../src/krb5.cc:46:17: warning: 'krb5_cc_default' is deprecated: use GSS.framework [-Wdeprecated-declarations]
    this->err = krb5_cc_default(this->context, &cache);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1736:31: note: 'krb5_cc_default' has been explicitly
      marked deprecated here
krb5_error_code KRB5_CALLCONV krb5_cc_default
                              ^
../src/krb5.cc:49:15: warning: 'krb5_cc_destroy' is deprecated: use GSS.framework [-Wdeprecated-declarations]
  this->err = krb5_cc_destroy(this->context, cache);
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1296:1: note: 'krb5_cc_destroy' has been explicitly
      marked deprecated here
krb5_cc_destroy (krb5_context context, krb5_ccache cache) KERBEROS_APPLE_DEPRECATED("use GSS.framework");
^
../src/krb5.cc:56:15: warning: 'krb5_init_secure_context' is deprecated: use GSS.framework [-Wdeprecated-declarations]
  this->err = krb5_init_secure_context(&this->context);
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1454:31: note: 'krb5_init_secure_context' has been
      explicitly marked deprecated here
krb5_error_code KRB5_CALLCONV krb5_init_secure_context
                              ^
../src/krb5.cc:69:5: warning: 'krb5_cc_close' is deprecated: use GSS.framework [-Wdeprecated-declarations]
    krb5_cc_close(this->context, this->cache);
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1299:1: note: 'krb5_cc_close' has been explicitly marked
      deprecated here
krb5_cc_close (krb5_context context, krb5_ccache cache) KERBEROS_APPLE_DEPRECATED("use GSS.framework");
^
../src/krb5.cc:71:5: warning: 'krb5_free_principal' is deprecated: use GSS.framework [-Wdeprecated-declarations]
    krb5_free_principal(this->context,this->client_principal);
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1760:20: note: 'krb5_free_principal' has been explicitly
      marked deprecated here
void KRB5_CALLCONV krb5_free_principal
                   ^
../src/krb5.cc:73:5: warning: 'krb5_free_context' is deprecated: use GSS.framework [-Wdeprecated-declarations]
    krb5_free_context(this->context);
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1456:20: note: 'krb5_free_context' has been explicitly
      marked deprecated here
void KRB5_CALLCONV krb5_free_context
                   ^
../src/krb5.cc:85:10: warning: 'krb5_get_error_message' is deprecated: use GSS.framework [-Wdeprecated-declarations]
  return krb5_get_error_message(this->context, this->err);
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:2447:1: note: 'krb5_get_error_message' has been
      explicitly marked deprecated here
krb5_get_error_message (krb5_context, krb5_error_code) KERBEROS_APPLE_DEPRECATED("use GSS.framework");
^
../src/krb5.cc:97:21: warning: 'krb5_kt_resolve' is deprecated: use GSS.framework [-Wdeprecated-declarations]
        this->err = krb5_kt_resolve(this->context, kt, &keytab);
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1698:31: note: 'krb5_kt_resolve' has been explicitly
      marked deprecated here
krb5_error_code KRB5_CALLCONV krb5_kt_resolve
                              ^
../src/krb5.cc:100:21: warning: 'krb5_kt_default' is deprecated: use GSS.framework [-Wdeprecated-declarations]
        this->err = krb5_kt_default(this->context,&keytab);
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1706:31: note: 'krb5_kt_default' has been explicitly
      marked deprecated here
krb5_error_code KRB5_CALLCONV krb5_kt_default
                              ^
../src/krb5.cc:105:19: warning: 'krb5_kt_default' is deprecated: use GSS.framework [-Wdeprecated-declarations]
      this->err = krb5_kt_default(this->context,&keytab);
                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1706:31: note: 'krb5_kt_default' has been explicitly
      marked deprecated here
krb5_error_code KRB5_CALLCONV krb5_kt_default
                              ^
../src/krb5.cc:110:17: warning: 'krb5_get_init_creds_keytab' is deprecated: use GSS.framework [-Wdeprecated-declarations]
    this->err = krb5_get_init_creds_keytab(context, cred, client_principal, keytab, 0, NULL, NULL);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:2337:1: note: 'krb5_get_init_creds_keytab' has been
      explicitly marked deprecated here
krb5_get_init_creds_keytab
^
../src/krb5.cc:114:17: warning: 'krb5_verify_init_creds' is deprecated: use GSS.framework [-Wdeprecated-declarations]
    this->err = krb5_verify_init_creds(this->context,this->cred,NULL, NULL, NULL, NULL);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:2362:1: note: 'krb5_verify_init_creds' has been
      explicitly marked deprecated here
krb5_verify_init_creds
^
../src/krb5.cc:119:17: warning: 'krb5_cc_store_cred' is deprecated: use GSS.framework [-Wdeprecated-declarations]
    this->err = krb5_cc_store_cred(this->context, this->cache, this->cred);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1302:1: note: 'krb5_cc_store_cred' has been explicitly
      marked deprecated here
krb5_cc_store_cred (krb5_context context, krb5_ccache cache,
^
../src/krb5.cc:132:17: warning: 'krb5_get_init_creds_password' is deprecated: use GSS.framework [-Wdeprecated-declarations]
    this->err = krb5_get_init_creds_password(this->context,this->cred,this->client_principal,password, NULL, NULL, 0, NULL, NULL);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:2325:1: note: 'krb5_get_init_creds_password' has been
      explicitly marked deprecated here
krb5_get_init_creds_password
^
../src/krb5.cc:137:17: warning: 'krb5_cc_store_cred' is deprecated: use GSS.framework [-Wdeprecated-declarations]
    this->err = krb5_cc_store_cred(this->context, this->cache, this->cred);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/krb5/krb5.h:1302:1: note: 'krb5_cc_store_cred' has been explicitly
      marked deprecated here
krb5_cc_store_cred (krb5_context context, krb5_ccache cache,
^
../src/krb5.cc:152:7: warning: 'gss_import_name' is deprecated: use GSS.framework [-Wdeprecated-declarations]
  ret=gss_import_name((OM_uint32*)&this->err, &service,GSS_C_NT_HOSTBASED_SERVICE, desired_name);
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/gssapi/gssapi.h:586:1: note: 'gss_import_name' has been explicitly
      marked deprecated here
gss_import_name(
^
../src/krb5.cc:171:9: warning: 'gss_init_sec_context' is deprecated: use GSS.framework [-Wdeprecated-declarations]
  err = gss_init_sec_context((OM_uint32*)&this->err,
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/gssapi/gssapi.h:461:1: note: 'gss_init_sec_context' has been
      explicitly marked deprecated here
gss_init_sec_context(
^
../src/krb5.cc:191:3: warning: 'gss_release_name' is deprecated: use GSS.framework [-Wdeprecated-declarations]
  gss_release_name((OM_uint32*)&this->err, &target_name);
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/gssapi/gssapi.h:593:1: note: 'gss_release_name' has been explicitly
      marked deprecated here
gss_release_name(
^
../src/krb5.cc:198:27: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
UvBaton<T>::UvBaton(const v8::Arguments& args){
                          ^~~~~~~~~~~~~
                          v8::internal::Arguments
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/krb5.cc:200:51: error: member access into incomplete type 'const v8::internal::Arguments'
  this->wrapper = node::ObjectWrap::Unwrap<T>(args.This());
                                                  ^
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../src/krb5.cc:201:22: error: member access into incomplete type 'const v8::internal::Arguments'
  this->length = args.Length()-1;
                     ^
/Users/lironshmuel/.node-gyp/0.12.7/deps/v8/include/v8.h:127:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../src/krb5.cc:202:73: error: type 'const v8::internal::Arguments' does not provide a subscript operator
  this->callback = Persistent<Function>::New(Handle<Function>::Cast(args[0]));
                                                                    ~~~~^~
../src/krb5.cc:205:38: error: type 'const v8::internal::Arguments' does not provide a subscript operator
    v8::String::Utf8Value params(args[i+1]->ToString());
                                 ~~~~^~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
22 warnings and 20 errors generated.
make: *** [Release/obj.target/krb5/src/krb5.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/lironshmuel/Workspace/playground/node_modules/hbase/node_modules/krb5
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing [email protected]
[email protected] node_modules/hbase

Can't get with hex row key.

TEST table
\xEE column=c1:1234, timestamp=1405787868039, value=1234

var assert = require('assert');
var hbase = require('hbase');

hbase({host: '192.168.1.1', port: 8080})
.getRow('TEST','\xEE')
.get('c1:1234', function(error, value){
console.log(value);
}
);

this doesn't work properly.

hbase filter ----SingleColumnValueFilter

I want to get the whole row by searching for a value. Which filter should I use? I tried the SingleColumnValueFilter, but failed. Can you tell me how to solve this problem?Thanks

Node dies when HBase is offline

I have this simple code:

var hbase = require('hbase');

hbase({host: 'localhost', port: 8080})
.getVersionCluster( function( error, versionCluster ){
    if (error) {
        console.log(error);
    } else {
        console.log( versionCluster );
    }
} );

When HBase (or Stargate) is not running, the script dies with error, that I am unable to catch in any way:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: socket hang up
    at createHangUpError (http.js:1092:15)
    at Socket.<anonymous> (http.js:1175:27)
    at Socket.emit (events.js:88:20)
    at Array.0 (net.js:300:10)
    at EventEmitter._tickCallback (node.js:192:40)

Node version is the latest 0.6.3. But the same issue manifests in 0.6.1, both Windows and Linux.

Thanks for any ideas.

why table and data is not inserted in hbase

I am trying hbase node module https://github.com/wdavidw/node-hbase

var assert = require('assert')
, hbase = require('hbase');

hbase({ host: 'localhost', port: 60010 })
.getTable('my_table' )
.create('my_column_family', function(err, success){
console.log(err);
this
.getRow('my_row')
.put('my_column_family:my_column', 'my value', function(err, success){
this.get('my_column_family', function(err, cells){
this.exists(function(err, exists){
// assert.ok(exists);
console.log(exists);
});
});
});
});
is giving me this

{ stack: [Getter/Setter],
arguments: undefined,
type: undefined,
message: '405: Method Not Allowed',
code: 405,
body: '' }
false
pls suggest why this error is coming .

ReferenceError: arguments_ is not defined

Hi,
I do get the following error, when running the example.

/node_modules/hbase/lib/hbase-table.js:16
args = Array.prototype.slice.call(arguments_);
^
ReferenceError: arguments_ is not defined

Can anyone help me out to get this working? I am running the latest node version v0.10.6.

Please publish 0.1.1 to npm

Just noticed the latest isn't yet up on npm. By the way, thanks for creating this! Your library has been really valuable to us in a project for work.

Callback triggered twice

Hadoop Version: 3.2.0
HBase Version: 2.1.3

const hbase = require('hbase')
// Instantiate a new client
client = hbase({ host: '10.21.137.43', port: 60080 });
const myRow = new hbase.Row(client, 'webtable', 'com.cnn.www')
myRow.get('contents', (err, value) => {
  console.log('==contents======');
  console.log(err);
  console.log(value);
});

Results:

==contents======
null
[ { column: 'contents:html',
    timestamp: 1552356956216,
    '$': '<html>...02' },
  { column: 'contents:key01',
    timestamp: 1552374290762,
    '$': 'my value 1' },
  { column: 'contents:key02',
    timestamp: 1552374290762,
    '$': 'my value 2' } ]
==contents======
Error: Connection closed
    at IncomingMessage.<anonymous> (/Users/BrianShen/Code/Brian/tset/Node/hbase/node_modules/hbase/lib/connection.js:130:13)
    at IncomingMessage.emit (events.js:182:13)
    at Socket.socketCloseListener (_http_client.js:355:11)
    at Socket.emit (events.js:187:15)
    at TCP._handle.close (net.js:606:12)
null

unable to connect to hbase server using nodejs

var hbase = require('hbase');
hbase({
host: 'host.com',
port: 22,
timeout: 6000,
"krb5": {
"principal": "username@username",
"password": "password@password"
}
})
.table('emp')
.scan({
startRow: 'name',
maxVersions: 1
}, function (err, rows) {
console.log(err, rows);
});

.getTable( 'my_table' ) TypeError: undefined is not a function

Hi,
I am getting an issue when trying to get a table from my client. My code is as follows:

  hbase({ host: '127.0.0.1', port: 8080 })
  .getTable( 'websites' )
  .getSchema(function(error, schema){
    console.log(schema);
  });

and these are the errors that follow:

.getTable( 'websites' )
   ^
TypeError: undefined is not a function

Is there another way of getting a table?

Use startTime and endTime

Hello, I'm trying filter only rows between 1470937869725 and 1470937869735 timestamp.

var hbase = require('hbase');
var client = new hbase.Client({host: '127.0.0.1', port: 8080});
var myScanner = client.table('MyTable').scan({startTime: 1470937869725, endTime: 1470937869735}, function(err, rows){
console.log(rows);
});

But all events are retrieved (not just those in the interval).

What am I doing wrong?

scan seems to be broken...

I'm trying tu use the scan to retreive data with filters (I want to get columns which names has a timestamp prefix from a date to another date from 1 row). I manage to configure the scanner and its filter but can't get the results... Here is my code:

var TABLE = 'myTable';
var TEST_KEY = 'myRowKey';
var FROM = '2014-01-01';
var TO = '2014-12-31';

var scannerFilter = {
        "op" : "MUST_PASS_ALL",
        "type" : "FilterList",
        "filters" : [
            {
                "type": "RowFilter",
                "op": "EQUAL",
                "comparator": {
                    "type": "BinaryComparator",
                    "value": TEST_KEY
                }
            },
            {
                "type": "ColumnRangeFilter",
                "minColumn": FROM,
                "minColumnInclusive": true,
                "maxColumn": TO,
                "maxColumnInclusive": true
            }
        ]
    };

var scannerOptions = {
        table : TABLE,
        encoding: 'utf-8',
        maxVersion: 1,
        filter: scannerFilter
    };

client.table(TABLE)
        .scan(scannerOptions, function(err, rows){
            console.log(err, rows);
        });

rows.length is correct. But rows is an array of string... and these strings are (and it's really a string!!) [object Object] !

I probably miss something. I tried a lot of things:

  • in table.js, line 315 (in Table.prototype.scan): adding console.log(chunk) after while (chunk = scanner.read()) { => chunk is a string [object Object]
  • in scanner.js, line 211 (in Scanner.prototype.get): adding console.log(data) before return cells.push(data); => data is the JSON object I want
  • in scanner.js, line 284 (Scanner.prototype._read): adding console.log(cell) after cell = cells[_i]; => cell is the JSON object I want
  • in scanner.js, line 286 (Scanner.prototype._read): adding console.log(_results) before return _results; => _results is an array of boolean

I did not understand what's wrong... Any idea?

I'm using:

  • nodeJS v0.10.36
  • Install node-hbase with npm install hbase

Wrong url.encode

Trying to get all columns from ein row

get(table,key,colums, {start:111,end:222})

url.encode(table, key, null, 111, 222) results in url :

/table/key/111,222

The empty colums ignored in the url -> Server response "invalid path"

The url should be with empty path part:

/table/key//111,222

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.