Skip to content

Commit d1ab79c

Browse files
committed
update version to 5.17.7
1 parent c6212eb commit d1ab79c

File tree

86 files changed

+20602
-583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+20602
-583
lines changed

.gitignore

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
*.class
2-
3-
# Mobile Tools for Java (J2ME)
4-
.mtj.tmp/
5-
6-
# Package Files #
7-
*.jar
8-
*.war
9-
*.ear
10-
*.iml
1+
/bin/
2+
.classpath
3+
.project
4+
.settings
5+
out/
6+
src/test/resources/test_conf.json
7+
*.ipr
8+
*.iws
9+
src/test/resources/local_conf.properties
1110
.idea
11+
src/test/java/examples/logs
1212
target
13-
out
14-
logs
15-
setting.xml
16-
17-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
18-
hs_err_pid*
13+
logs/
14+
src/test/resources/conf.properties
15+
*.iml
16+
.DS_Store
17+
/protoc

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
- 阿里云表格存储是阿里云自主研发的NoSQL数据存储服务,提供海量结构化数据的存储和实时访问。
1010

1111
## 版本
12-
- 当前版本:5.17.6
12+
- 当前版本:5.17.7
1313

1414
## 运行环境
1515
- JDK 6及其以上
1616

1717
## 安装
1818
#### Maven方式
19-
下载[最新版JAR包](https://search.maven.org/remotecontent?filepath=com/aliyun/openservices/tablestore/5.17.6/tablestore-5.17.6.jar)或者通过Maven:
19+
下载[最新版JAR包](https://search.maven.org/remotecontent?filepath=com/aliyun/openservices/tablestore/5.17.7/tablestore-5.17.7.jar)或者通过Maven:
2020
```xml
2121
<dependency>
2222
<groupId>com.aliyun.openservices</groupId>
2323
<artifactId>tablestore</artifactId>
24-
<version>5.17.6</version>
24+
<version>5.17.7</version>
2525
</dependency>
2626
```
2727

tablestore/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.aliyun.openservices</groupId>
55
<artifactId>tablestore</artifactId>
6-
<version>5.17.6</version>
6+
<version>5.17.7</version>
77
<packaging>jar</packaging>
88
<name>AliCloud TableStore SDK for Java</name>
99
<parent>

tablestore/src/main/java/com/alicloud/openservices/tablestore/DefaultTableStoreTimeseriesWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @description: A time-series table writer implemented based on {@link AsyncTimeseriesClient}
3232
*/
3333
public class DefaultTableStoreTimeseriesWriter implements TableStoreTimeseriesWriter {
34-
private Logger logger = LoggerFactory.getLogger(DefaultTableStoreTimeseriesWriter.class);
34+
private static Logger logger = LoggerFactory.getLogger(DefaultTableStoreTimeseriesWriter.class);
3535
private static final int SCHEDULED_CORE_POOL_SIZE = 2;
3636
private TimeseriesWriterHandleStatistics timeseriesWriterHandleStatistics;
3737
private final AsyncTimeseriesClientInterface ots;

tablestore/src/main/java/com/alicloud/openservices/tablestore/DefaultTableStoreWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import java.util.concurrent.atomic.AtomicLong;
2424

2525
public class DefaultTableStoreWriter implements TableStoreWriter {
26-
private Logger logger = LoggerFactory.getLogger(TableStoreWriter.class);
26+
private static Logger logger = LoggerFactory.getLogger(TableStoreWriter.class);
2727

2828
private static final int SCHEDULED_CORE_POOL_SIZE = 2;
2929

tablestore/src/main/java/com/alicloud/openservices/tablestore/InternalClient.java

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,112 @@ public Future<UpdateTableResponse> updateTable(UpdateTableRequest request,
345345
return f;
346346
}
347347

348+
public Future<CreateGlobalTableResponse> createGlobalTable(CreateGlobalTableRequest request,
349+
TableStoreCallback<CreateGlobalTableRequest, CreateGlobalTableResponse> callback) {
350+
Preconditions.checkNotNull(request);
351+
352+
TraceLogger tracer = getTraceLogger();
353+
RetryStrategy retry = this.retryStrategy.clone();
354+
CreateGlobalTableLauncher launcher = launcherFactory.createGlobalTable(tracer, retry, request);
355+
356+
AsyncCompletion<CreateGlobalTableRequest, CreateGlobalTableResponse> completion = new AsyncCompletion<>(launcher, request, tracer,
357+
callbackExecutor, retry, retryExecutor);
358+
CallbackImpledFuture<CreateGlobalTableRequest, CreateGlobalTableResponse> f = new CallbackImpledFuture<>();
359+
completion.watchBy(f);
360+
if (callback != null) {
361+
// user callback must be triggered after completion of the return
362+
// future.
363+
f.watchBy(callback);
364+
}
365+
launcher.fire(request, completion);
366+
return f;
367+
}
368+
369+
public Future<BindGlobalTableResponse> bindGlobalTable(BindGlobalTableRequest request,
370+
TableStoreCallback<BindGlobalTableRequest, BindGlobalTableResponse> callback) {
371+
Preconditions.checkNotNull(request);
372+
373+
TraceLogger tracer = getTraceLogger();
374+
RetryStrategy retry = this.retryStrategy.clone();
375+
BindGlobalTableLauncher launcher = launcherFactory.bindGlobalTable(tracer, retry, request);
376+
377+
AsyncCompletion<BindGlobalTableRequest, BindGlobalTableResponse> completion = new AsyncCompletion<>(launcher, request, tracer,
378+
callbackExecutor, retry, retryExecutor);
379+
CallbackImpledFuture<BindGlobalTableRequest, BindGlobalTableResponse> f = new CallbackImpledFuture<>();
380+
completion.watchBy(f);
381+
if (callback != null) {
382+
// user callback must be triggered after completion of the return
383+
// future.
384+
f.watchBy(callback);
385+
}
386+
launcher.fire(request, completion);
387+
return f;
388+
}
389+
390+
public Future<UnbindGlobalTableResponse> unbindGlobalTable(UnbindGlobalTableRequest request,
391+
TableStoreCallback<UnbindGlobalTableRequest, UnbindGlobalTableResponse> callback) {
392+
Preconditions.checkNotNull(request);
393+
394+
TraceLogger tracer = getTraceLogger();
395+
RetryStrategy retry = this.retryStrategy.clone();
396+
UnbindGlobalTableLauncher launcher = launcherFactory.unbindGlobalTable(tracer, retry, request);
397+
398+
AsyncCompletion<UnbindGlobalTableRequest, UnbindGlobalTableResponse> completion = new AsyncCompletion<>(launcher, request, tracer,
399+
callbackExecutor, retry, retryExecutor);
400+
CallbackImpledFuture<UnbindGlobalTableRequest, UnbindGlobalTableResponse> f = new CallbackImpledFuture<>();
401+
completion.watchBy(f);
402+
if (callback != null) {
403+
// user callback must be triggered after completion of the return
404+
// future.
405+
f.watchBy(callback);
406+
}
407+
launcher.fire(request, completion);
408+
return f;
409+
}
410+
411+
public Future<DescribeGlobalTableResponse> describeGlobalTable(DescribeGlobalTableRequest request,
412+
TableStoreCallback<DescribeGlobalTableRequest, DescribeGlobalTableResponse> callback) {
413+
Preconditions.checkNotNull(request);
414+
415+
TraceLogger tracer = getTraceLogger();
416+
RetryStrategy retry = this.retryStrategy.clone();
417+
DescribeGlobalTableLauncher launcher = launcherFactory.describeGlobalTable(tracer, retry, request);
418+
419+
AsyncCompletion<DescribeGlobalTableRequest, DescribeGlobalTableResponse> completion = new AsyncCompletion<>(launcher, request, tracer,
420+
callbackExecutor, retry, retryExecutor);
421+
CallbackImpledFuture<DescribeGlobalTableRequest, DescribeGlobalTableResponse> f = new CallbackImpledFuture<>();
422+
completion.watchBy(f);
423+
if (callback != null) {
424+
// user callback must be triggered after completion of the return
425+
// future.
426+
f.watchBy(callback);
427+
}
428+
launcher.fire(request, completion);
429+
return f;
430+
}
431+
432+
public Future<UpdateGlobalTableResponse> updateGlobalTable(UpdateGlobalTableRequest request,
433+
TableStoreCallback<UpdateGlobalTableRequest, UpdateGlobalTableResponse> callback) {
434+
Preconditions.checkNotNull(request);
435+
436+
TraceLogger tracer = getTraceLogger();
437+
RetryStrategy retry = this.retryStrategy.clone();
438+
UpdateGlobalTableLauncher launcher = launcherFactory.updateGlobalTable(tracer, retry, request);
439+
440+
AsyncCompletion<UpdateGlobalTableRequest, UpdateGlobalTableResponse> completion = new AsyncCompletion<>(launcher, request, tracer,
441+
callbackExecutor, retry, retryExecutor);
442+
CallbackImpledFuture<UpdateGlobalTableRequest, UpdateGlobalTableResponse> f = new CallbackImpledFuture<>();
443+
completion.watchBy(f);
444+
if (callback != null) {
445+
// user callback must be triggered after completion of the return
446+
// future.
447+
f.watchBy(callback);
448+
}
449+
launcher.fire(request, completion);
450+
return f;
451+
}
452+
453+
348454
public Future<CreateIndexResponse> createIndex(CreateIndexRequest request,
349455
TableStoreCallback<CreateIndexRequest, CreateIndexResponse> callback) {
350456
Preconditions.checkNotNull(request);

tablestore/src/main/java/com/alicloud/openservices/tablestore/SyncClient.java

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,56 @@ public UpdateTableResponse updateTable(UpdateTableRequest request)
188188
return waitForFuture(res);
189189
}
190190

191+
@Override
192+
public CreateGlobalTableResponse createGlobalTable(CreateGlobalTableRequest createGlobalTableRequest) throws TableStoreException, ClientException {
193+
Preconditions.checkNotNull(createGlobalTableRequest);
194+
Preconditions.checkNotNull(prepareCallback);
195+
196+
prepareCallback.onPrepare();
197+
Future<CreateGlobalTableResponse> res = this.internalClient.createGlobalTable(createGlobalTableRequest, null);
198+
return waitForFuture(res);
199+
}
200+
201+
@Override
202+
public BindGlobalTableResponse bindGlobalTable(BindGlobalTableRequest request) throws TableStoreException, ClientException {
203+
Preconditions.checkNotNull(request);
204+
Preconditions.checkNotNull(prepareCallback);
205+
206+
prepareCallback.onPrepare();
207+
Future<BindGlobalTableResponse> res = this.internalClient.bindGlobalTable(request, null);
208+
return waitForFuture(res);
209+
}
210+
211+
@Override
212+
public UnbindGlobalTableResponse unbindGlobalTable(UnbindGlobalTableRequest request) throws TableStoreException, ClientException {
213+
Preconditions.checkNotNull(request);
214+
Preconditions.checkNotNull(prepareCallback);
215+
216+
prepareCallback.onPrepare();
217+
Future<UnbindGlobalTableResponse> res = this.internalClient.unbindGlobalTable(request, null);
218+
return waitForFuture(res);
219+
}
220+
221+
@Override
222+
public DescribeGlobalTableResponse describeGlobalTable(DescribeGlobalTableRequest request) throws TableStoreException, ClientException {
223+
Preconditions.checkNotNull(request);
224+
Preconditions.checkNotNull(prepareCallback);
225+
226+
prepareCallback.onPrepare();
227+
Future<DescribeGlobalTableResponse> res = this.internalClient.describeGlobalTable(request, null);
228+
return waitForFuture(res);
229+
}
230+
231+
@Override
232+
public UpdateGlobalTableResponse updateGlobalTable(UpdateGlobalTableRequest updateGlobalTableRequest) throws TableStoreException, ClientException {
233+
Preconditions.checkNotNull(updateGlobalTableRequest);
234+
Preconditions.checkNotNull(prepareCallback);
235+
236+
prepareCallback.onPrepare();
237+
Future<UpdateGlobalTableResponse> res = this.internalClient.updateGlobalTable(updateGlobalTableRequest, null);
238+
return waitForFuture(res);
239+
}
240+
191241
@Override
192242
public CreateIndexResponse createIndex(CreateIndexRequest createIndexRequest)
193243
throws TableStoreException, ClientException

tablestore/src/main/java/com/alicloud/openservices/tablestore/SyncClientInterface.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,50 @@ public DescribeTableResponse describeTable(DescribeTableRequest describeTableReq
9494
public DeleteTableResponse deleteTable(DeleteTableRequest deleteTableRequest)
9595
throws TableStoreException, ClientException;
9696

97+
/**
98+
* Create a global table using an existing table as the base table.
99+
* @param createGlobalTableRequest Parameters required to execute CreateGlobalTable
100+
* @return Results returned by the Table Store service
101+
* @throws TableStoreException Exceptions returned by the Table Store service
102+
* @throws ClientException The requested result is invalid, or a network exception occurs.
103+
*/
104+
public CreateGlobalTableResponse createGlobalTable(CreateGlobalTableRequest createGlobalTableRequest) throws TableStoreException, ClientException;
105+
/**
106+
* Adds a new physical table copy to the global table at the specified location.
107+
* @param bindGlobalTableRequest Parameters required to execute BindGlobalTable
108+
* @return Results returned by the Table Store service
109+
* @throws TableStoreException Exceptions returned by the Table Store service
110+
* @throws ClientException The requested result is invalid, or a network exception occurs.
111+
*/
112+
public BindGlobalTableResponse bindGlobalTable(BindGlobalTableRequest bindGlobalTableRequest) throws TableStoreException, ClientException;
113+
/**
114+
* Unbind the specified physical table from the global table. The unbinding operation will not delete the physical table.
115+
* <p>Note: After the table is successfully unbound, it will no longer synchronize data with the global table, nor can it be bound to the global table again. Please operate with caution!</p>
116+
* @param unbindGlobalTableRequest Parameters required to execute UnbindGlobalTable
117+
* @return Results returned by the Table Store service
118+
* @throws TableStoreException Exceptions returned by the Table Store service
119+
* @throws ClientException The requested result is invalid, or a network exception occurs.
120+
*/
121+
public UnbindGlobalTableResponse unbindGlobalTable(UnbindGlobalTableRequest unbindGlobalTableRequest) throws TableStoreException, ClientException;
122+
/**
123+
* Get the physical table information and status of the global table.
124+
* @param descGlobalTableRequest Parameters required to execute DescribeGlobalTable
125+
* @return Results returned by the Table Store service
126+
* @throws TableStoreException Exceptions returned by the Table Store service
127+
* @throws ClientException The requested result is invalid, or a network exception occurs.
128+
*/
129+
public DescribeGlobalTableResponse describeGlobalTable(DescribeGlobalTableRequest descGlobalTableRequest) throws TableStoreException, ClientException;
130+
/**
131+
* Modify the read and write permissions of the physical table in the global table.
132+
* <p>Note: This will cause write operations on disabled physical tables to fail!</p>
133+
*
134+
* @param updateGlobalTableRequest Parameters required to execute UpdateGlobalTable
135+
* @return Results returned by the Table Store service
136+
* @throws TableStoreException Exceptions returned by the Table Store service
137+
* @throws ClientException The requested result is invalid, or a network exception occurs.
138+
*/
139+
public UpdateGlobalTableResponse updateGlobalTable(UpdateGlobalTableRequest updateGlobalTableRequest) throws TableStoreException, ClientException;
140+
97141
/**
98142
* Create an index table under a specified table as indicated by the user.
99143
*
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package com.alicloud.openservices.tablestore.core;
2+
3+
import com.alicloud.openservices.tablestore.ClientConfiguration;
4+
import com.alicloud.openservices.tablestore.core.auth.CredentialsProvider;
5+
import com.alicloud.openservices.tablestore.core.http.AsyncServiceClient;
6+
import com.alicloud.openservices.tablestore.core.http.BindGlobalTableResponseConsumer;
7+
import com.alicloud.openservices.tablestore.core.http.OTSUri;
8+
import com.alicloud.openservices.tablestore.core.protocol.ResultParserFactory;
9+
import com.alicloud.openservices.tablestore.core.protocol.globaltable.GlobalTable;
10+
import com.alicloud.openservices.tablestore.core.protocol.globaltable.GlobalTableProtocolBuilder;
11+
import com.alicloud.openservices.tablestore.core.utils.LogUtil;
12+
import com.alicloud.openservices.tablestore.core.utils.Preconditions;
13+
import com.alicloud.openservices.tablestore.model.BindGlobalTableRequest;
14+
import com.alicloud.openservices.tablestore.model.BindGlobalTableResponse;
15+
import com.alicloud.openservices.tablestore.model.RetryStrategy;
16+
import com.aliyun.ots.thirdparty.org.apache.http.concurrent.FutureCallback;
17+
18+
public class BindGlobalTableLauncher extends OperationLauncher<BindGlobalTableRequest, BindGlobalTableResponse> {
19+
20+
private OTSUri uri;
21+
private TraceLogger tracer;
22+
private RetryStrategy retry;
23+
24+
public BindGlobalTableLauncher(
25+
OTSUri uri,
26+
TraceLogger tracer,
27+
RetryStrategy retry,
28+
String instanceName,
29+
AsyncServiceClient client,
30+
CredentialsProvider crdsProvider,
31+
ClientConfiguration config,
32+
BindGlobalTableRequest originRequest) {
33+
super(instanceName, client, crdsProvider, config, originRequest);
34+
Preconditions.checkNotNull(uri);
35+
Preconditions.checkNotNull(tracer);
36+
Preconditions.checkNotNull(retry);
37+
38+
this.uri = uri;
39+
this.tracer = tracer;
40+
this.retry = retry;
41+
}
42+
43+
@Override
44+
public void fire(BindGlobalTableRequest request, FutureCallback<BindGlobalTableResponse> cb) {
45+
LogUtil.logBeforeExecution(tracer, retry);
46+
47+
GlobalTable.BindGlobalTableResponse defaultResponse =
48+
GlobalTable.BindGlobalTableResponse.getDefaultInstance();
49+
asyncInvokePost(
50+
uri,
51+
null,
52+
GlobalTableProtocolBuilder.buildBindGlobalTableRequest(request),
53+
tracer,
54+
new BindGlobalTableResponseConsumer(
55+
ResultParserFactory.createFactory().createProtocolBufferResultParser(
56+
defaultResponse, tracer.getTraceId()),
57+
tracer, retry, lastResult),
58+
cb);
59+
}
60+
}

tablestore/src/main/java/com/alicloud/openservices/tablestore/core/Constants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
public class Constants {
66
// ALL HTTP HEADERS SHOULD BE DEFINED IN LOWERCASE
77
// request headers
8-
public static final String USER_AGENT = "ots-java-sdk 5.17.6";
8+
public static final String USER_AGENT = "ots-java-sdk 5.17.7";
99
public static final String OTS_HEADER_API_VERSION = "x-ots-apiversion";
1010
public static final String OTS_HEADER_ACCESS_KEY_ID = "x-ots-accesskeyid";
1111
public static final String OTS_HEADER_OTS_CONTENT_MD5 = "x-ots-contentmd5";
@@ -20,6 +20,7 @@ public class Constants {
2020
public static final String OTS_HEADER_STS_TOKEN = "x-ots-ststoken";
2121
public static final String OTS_HEADER_REQUEST_PRIORITY = "x-ots-request-priority";
2222
public static final String OTS_HEADER_REQUEST_TAG = "x-ots-request-tag";
23+
public static final String OTS_HEADER_REQUEST_SEARCH_TAG = "x-ots-request-search-tag";
2324

2425
// response headers
2526
public static final String OTS_HEADER_PREFIX = "x-ots-";

0 commit comments

Comments
 (0)