Giter VIP home page Giter VIP logo

aliyun-tablestore-java-sdk's Issues

How to use this in Android ?

Hi,

I'm working on an Android App which uses Aliyun Tablestore as database.
But problems occured.

When I place implementation ('com.aliyun.openservices:ots-public:2.2.4') in build.gradle, build and debug the App, exception thrown. Below is the stacktrace:

          java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/message/BasicLineFormatter; in class Lorg/apache/http/message/BasicLineFormatter; or its superclasses (declaration of 'org.apache.http.message.BasicLineFormatter' appears in /system/framework/org.apache.http.legacy.boot.jar)
              at org.apache.http.impl.nio.codecs.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)
              at org.apache.http.impl.nio.codecs.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56)
              at org.apache.http.impl.nio.codecs.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46)
              at org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionFactory.<init>(ManagedNHttpClientConnectionFactory.java:75)
              at org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionFactory.<init>(ManagedNHttpClientConnectionFactory.java:83)
              at org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionFactory.<clinit>(ManagedNHttpClientConnectionFactory.java:64)
              at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingNHttpClientConnectionManager.java:522)
              at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.<init>(PoolingNHttpClientConnectionManager.java:161)
              at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.<init>(PoolingNHttpClientConnectionManager.java:145)
              at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.<init>(PoolingNHttpClientConnectionManager.java:117)
              at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.<init>(PoolingNHttpClientConnectionManager.java:111)
              at com.aliyun.openservices.ots.comm.AsyncServiceClient.<init>(AsyncServiceClient.java:44)
              at com.aliyun.openservices.ots.OTSClient.<init>(OTSClient.java:164)
              at com.aliyun.openservices.ots.OTSClient.<init>(OTSClient.java:116)
              at com.aliyun.openservices.ots.OTSClient.<init>(OTSClient.java:56)
              at com.anpeila.dashgomonitorapp.MainActivity.onCreate(MainActivity.java:26)
              at android.app.Activity.performCreate(Activity.java:7081)
              at android.app.Activity.performCreate(Activity.java:7072)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2747)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2872)
              at android.app.ActivityThread.-wrap11(Unknown Source:0)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1601)
              at android.os.Handler.dispatchMessage(Handler.java:106)
              at android.os.Looper.loop(Looper.java:164)
              at android.app.ActivityThread.main(ActivityThread.java:6600)
              at java.lang.reflect.Method.invoke(Native Method)
              at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:518)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:821)

Any help? Thanks!

怎么检查otsclient是否处于shutdown状态

java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED
at org.apache.http.util.Asserts.check(Asserts.java:46)
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90)
at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123)
at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:68)
at com.alicloud.openservices.tablestore.core.http.AsyncServiceClient.asyncSendRequest(AsyncServiceClient.java:150)
at com.alicloud.openservices.tablestore.core.OperationLauncher.asyncInvokePost(OperationLauncher.java:152)
at com.alicloud.openservices.tablestore.core.BatchGetRowLauncher.fire(BatchGetRowLauncher.java:63)
at com.alicloud.openservices.tablestore.InternalClient.batchGetRow(InternalClient.java:586)
at com.alicloud.openservices.tablestore.SyncClient.batchGetRow(SyncClient.java:273)

怎么检查otsclient是否处于shutdown状态???

Table Store 写入迟延

Table Store sdk 有大概两秒钟的写入迟延。写入table后,马上读取,无数据。 请提供方案。

没有结合spring spirngboot用例

  • 没有集合spring 用例
  • 没有结合springboot 用例
  • 每一次创建连接需要时间较长,大约1分钟
  • 长连接好像不能保持

请问如何使用 PrepareCallback ?

目前该接口无任何入参, 而且在 Client 执行大部分操作时都会回调一次.
暂时无法理解这个回调接口的应用场景..

依赖库漏洞

Provides transitive vulnerable dependency maven:com.google.guava:guava:27.0.1-jre CVE-2023-2976 7.1 Files or Directories Accessible to External Parties vulnerability with High severity found CVE-2020-8908 3.3 Incorrect Permission Assignment for Critical Resource vulnerability with Low severity found Results powered by Checkmarx(c)

Provides transitive vulnerable dependency maven:com.google.protobuf:protobuf-java:2.4.1 CVE-2022-3509 7.5 Uncontrolled Resource Consumption vulnerability with High severity found CVE-2021-22569 5.5 Incorrect Behavior Order vulnerability with Medium severity found CVE-2022-3510 7.5 Uncontrolled Resource Consumption vulnerability with High severity found CVE-2022-3171 7.5 Uncontrolled Resource Consumption vulnerability with High severity found CVE-2015-5237 8.8 Out-of-bounds Write vulnerability with High severity found Results powered by Checkmarx(c)

TimestreamMetaIterator分页会取出所有数据

参考该地址实现:https://help.aliyun.com/document_detail/114347.html?spm=a2c4g.11186623.6.615.17132345T3bKeQ

TimestreamMetaIterator iter1 = db.metaTable()
                .filter(filter)
                .identifierOnly()       // 只返回identifer
                .fetchAll();
        System.out.print(iterator.getTotalCount());   //获取命中的时间线条数
        while (iter1.hasNext()) {
            System.out.print(iterator.next().toString());
        }
    public boolean hasNext() {
        if (isBufferHasData()) {
            return true;
        }
        byte[] token = response.getNextToken();

        while (token != null) {
            request.getSearchQuery().setToken(response.getNextToken());
            request.getSearchQuery().setOffset(0);
            fetchData(request);
            if (isBufferHasData()) {
                return true;
            }
            token = response.getNextToken();
        }
        return false;
    }

上述实现会取出所有数据,是否需要把isBufferHasData提出公共方法出来。目前实现分页,不能用这个方法,只能自己写实现

GetRange方法不能正确的完成功能

OTSMultiDataSample.java中演示了getRange方法的调用,demo程序中,插入了GID=1, UID范围1-5的5条数据。

getRange设定了GID范围从1-4,但是返回的结果是所有1-5的条目,这里demo是有些问题的,返回1-5是正常的。

但是我把查询程序改成GID范围INF_MIN-INF_MAX,UID范围设置成1-4时仍然返回所有结果,这里是不是存在一些bug?

BatchGetRowResponse中RowResult isSuccess==true,但Row为null

现象

使用BatchGetRow功能查询批量数据,查询一条不存在的数据,BatchGetRowResponse正常返回,取RowResult值的时候发现:isSuccess为true,但Row为null。

期望

public class BatchGetRowResponse extends Response implements Jsonizable {
    /**
     * BatchGetRow批量操作中单行查询的结果。
     * 若isSucceed为true,则代表该行查询操作成功,可以通过getRow获取单行查询的结果。
     * 若isSucceed为false,则代表该行查询操作失败,可以通过getError获取失败的错误信息。
     */
    public static class RowResult {}
}

代码

  private <T> void getBatchRow(Class<T> clazz, String table, List<PrimaryKey> pks) throws Exception {
    //读取一行数据,设置数据表名称。
    MultiRowQueryCriteria criteria = new MultiRowQueryCriteria(table);
    //设置读取最新版本。
    criteria.setMaxVersions(1);
    // 添加主键
    for(PrimaryKey pk : pks){
      criteria.addRow(pk);
    }
    // 执行查询
    BatchGetRowRequest request = new BatchGetRowRequest();
    request.addMultiRowQueryCriteria(criteria);
    BatchGetRowResponse response = client.batchGetRow(request);
    List<RowResult> rowRsts = response.getBatchGetRowResult(table);
    if (rowRsts.isEmpty()) {
      return Collections.emptyList();
    }

    for(RowResult rowRst : rowRsts){
      if(!rowRst.isSucceed()){
        continue;
      }
      Row row = rowRst.getRow();
      if(row.isEmpty()){
        continue;
      }
      System.out.println(row);
    }
  }

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.