Skip to content

Commit 21a7351

Browse files
committed
FIX: improve refineTrimmedKeys method using Java 8 removeIf
1 parent f60ed48 commit 21a7351

File tree

372 files changed

+9144
-7996
lines changed

Some content is hidden

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

372 files changed

+9144
-7996
lines changed

.github/workflows/ci.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
pull_request:
88
branches:
99
- develop
10+
types:
11+
- opened
12+
- synchronize
13+
- reopened
14+
- ready_for_review
1015

1116
concurrency:
1217
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -18,9 +23,12 @@ jobs:
1823
runs-on: ${{ matrix.os }}
1924
strategy:
2025
matrix:
21-
jdk: [ 8, 11, 17 ]
22-
os: [ ubuntu-20.04 ]
26+
jdk: [ 8, 21 ]
27+
os: [ ubuntu-latest ]
2328
fail-fast: true
29+
if: |
30+
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
31+
(github.event_name == 'push' && github.ref == 'refs/heads/master')
2432
steps:
2533
- uses: actions/checkout@v4
2634
- name: Set up JDK ${{ matrix.jdk }}
@@ -35,9 +43,9 @@ jobs:
3543
run: |
3644
# clone
3745
git clone https://github.com/naver/arcus.git $HOME/arcus
38-
46+
3947
# build server
40-
cd ~/arcus && docker compose up -d
48+
cd ~/arcus && docker compose up -d
4149
4250
- name: Test ARCUS Client Without ZK
4351
run: mvn clean verify -DUSE_ZK=false -Dtest=ObserverTest,ArcusClientCreateTest

ChangeLog

+36-40
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,46 @@
11
# 2024-07-31 [version 1.14.0]
22
## 🐣 New Features
3-
* Bulk methods using varargs keys are deprecated. Instead, methods using collection keys are still available.
4-
* ArcusClient factory methods without zookeeper address are deprecated.
5-
* Provide shutdown(long, TimeUnit) method for ArcusClient.
6-
* Add auto import setting.
7-
* Add DNS cache TTL verification.
8-
* Add ArcusClient factory methods without ConnectionFactoryBuilder.
9-
* Add async mop upsert method.
10-
3+
- Bulk methods using varargs keys are deprecated. Instead, methods using collection keys are still available.
4+
- ArcusClient factory methods without zookeeper address are deprecated.
5+
- Provide shutdown(long, TimeUnit) method for ArcusClient.
6+
- Add auto import setting.
7+
- Add DNS cache TTL verification.
8+
- Add ArcusClient factory methods without ConnectionFactoryBuilder.
9+
- Add async mop upsert method.
1110
## 🔧 Enhancements
12-
* Add connection information and elapsed time into TimeoutException message.
13-
* Add all operations at once in broadcast methods.
14-
* Return GetFuture instead of OperationFuture in asyncGets method.
15-
* Use GetResult class instead of setting results into future directly in collection get methods.
16-
* Use List#sublist method instead of using nested collection when split operations in bulk methods.
17-
* Refactor redundant concurrent data structure and unnecessary modifier.
18-
* Change the way ArcusClient is named.
19-
* Change MBean name of ArcusClient to make more readable.
20-
* Remove Transcoder argument in LocalCacheManager.
21-
* Remove unused methods/variables and redundant generic type.
22-
* Remove unused TimeoutException constructors.
23-
* Remove TranscoderService field in MemcachedClient and BulkService properties in ConnectionFactoryBuilder. Decoding value with transcoder will be done in user thread, such as tomcat thread.
24-
11+
- Add connection information and elapsed time into TimeoutException message.
12+
- Add all operations at once in broadcast methods.
13+
- Return GetFuture instead of OperationFuture in asyncGets method.
14+
- Use GetResult class instead of setting results into future directly in collection get methods.
15+
- Use List#sublist method instead of using nested collection when split operations in bulk methods.
16+
- Refactor redundant concurrent data structure and unnecessary modifier.
17+
- Change the way ArcusClient is named.
18+
- Change MBean name of ArcusClient to make more readable.
19+
- Remove Transcoder argument in LocalCacheManager.
20+
- Remove unused methods/variables and redundant generic type.
21+
- Remove unused TimeoutException constructors.
22+
- Remove TranscoderService field in MemcachedClient and BulkService properties in ConnectionFactoryBuilder.
23+
Decoding value with transcoder will be done in user thread, such as tomcat thread.
2524
## 🐛 Bug Fixes
26-
* Make different results from InetSocketAddress.toString() same across JDK versions
27-
* Throw exception when bop get bulk count is lower than 1.
28-
* Fix invalid isTimeout value when creating BulkGetFuture with another object.
29-
* Set default value of shouldOptimize to false in DefaultConnectionFactory.
30-
* Consider optimizedOp when drain all of operations from the writeQ.
31-
* Make sure to create readonly copy of locator that has same shape with original one.
32-
25+
- Make different results from InetSocketAddress.toString() same across JDK versions
26+
- Throw exception when bop get bulk count is lower than 1.
27+
- Fix invalid isTimeout value when creating BulkGetFuture with another object.
28+
- Set default value of shouldOptimize to false in DefaultConnectionFactory.
29+
- Consider optimizedOp when drain all of operations from the writeQ.
30+
- Make sure to create readonly copy of locator that has same shape with original one.
3331
## 📝 Documentation
34-
* Fix wrong information.
35-
* Add DNS cache TTL information.
36-
* Add mop upsert API description.
37-
32+
- Fix wrong information.
33+
- Add DNS cache TTL information.
34+
- Add mop upsert API description.
3835
## ✅ Testing
39-
* Upgrade CI setup python version to 2.7.
40-
* Use docker compose in CI tests.
41-
* Fix various test cases which could be failed sometimes.
42-
* Stop CI test when at least one test fails.
43-
36+
- Upgrade CI setup python version to 2.7.
37+
- Use docker compose in CI tests.
38+
- Fix various test cases which could be failed sometimes.
39+
- Stop CI test when at least one test fails.
4440
## ⬆️ Dependency Upgrades
45-
* Upgrade Java version to 8.
46-
* Upgrade log4j version to 2.23.1.
47-
* Upgrade slf4j version to 2.0.12.
41+
- Upgrade Java version to 8.
42+
- Upgrade log4j version to 2.23.1.
43+
- Upgrade slf4j version to 2.0.12.
4844

4945
2023-09-25 [version 1.13.4]
5046
* [FEATURE] shutdown client after all of operations are processed

checkstyle.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
</module>
162162
-->
163163
<module name="JavadocMethod">
164-
<property name="scope" value="public"/>
164+
<property name="accessModifiers" value="public"/>
165165
<property name="allowMissingParamTags" value="true"/>
166166
<property name="allowMissingReturnTag" value="true"/>
167167
<property name="allowedAnnotations" value="Override, Test"/>

docs/arcus-java-client-getting-started.md

+15-11
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,17 @@ $ mvn eclipse:eclipse // 이클립스 IDE를 사용하는 경우 실행하여
6363
</properties>
6464

6565
<dependencies>
66-
<!-- 편의상 JUnit 버전을 4.x로 변경합니다. -->
6766
<dependency>
68-
<groupId>junit</groupId>
69-
<artifactId>junit</artifactId>
70-
<version>4.4</version>
71-
<scope>test</scope>
67+
<groupId>org.junit.jupiter</groupId>
68+
<artifactId>junit-jupiter-api</artifactId>
69+
<version>5.10.2</version>
70+
<scope>test</scope>
71+
</dependency>
72+
<dependency>
73+
<groupId>org.junit.jupiter</groupId>
74+
<artifactId>junit-jupiter-engine</artifactId>
75+
<version>5.10.2</version>
76+
<scope>test</scope>
7277
</dependency>
7378

7479
<!-- ARCUS 클라이언트 의존성을 추가합니다. -->
@@ -109,23 +114,22 @@ $ mvn eclipse:eclipse // 이클립스 IDE를 사용하는 경우 실행하여
109114
// HelloArcusTest.java
110115
package com.navercorp.arcus;
111116

112-
import org.junit.Assert;
117+
import org.junit.jupiter.api.BeforeEach;
113118

114-
import org.junit.Before;
115-
import org.junit.Test;
119+
import static org.junit.jupiter.api.Assertions.assertEquals;
116120

117121
public class HelloArcusTest {
118122

119123
HelloArcus helloArcus = new HelloArcus("127.0.0.1:2181", "test");
120124

121-
@Before
122-
public void sayHello() {
125+
@BeforeEach
126+
protected void sayHello() {
123127
helloArcus.sayHello();
124128
}
125129

126130
@Test
127131
public void listenHello() {
128-
Assert.assertEquals("Hello, Arcus!", helloArcus.listenHello());
132+
assertEquals("Hello, Arcus!", helloArcus.listenHello());
129133
}
130134

131135
}

docs/user_guide/02-arcus-java-client.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ ArcusClient client = new ArcusClient(SERVICE_CODE, factory);
518518
명령어의 내용을 담는 operation 큐를 생성한다. 기본적으로 크기가 16,384인 큐를 사용한다.
519519
큐의 크기를 1000으로 변경하고 싶다면 setOpQueueFactory(new ArrayOperationQueueFactory(1000))으로 설정하면 된다.
520520

521-
- setTranscoder(Transcoder<Object> t)
521+
- setTranscoder(Transcoder\<Object\> t)
522522

523523
캐시의 데이터 영역에 대한 character set과 압축 기준을 설정한다.
524524
GZip 압축을 사용하며, 기본값은 UTF-8과 16,384 byte이다.
@@ -533,6 +533,11 @@ ArcusClient client = new ArcusClient(SERVICE_CODE, factory);
533533
trans.setCompressionThreshold(4096);
534534
setTranscoder(trans);
535535
```
536+
직접 ClassLoader 객체를 지정해 사용할 수 있다. Spring Devtools와 같이 클래스로더를 별도로 두는
537+
라이브러리를 사용할 때 캐시에서 조회하여 역직렬화 할 때 사용하는 클래스 로더와 프로세스에서 사용되고 있는 클래스 로더를 일치시키기 위해 사용한다.
538+
```java
539+
SerializingTranscoder tc = new SerializingTranscoder(CachedData.MAX_SIZE, this.getClass().getClassLoader());
540+
```
536541

537542
- setShouldOptimize(boolean o)
538543

docs/user_guide/03-key-value-API.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ Future<Map<String, OperationStatus>> asyncStoreBulk(StoreType type, List<String>
6666
Future<Map<String, OperationStatus>> asyncStoreBulk(StoreType type, Map<String, Object> map, int exp)
6767
```
6868

69-
- 다수의 key-value item을 한번에 저장한다.
70-
- 전자 API는 key list의 모든 key에 대해 동일한 obj로 저장 연산을 한번에 수행한다.
71-
- 후자 API는 map에 있는 모든 \<key, obj\>에 대해 저장 연산을 한번에 수행한다.
69+
- 다수의 key-value item을 한 번에 저장한다.
70+
- 전자 API는 key list의 모든 key에 대해 동일한 obj로 저장 연산을 한 번에 수행한다.
71+
- 후자 API는 map에 있는 모든 \<key, obj\>에 대해 저장 연산을 한 번에 수행한다.
7272
- 저장된 key-value item들은 모두 exp 초 이후에 삭제된다.
7373
- StoreType은 연산의 저장 유형을 지정한다. 아래의 유형이 있다.
7474
- StoreType.set
@@ -106,7 +106,7 @@ future.get(key).getStatusCode() | 설명
106106
--------------------------------| ---------
107107
StatusCode.SUCCESS | 조회 성공(key에 해당하는 item 존재하지 않아도 성공)
108108

109-
여러 key들의 value를 한번에 조회하는 bulk API를 제공한다.
109+
여러 key들의 value를 한 번에 조회하는 bulk API를 제공한다.
110110

111111
```java
112112
BulkFuture<Map<String, Object>> asyncGetBulk(Collection<String> keys)
@@ -130,7 +130,7 @@ future.get(key).getStatusCode() | 설명
130130
--------------------------------| ---------
131131
StatusCode.SUCCESS | 조회 성공(key에 해당하는 item 존재하지 않아도 성공)
132132

133-
여러 key들의 CASValue를 한번에 조회하는 bulk API를 제공한다.
133+
여러 key들의 CASValue를 한 번에 조회하는 bulk API를 제공한다.
134134

135135
```java
136136
BulkFuture<Map<String, CASValue<Object>>> asyncGetsBulk(Collection<String> keys)
@@ -176,7 +176,7 @@ StatusCode.ERR_NOT_FOUND | 증감 실패 (Key miss, 주어진
176176
## Key-Value Item 삭제
177177

178178
하나의 key에 대한 item을 삭제하는 API와
179-
여러 key들의 item들을 한번에 삭제하는 bulk API를 제공한다.
179+
여러 key들의 item들을 한 번에 삭제하는 bulk API를 제공한다.
180180

181181
```java
182182
OperationFuture<Boolean> delete(String key)
@@ -196,7 +196,7 @@ Future<Map<String, OperationStatus>> asyncDeleteBulk(List<String> key)
196196
Future<Map<String, OperationStatus>> asyncDeleteBulk(String... key)
197197
```
198198

199-
- 다수의 key-value item을 한번에 delete한다.
199+
- 다수의 key-value item을 한 번에 delete한다.
200200
- 다수 key들은 String 유형의 List이거나 String 유형의 나열된 key 목록일 수 있다.
201201

202202
delete 실패한 키와 실패 원인은 future 객체를 통해 Map 형태로 조회할 수 있다.

docs/user_guide/04-list-API.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ List item에 대해 수행가능한 기본 연산들은 아래와 같다.
1616
- [List Element 삭제](04-list-API.md#list-element-삭제)
1717
- [List Element 조회](04-list-API.md#list-element-조회)
1818

19-
여러 list element들에 대해 한번에 일괄 수행하는 연산은 다음과 같다.
19+
여러 list element들에 대해 한 번에 일괄 수행하는 연산은 다음과 같다.
2020

2121
- [List Element 일괄 삽입](04-list-API.md#list-element-일괄-삽입)
2222

docs/user_guide/05-set-API.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Set item에 수행가능한 기본 연산들은 다음과 같다.
1616
- [Set Element 존재여부 확인](05-set-API.md#set-element-존재여부-확인)
1717
- [Set Element 조회](05-set-API.md#set-element-조회)
1818

19-
여러 set element들에 대해 한번에 일괄 수행하는 연산은 다음과 같다.
19+
여러 set element들에 대해 한 번에 일괄 수행하는 연산은 다음과 같다.
2020

2121
- [Set Element 일괄 삽입](05-set-API.md#set-element-일괄-삽입)
2222
- [Set Element 일괄 존재여부 확인](05-set-API.md#set-element-일괄-존재여부-확인)
@@ -352,7 +352,7 @@ try {
352352

353353
## Set Element 일괄 삽입
354354

355-
Set에 여러 element를 한번에 삽입하는 함수는 두 가지가 있다.
355+
Set에 여러 element를 한 번에 삽입하는 함수는 두 가지가 있다.
356356

357357
첫째, 하나의 key가 가리키는 set에 다수의 element를 삽입하는 함수이다.
358358

@@ -440,7 +440,7 @@ try {
440440

441441
## Set Element 일괄 존재여부 확인
442442

443-
Set에서 여러 element의 존재여부를 한번에 확인하는 함수이다.
443+
Set에서 여러 element의 존재여부를 한 번에 확인하는 함수이다.
444444

445445
```java
446446
CollectionFuture<Map<Object, Boolean>> asyncSopPipedExistBulk(String key, List<Object> values)

docs/user_guide/06-map-API.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Map item에 대해 수행가능한 기본 연산은 다음과 같다.
1717
- [Map Element 삭제](06-map-API.md#map-element-삭제)
1818
- [Map Element 조회](06-map-API.md#map-element-조회)
1919

20-
여러 map element들에 대해 한번에 일괄 수행하는 연산은 다음과 같다.
20+
여러 map element들에 대해 한 번에 일괄 수행하는 연산은 다음과 같다.
2121

2222
- [Map Element 일괄 삽입](06-map-API.md#map-element-일괄-삽입)
2323
- [Map Element 일괄 변경](06-map-API.md#map-element-일괄-변경)
@@ -416,7 +416,7 @@ try {
416416
}
417417
```
418418

419-
1. map에서 mkey1, mkey2를 한번에 조회하기 위해 List에 add하고 mkeyList를 조회했다.
419+
1. map에서 mkey1, mkey2를 한 번에 조회하기 위해 List에 add하고 mkeyList를 조회했다.
420420
2. timeout은 1초로 지정했다. 지정한 시간에 조회 결과가 넘어 오지 않거나
421421
JVM의 과부하로 operation queue에서 처리되지 않을 경우 TimeoutException이 발생한다.
422422
반환되는 Map 인터페이스의 구현체는 HashMap이며, 그 결과는 다음 중의 하나이다.
@@ -428,7 +428,7 @@ try {
428428

429429
## Map Element 일괄 삽입
430430

431-
Map에 여러 element를 한번에 삽입하는 함수는 두 유형이 있다.
431+
Map에 여러 element를 한 번에 삽입하는 함수는 두 유형이 있다.
432432

433433
첫째, 하나의 key가 가리키는 Map에 다수의 element를 삽입하는 함수이다.
434434

docs/user_guide/07-btree-API.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ B+tree item에 대해 수행가능한 기본 연산은 다음과 같다.
2929
- [B+Tree Element 개수 계산](07-btree-API.md#btree-element-개수-계산)
3030
- [B+Tree Element 조회](07-btree-API.md#btree-element-조회)
3131

32-
여러 b+tree element들에 대해 한번에 일괄 수행하는 연산은 다음과 같다.
32+
여러 b+tree element들에 대해 한 번에 일괄 수행하는 연산은 다음과 같다.
3333

3434
- [B+Tree Element 일괄 삽입](07-btree-API.md#btree-element-일괄-삽입)
3535
- [B+Tree Element 일괄 변경](07-btree-API.md#btree-element-일괄-변경)
@@ -953,7 +953,7 @@ try {
953953

954954
## B+Tree Element 일괄 삽입
955955

956-
B+tree에 여러 element를 한번에 삽입하는 함수는 두 유형이 있다.
956+
B+tree에 여러 element를 한 번에 삽입하는 함수는 두 유형이 있다.
957957

958958
첫째, 하나의 key가 가리키는 b+tree에 다수의 element를 삽입하는 함수이다.
959959

docs/user_guide/10-log-message.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Java client에서 남기는 로그들과 그것들이 의미하는 바는 아래
88
ARCUS client가 정상적으로 초기화 되면 다음과 같은 로그를 남긴다.
99

1010
```java
11-
INFO net.spy.memcached.CacheManager: CacheManager started. ([mailto:dev@dev.arcuscloud.nhncorp.com:17288 dev@dev.arcuscloud.nhncorp.com:17288])
11+
INFO net.spy.memcached.CacheManager: CacheManager started. ([mailto:dev@dev.arcuscloud.jam2in.com:2181 dev@dev.arcuscloud.jam2in.com:2181])
1212

1313
WARN net.spy.memcached.CacheMonitor: Cache list has been changed : From=null, To=[127.0.0.1:11211-hostname, xxx.xxx.xxx.xxx:xxxx-hostname] : [serviceCode=dev]
1414

0 commit comments

Comments
 (0)