Connect to Accumulo by NodeJS

I am trying to connect to Accumulo from NodeJS through a Thrift proxy but have not been successful.

var thrift = require("thrift");
var AccumuloClient = require("./AccumuloProxy");

var transport = thrift.TFramedTransport;
var protocol = thrift.TBinaryProtocol;

var connection = thrift.createConnection("localhost", 42424, {
    transport: transport,
    protocol: protocol
});

var client = thrift.createClient(AccumuloClient, connection);

client.login("root", {'password': "password"});

When I try to log in, I get

org.apache.thrift.protocol.TProtocolException: Expected protocol id ffffff82 but got ffffff80

Can someone help me and give me an idea of ​​what I'm doing wrong here?


UPDATE:

I changed the line protocolFactoryin the proxy.properties file located in Accumulo and restarted the proxy.

protocolFactory=org.apache.thrift.protocol.TBinaryProtocol$Factory

I followed the same steps as above, but added a callback to the call createClient.

var login;
var client = thrift.createClient(AccumuloClient, connection, 
    function(err, success) { login = success });

This fills the input variable. Then I try to use this input variable to perform other functions

client.listTables(login, function(a) { console.log(a) })

leads to

{name: 'TApplicationException', 
 type: 6,
 message: 'Internal error processing listTables'}

Attempt to create a table

client.createTable(login, "testTable", 1, "", function(a) { console.log(a)})

leads to

{name: 'AccumuloSecurityException',
 msg: 'org.apache.accumulo.core.client.AccumuloSecurityException: Error SERIALIZATION_ERROR for user unknown - Unknown security exception'}

See answer below.

+3
source share
2 answers

, - Accumulo. AccumulProxy.js, AccumuloProxy_login_result.prototype.read, this.success = input.readString()

readString() Buffer toString(), utf8. , .

AccumuloProxy_login_result.prototype.read, this.success = input.readBinary(), a Buffer. Buffer Accumulo Exception.

Thrift , -, .

+2

, Accumulo compact, binary. , NodeJS .

, SO. #, , , . , RabbitMQ , . .

0

All Articles