Skip to content

Commit 370be7a

Browse files
committed
fix:pom gpg
1 parent fe2123f commit 370be7a

File tree

6 files changed

+75
-52
lines changed

6 files changed

+75
-52
lines changed

pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,20 @@
251251
</archive>
252252
</configuration>
253253
</plugin>
254+
<plugin>
255+
<groupId>org.apache.maven.plugins</groupId>
256+
<artifactId>maven-gpg-plugin</artifactId>
257+
<version>3.0.1</version>
258+
<executions>
259+
<execution>
260+
<id>sign-artifacts</id>
261+
<phase>verify</phase>
262+
<goals>
263+
<goal>sign</goal>
264+
</goals>
265+
</execution>
266+
</executions>
267+
</plugin>
254268
<plugin>
255269
<groupId>com.googlecode.maven-java-formatter-plugin</groupId>
256270
<artifactId>maven-java-formatter-plugin</artifactId>

src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,12 @@ void checkObTableOperationResult(String ip, int port, ObPayload request, ObPaylo
448448
ObTableOperationRequest obTableOperationRequest = (ObTableOperationRequest) request;
449449
obTableOperationResult.setExecuteHost(ip);
450450
obTableOperationResult.setExecutePort(port);
451-
long sequence = obTableOperationResult.getSequence() == 0 ? obTableOperationRequest.getSequence() : obTableOperationResult.getSequence();
452-
long uniqueId = obTableOperationResult.getUniqueId() == 0 ? obTableOperationRequest.getUniqueId() : obTableOperationResult.getUniqueId();
453-
ExceptionUtil.throwObTableException(ip, port, sequence, uniqueId, obTableOperationResult.getHeader().getErrno());
451+
long sequence = obTableOperationResult.getSequence() == 0 ? obTableOperationRequest
452+
.getSequence() : obTableOperationResult.getSequence();
453+
long uniqueId = obTableOperationResult.getUniqueId() == 0 ? obTableOperationRequest
454+
.getUniqueId() : obTableOperationResult.getUniqueId();
455+
ExceptionUtil.throwObTableException(ip, port, sequence, uniqueId,
456+
obTableOperationResult.getHeader().getErrno());
454457
}
455458

456459
void checkObTableQueryAndMutateResult(String ip, int port, ObPayload result) {
@@ -586,9 +589,12 @@ void checkResult(String ip, int port, ObPayload request, ObPayload result) {
586589
ObTableOperationRequest obTableOperationRequest = (ObTableOperationRequest) request;
587590
obTableOperationResult.setExecuteHost(ip);
588591
obTableOperationResult.setExecutePort(port);
589-
long sequence = obTableOperationResult.getSequence() == 0 ? obTableOperationRequest.getSequence() : obTableOperationResult.getSequence();
590-
long uniqueId = obTableOperationResult.getUniqueId() == 0 ? obTableOperationRequest.getUniqueId() : obTableOperationResult.getUniqueId();
591-
ExceptionUtil.throwObTableException(ip, port, sequence, uniqueId, obTableOperationResult.getHeader().getErrno());
592+
long sequence = obTableOperationResult.getSequence() == 0 ? obTableOperationRequest
593+
.getSequence() : obTableOperationResult.getSequence();
594+
long uniqueId = obTableOperationResult.getUniqueId() == 0 ? obTableOperationRequest
595+
.getUniqueId() : obTableOperationResult.getUniqueId();
596+
ExceptionUtil.throwObTableException(ip, port, sequence, uniqueId,
597+
obTableOperationResult.getHeader().getErrno());
592598
} else if (result instanceof ObTableQueryAndMutateResult) {
593599
// TODO: Add func like throwObTableException()
594600
// which will output the ip / port / error information

src/main/java/com/alipay/oceanbase/rpc/mutation/BatchOperation.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ public BatchOperationResult execute() throws Exception {
104104
if (operation instanceof Mutation) {
105105
Mutation mutation = (Mutation) operation;
106106
if (!hasSetRowkeyElement && mutation.getRowKeyNames() != null) {
107-
((ObTableClient) client).addRowKeyElement(tableName, (String[]) mutation.getRowKeyNames().toArray(new String[0]));
107+
((ObTableClient) client).addRowKeyElement(tableName, (String[]) mutation
108+
.getRowKeyNames().toArray(new String[0]));
108109
hasSetRowkeyElement = true;
109110
}
110111
ObTableOperationType type = mutation.getOperationType();

src/test/java/com/alipay/oceanbase/rpc/ObTableClientPartitionKeyTest.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
public class ObTableClientPartitionKeyTest {
3939

4040
private ObTableClient obTableClient;
41-
private String TEST_TABLE = null;
41+
private String TEST_TABLE = null;
4242

4343
@Before
4444
public void setUp() throws Exception {
@@ -93,9 +93,9 @@ public void testInsert() throws Exception {
9393
new String[] { "V" }, new Object[] { "bb".getBytes() });
9494
Assert.assertEquals(1, affectRow);
9595

96-
Map<String, Object> result = obTableClient.get(TEST_TABLE, new Object[] {
97-
"partitionKey".getBytes(), "partition".getBytes(), timestamp }, new String[] { "K",
98-
"Q", "T", "V" });
96+
Map<String, Object> result = obTableClient.get(TEST_TABLE,
97+
new Object[] { "partitionKey".getBytes(), "partition".getBytes(), timestamp },
98+
new String[] { "K", "Q", "T", "V" });
9999
Assert.assertEquals("partitionKey", new String((byte[]) result.get("K"), "UTF-8"));
100100
Assert.assertEquals("partition", new String((byte[]) result.get("Q"), "UTF-8"));
101101
Assert.assertEquals(timestamp, result.get("T"));
@@ -109,9 +109,9 @@ public void testGet() throws Exception {
109109
obTableClient.insert(TEST_TABLE,
110110
new Object[] { "partitionKey".getBytes(), "partition".getBytes(), timeStamp },
111111
new String[] { "V" }, new Object[] { "value".getBytes() });
112-
Map<String, Object> result = obTableClient.get(TEST_TABLE, new Object[] {
113-
"partitionKey".getBytes(), "partition".getBytes(), timeStamp }, new String[] { "K",
114-
"Q", "T", "V" });
112+
Map<String, Object> result = obTableClient.get(TEST_TABLE,
113+
new Object[] { "partitionKey".getBytes(), "partition".getBytes(), timeStamp },
114+
new String[] { "K", "Q", "T", "V" });
115115
Assert.assertEquals("partitionKey", new String((byte[]) result.get("K"), "UTF-8"));
116116
Assert.assertEquals("partition", new String((byte[]) result.get("Q"), "UTF-8"));
117117
Assert.assertEquals(timeStamp, result.get("T"));
@@ -128,9 +128,9 @@ public void testUpdate() throws Exception {
128128
new Object[] { "partitionKey".getBytes(), "partition".getBytes(), timeStamp },
129129
new String[] { "V" }, new Object[] { "value1".getBytes() });
130130
Assert.assertEquals(1, affectedRow);
131-
Map<String, Object> result = obTableClient.get(TEST_TABLE, new Object[] {
132-
"partitionKey".getBytes(), "partition".getBytes(), timeStamp }, new String[] { "K",
133-
"Q", "T", "V" });
131+
Map<String, Object> result = obTableClient.get(TEST_TABLE,
132+
new Object[] { "partitionKey".getBytes(), "partition".getBytes(), timeStamp },
133+
new String[] { "K", "Q", "T", "V" });
134134
Assert.assertEquals(timeStamp, result.get("T"));
135135
Assert.assertEquals("value1", new String((byte[]) result.get("V"), "UTF-8"));
136136
}
@@ -145,9 +145,9 @@ public void testReplace() throws Exception {
145145
new Object[] { "partitionKey".getBytes(), "partition".getBytes(), timeStamp },
146146
new String[] { "V" }, new Object[] { "value1".getBytes() });
147147
Assert.assertEquals(2, affectedRow);
148-
Map<String, Object> result = obTableClient.get(TEST_TABLE, new Object[] {
149-
"partitionKey".getBytes(), "partition".getBytes(), timeStamp }, new String[] { "K",
150-
"Q", "T", "V" });
148+
Map<String, Object> result = obTableClient.get(TEST_TABLE,
149+
new Object[] { "partitionKey".getBytes(), "partition".getBytes(), timeStamp },
150+
new String[] { "K", "Q", "T", "V" });
151151
Assert.assertEquals(timeStamp, result.get("T"));
152152
Assert.assertEquals("value1", new String((byte[]) result.get("V"), "UTF-8"));
153153
}
@@ -161,9 +161,9 @@ public void testDelete() throws Exception {
161161
long affectedRow = obTableClient.delete(TEST_TABLE,
162162
new Object[] { "partitionKey".getBytes(), "partition".getBytes(), timeStamp });
163163
Assert.assertEquals(1, affectedRow);
164-
Map<String, Object> result = obTableClient.get(TEST_TABLE, new Object[] {
165-
"partitionKey".getBytes(), "partition".getBytes(), timeStamp }, new String[] { "K",
166-
"Q", "T", "V" });
164+
Map<String, Object> result = obTableClient.get(TEST_TABLE,
165+
new Object[] { "partitionKey".getBytes(), "partition".getBytes(), timeStamp },
166+
new String[] { "K", "Q", "T", "V" });
167167
Assert.assertEquals(0, result.size());
168168
}
169169

@@ -426,8 +426,8 @@ public void testLargeQuery() throws Exception {
426426
String value = "V";
427427
try {
428428
for (long i = 0; i < batchSize; i++) {
429-
obTableClient.insert(TEST_TABLE, new Object[] { key.getBytes(),
430-
qualifier.getBytes(), i }, new String[] { "V" },
429+
obTableClient.insert(TEST_TABLE,
430+
new Object[] { key.getBytes(), qualifier.getBytes(), i }, new String[] { "V" },
431431
new Object[] { value.getBytes() });
432432
}
433433
TableQuery tableQuery = obTableClient.query(TEST_TABLE);
@@ -452,8 +452,8 @@ public void testLargeQuery() throws Exception {
452452
Assert.assertTrue(false);
453453
} finally {
454454
for (long i = 0; i < batchSize; i++) {
455-
obTableClient.delete(TEST_TABLE, new Object[] { key.getBytes(),
456-
qualifier.getBytes(), i });
455+
obTableClient.delete(TEST_TABLE,
456+
new Object[] { key.getBytes(), qualifier.getBytes(), i });
457457
}
458458
}
459459
}

src/test/java/com/alipay/oceanbase/rpc/ObTableHotkeyThrottleTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
import static com.alipay.oceanbase.rpc.mutation.MutationFactory.colVal;
2727

2828
public class ObTableHotkeyThrottleTest {
29-
public int threadNum = 32;
30-
public int repeatKeyNum = 4;
29+
public int threadNum = 32;
30+
public int repeatKeyNum = 4;
3131
public long startTime;
3232

3333
@Test

src/test/java/com/alipay/oceanbase/rpc/util/ObTableHotkeyThrottleUtil.java

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,16 @@
3434
import static com.alipay.oceanbase.rpc.mutation.MutationFactory.*;
3535

3636
public class ObTableHotkeyThrottleUtil extends Thread {
37-
int threadIdx;
38-
int testNum;
39-
String tableName = null;
40-
String[] rowKeyColumnName = null;
37+
int threadIdx;
38+
int testNum;
39+
String tableName = null;
40+
String[] rowKeyColumnName = null;
4141

42-
public int threadNum;
43-
public static List<Integer> unitOperationTimes = null;
44-
public static List<Integer> unitBlockTimes = null;
42+
public int threadNum;
43+
public static List<Integer> unitOperationTimes = null;
44+
public static List<Integer> unitBlockTimes = null;
4545
public static List<Integer> totalOperationTimes = null;
46-
public static List<Integer> totalBlockTimes = null;
47-
46+
public static List<Integer> totalBlockTimes = null;
4847

4948
public enum TestType {
5049
random, specifiedKey
@@ -56,18 +55,19 @@ public enum OperationType {
5655

5756
TestType testType;
5857
OperationType operationType;
59-
public Table client = null;
58+
public Table client = null;
6059
Row rowKey;
61-
int throttleNum = 0;
62-
int passNum = 0;
63-
int batchSize = 64;
64-
long startTime = 0;
65-
int unitBlockTime = 0;
60+
int throttleNum = 0;
61+
int passNum = 0;
62+
int batchSize = 64;
63+
long startTime = 0;
64+
int unitBlockTime = 0;
6665
int unitOperationTime = 0;
6766

68-
public void init(int threadNum,int threadIdx, long startTime, String tableName, String[] rowKeyColumnName,
69-
TestType testType, OperationType operationType, int testNum,
70-
Table client, int batchSize, ColumnValue... rowKeyColumnValues) throws Exception {
67+
public void init(int threadNum, int threadIdx, long startTime, String tableName,
68+
String[] rowKeyColumnName, TestType testType, OperationType operationType,
69+
int testNum, Table client, int batchSize, ColumnValue... rowKeyColumnValues)
70+
throws Exception {
7171
System.setProperty("ob_table_min_rslist_refresh_interval_millis", "1");
7272
this.threadNum = threadNum;
7373
this.threadIdx = threadIdx;
@@ -120,19 +120,19 @@ public void init(int threadNum,int threadIdx, long startTime, String tableName,
120120
}
121121
if (null == unitBlockTimes || threadIdx == 0) {
122122
unitBlockTimes = new ArrayList<Integer>(threadNum);
123-
for(int i = 0; i < threadNum; ++i) {
123+
for (int i = 0; i < threadNum; ++i) {
124124
unitBlockTimes.add(0);
125125
}
126126
}
127127
if (null == totalOperationTimes || threadIdx == 0) {
128128
totalOperationTimes = new ArrayList<Integer>(threadNum);
129-
for(int i = 0; i < threadNum; ++i) {
129+
for (int i = 0; i < threadNum; ++i) {
130130
totalOperationTimes.add(0);
131131
}
132132
}
133133
if (null == totalBlockTimes || threadIdx == 0) {
134134
totalBlockTimes = new ArrayList<Integer>(threadNum);
135-
for(int i = 0; i < threadNum; ++i) {
135+
for (int i = 0; i < threadNum; ++i) {
136136
totalBlockTimes.add(0);
137137
}
138138
}
@@ -189,7 +189,8 @@ private void runRandom() throws Exception {
189189
unitBlockTimes.set(threadIdx, unitBlockTime);
190190
unitOperationTime = 0;
191191
unitBlockTime = 0;
192-
while (System.currentTimeMillis() - startTime > 2000) startTime += 2000;
192+
while (System.currentTimeMillis() - startTime > 2000)
193+
startTime += 2000;
193194
}
194195
}
195196
totalOperationTimes.set(threadIdx, throttleNum + passNum);
@@ -224,7 +225,8 @@ private void runSpecifiedKey() throws Exception {
224225
unitBlockTimes.set(threadIdx, unitBlockTime);
225226
unitOperationTime = 0;
226227
unitBlockTime = 0;
227-
while (System.currentTimeMillis() - startTime > 2000) startTime += 2000;
228+
while (System.currentTimeMillis() - startTime > 2000)
229+
startTime += 2000;
228230
}
229231
}
230232
totalOperationTimes.set(threadIdx, throttleNum + passNum);

0 commit comments

Comments
 (0)