Code Monkey home page Code Monkey logo

ots2's Introduction

ali-sdk

NPM version build status Test coverage Gittip David deps iojs version node version npm download

SDK include all aliyun, taobao, tmall, alibaba open serivces.

Goal of this module

Let global users can all use ali's services more easily.

Support Services

aliyun

name status description version usage origin api
OSS DONE Simple Store like S3 - OSS Usage OSS API
OTS TODO Table Store like HBase - OTS Usage OTS API
OCS ING Cache Service like Memcached - OCS Usage OCS protocol
ECS TODO Elastic Compute like EC2 - ECS Usage -
RDS ING Relational Database like MySQL - RDS Usage -
DRDS TODO Distribute Relational Database - DRDS Usage DRDS API
SLB TODO Server Load Balancer - SLB Usage -
CDN TODO Content Delivery Network v1.6 2014-10-01 CDN Usage CDN API
SLS TODO Simple Log Service - SLS Usage SLS API
MQS TODO Message Queue 2014-07-08 MQS Usage MQS-API
OpenSearch TODO Search Engine - OpenSearch Usage OpenSearch API
MTS TODO Multimedia Transcoding Service v1501 MTS Usage MTS API
ACE TODO Aliyun Cloud Engine - ACE Usage [ACE API]
ESS TODO Elastic Scaling - ESS Usage ESS API
OAS TODO Archive Service - OAS Usage OAS API
KVStore ING Key-Value Store like Redis - KVStore Usage KVStore API
ODPS TODO Data Processing like Hadoop - ODPS Usage ODPS API
ADS TODO Analytic Database, Realtime OLAP - ADS Usage [ADS API]

taobao

TBD

tmall

TBD

alibaba

TBD

License

MIT

ots2's People

Contributors

albin3 avatar awesomejayden avatar jacksontian avatar vangie avatar

Stargazers

 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

ots2's Issues

OTS 2015-12-31 版 API 实现求助。

最近在实现 OTS 2015-12-31 API 版的 ots.js
将支持 PlainBuffer 编码,自增主键。

现在是边看官方文档,边手扒 java sdk 代码实现,发现文档描述和具体实现存在一些出入。
@JacksonTian 朴大大,能否帮忙联系下 ots 的内部人员,想请教些问题和反馈些实现出入。

批量操作删除错误

调用batchWriteRow接口批量删除行,如果 delete_rows 中不指定attribute_columns会产生以下错误:

Cannot convert undefined or null to object
at exports.$ (node_modules/@alicloud/ots2/lib/helper.js:191:21)
at hook (node_modules/@alicloud/ots2/lib/actions.js:329:29)
at Client.exports.batchWriteRow (node_modules/@alicloud/ots2/lib/actions.js:350:5)

delete_rows 中指定attribute_columns则产生以下错误:

.com.aliyun.openservices.ots.protocol.DeleteRowInBatchWriteRowRequest#attribute_columns is not a field: undefined

ots2.proto相关定义:

message DeleteRowInBatchWriteRowRequest {
    required Condition condition = 1;
    repeated Column primary_key = 2;
    // 无attribute_columns字段
}

action.js相关代码:

var hook = function (rows) {
  if (!rows) {
    return;
  }

  for (var i = 0; i < rows.length; i++) {
    var row = rows[i];
    row.primary_key = $(row.primary_key);
    row.attribute_columns = $(row.attribute_columns); // 错误可能和这里有关
  }
};

exports.batchWriteRow = function* (tables) {
  for (var i = 0; i < tables.length; i++) {
    var table = tables[i];
    hook(table.put_rows);
    hook(table.update_rows);
    hook(table.delete_rows); // 错误可能和这里有关
  }

  return yield this.request('BatchWriteRow', {
    tables: tables
  });
};

PutRow 的时候,必须 $(column) 一下吗?

我遇到一个奇怪的情况:

  1. 使用 putRow ,column 参数 传入一个 plain object , putRow 成功
  2. 使用 putRow, column 参数 传入 ots.$(plain object) , putRow 成功

这两次调用在本质上有啥区别吗?是否传入的 column 一定要用 $ 进行转换?

max_versions 不符合预期

table store 的官网控制台可以一次查询多个版本的数据,但是 ots2 客户端的 getRange 和 getRow 方法,设置 max_versions 之后,是返回第 n 个版本的数据,而不是把 n 个版本的数据都返回。
希望提供多个版本数据的方法。

readme

opt里keepAlive改成keepAliveMsecs了? readme 要改了。

ots使用例子在nodejs 4.4.5下跑不通

我想请教下下面的这个例子我使用co来支持yield,但是第一句就永远无法返回,请问我用法有问题么

var P = require("bluebird");
var co=require('co');
var ots = require('ots2');
var mocha = require('mocha');
var coMocha = require('co-mocha');
coMocha(mocha);

var client = ots.createClient({
  accessKeyID: 'xxxx',
  accessKeySecret: 'xxxxxx',
  instance: 'snstable',
  region: '华东1(杭州)',
  keepAliveMsecs: 1000, // default 1000
});

//it('should do something', function * () {

//})


function* workAsync()
{ 
yield client.listTable();
// 创建表
var keys = [{ 'name': 'uid', 'type': 'STRING' }];
var capacityUnit = {read: 1, write: 1};
var response = yield client.createTable('metrics', keys, capacityUnit);
// 更新表
var capacityUnit = {read: 2, write: 1};
var response = yield client.updateTable('metrics', capacityUnit);
// 查看表信息
var response = yield client.describeTable('metrics');
// 删除表
var response = yield client.deleteTable('metrics');
};

co(workAsync());

getRange 里面没有 filter的功能吗

我想要通过where查询条件(非主键的属性列) 查询 ,官网上的GetRange有filter功能,现在ots2没有这个功能吗

Error: .com.aliyun.cloudservice.ots2.GetRangeRequest#filter is not a field: undefined
      at MessagePrototype.set (d:\Node\node_statics\node_modules\protobufjs\dist\ProtoBuf.js:2539:35)
      at MessagePrototype.set (d:\Node\node_statics\node_modules\protobufjs\dist\ProtoBuf.js:2533:38)
      at Message (d:\Node\node_statics\node_modules\protobufjs\dist\ProtoBuf.js:2462:34)
      at Client.request (d:\Node\node_statics\node_modules\ots2\lib\client.js:97:17)
      at Client.request.next (<anonymous>)
      at onFulfilled (d:\Node\node_statics\node_modules\co\index.js:65:19)
      at d:\Node\node_statics\node_modules\co\index.js:54:5
      at co (d:\Node\node_statics\node_modules\co\index.js:50:10)
      at toPromise (d:\Node\node_statics\node_modules\co\index.js:118:63)
      at next (d:\Node\node_statics\node_modules\co\index.js:99:29)

ECONNRESET 错误

调用GetRange接口偶尔(大概几千次出现一次)会抛出以下异常,多台服务器上都出现这种情况。该异常能判断出是哪一方的问题么?

getrange: { 
  Error: socket hang up POST http://*.cn-hangzhou.ots-internal.aliyuncs.com/GetRange failed.
  at createHangUpError (_http_client.js:254:15)
  at Socket.socketOnEnd (_http_client.js:346:23)
  at emitNone (events.js:91:20)
  at Socket.emit (events.js:185:7)
  at endReadableNT (_stream_readable.js:974:12)
  at _combinedTickCallback (internal/process/next_tick.js:74:11)
  at process._tickDomainCallback (internal/process/next_tick.js:122:9) code: 'ECONNRESET' 
}

ots2 Version

1.5.4

Node.js Version

8.4.0

ots2版本如何实现主键列自增

ots2版本如何实现主键列自增
类似java版本
java中的写法是这样的 // 第三列为消息ID,自动自增列,类型为INTEGER,属性为PKO_AUTO_INCREMENT
tableMeta.addPrimaryKeyColumn(new PrimaryKeySchema("message_id", PrimaryKeyType.INTEGER, PrimaryKeyOption.AUTO_INCREMENT));

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.