Skip to content

Commit 209131d

Browse files
committed
replace javax with jakarta
1 parent 7d2633c commit 209131d

File tree

66 files changed

+233
-252
lines changed

Some content is hidden

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

66 files changed

+233
-252
lines changed

base-kv/base-kv-store-server/src/main/java/com/baidu/bifromq/basekv/store/api/IKVRangeReader.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313

1414
package com.baidu.bifromq.basekv.store.api;
1515

16-
import javax.annotation.concurrent.NotThreadSafe;
17-
1816
/**
19-
* Thread-Unsafe reader to access the consistent view of KVRange
17+
* Thread-Unsafe reader to access the consistent view of KVRange.
2018
*/
21-
@NotThreadSafe
2219
public interface IKVRangeReader extends IKVRangeMetadata {
2320

2421
IKVReader newDataReader();

base-kv/base-kv-store-server/src/main/java/com/baidu/bifromq/basekv/store/range/hinter/LoadRecordWindow.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
import java.util.concurrent.atomic.AtomicInteger;
2525
import java.util.concurrent.atomic.AtomicLong;
2626
import java.util.function.Function;
27-
import javax.annotation.concurrent.NotThreadSafe;
2827

29-
30-
@NotThreadSafe
3128
final class LoadRecordWindow {
3229
private final Function<ByteString, Optional<ByteString>> toSplitKey;
3330
private final AtomicInteger records = new AtomicInteger();

base-kv/base-kv-store-server/src/main/java/com/baidu/bifromq/basekv/store/wal/KVRangeWALStorageEngine.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@
3030
import java.util.Map;
3131
import java.util.Set;
3232
import java.util.concurrent.atomic.AtomicReference;
33-
import javax.annotation.concurrent.NotThreadSafe;
3433
import org.slf4j.Logger;
3534

3635
/**
3736
* WALStore engine.
3837
*/
39-
@NotThreadSafe
4038
public class KVRangeWALStorageEngine implements IKVRangeWALStoreEngine {
4139
private final Logger log;
4240
private final String clusterId;

base-rpc/base-rpc-client/src/main/java/com/baidu/bifromq/baserpc/client/IRPCClient.java

Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
import io.grpc.MethodDescriptor;
1919
import io.reactivex.rxjava3.core.Observable;
20+
import jakarta.annotation.Nullable;
2021
import java.util.Map;
2122
import java.util.concurrent.CompletableFuture;
2223
import java.util.function.Consumer;
2324
import java.util.function.Supplier;
24-
import javax.annotation.Nullable;
2525

2626
/**
2727
* The RPC client interface.
@@ -32,65 +32,13 @@ static RPCClientBuilder newBuilder() {
3232
return new RPCClientBuilder();
3333
}
3434

35-
36-
/**
37-
* The interface for managed request-response pipeline.
38-
*
39-
* @param <ReqT> the request type
40-
* @param <RespT> the response type
41-
*/
42-
interface IRequestPipeline<ReqT, RespT> {
43-
boolean isClosed();
44-
45-
CompletableFuture<RespT> invoke(ReqT req);
46-
47-
void close();
48-
}
49-
50-
/**
51-
* The interface for managed bi-di message stream, which will automatically handle load balance change.
52-
*
53-
* @param <MsgT> the message received from server
54-
* @param <AckT> the ack send to server
55-
*/
56-
interface IMessageStream<MsgT, AckT> {
57-
boolean isClosed();
58-
59-
/**
60-
* Send ack to server.
61-
*
62-
* @param ack the ack
63-
*/
64-
void ack(AckT ack);
65-
66-
/**
67-
* Register a message consumer.
68-
*
69-
* @param consumer the consumer
70-
*/
71-
void onMessage(Consumer<MsgT> consumer);
72-
73-
/**
74-
* Register a retarget event consumer.
75-
*
76-
* @param consumer the consumer
77-
*/
78-
void onRetarget(Consumer<Long> consumer);
79-
80-
/**
81-
* Close the stream.
82-
*/
83-
void close();
84-
}
85-
8635
/**
8736
* The observable of live servers.
8837
*
8938
* @return an observable of connectable servers with a map of metadata attached
9039
*/
9140
Observable<Map<String, Map<String, String>>> serverList();
9241

93-
9442
default <ReqT, RespT> CompletableFuture<RespT> invoke(String tenantId,
9543
@Nullable String desiredServerId,
9644
ReqT req,
@@ -172,9 +120,59 @@ <MsgT, AckT> IMessageStream<MsgT, AckT> createMessageStream(String tenantId,
172120
Supplier<Map<String, String>> metadataSupplier,
173121
MethodDescriptor<AckT, MsgT> methodDesc);
174122

175-
176123
/**
177124
* Close the client.
178125
*/
179126
void stop();
127+
128+
/**
129+
* The interface for managed request-response pipeline.
130+
*
131+
* @param <ReqT> the request type
132+
* @param <RespT> the response type
133+
*/
134+
interface IRequestPipeline<ReqT, RespT> {
135+
boolean isClosed();
136+
137+
CompletableFuture<RespT> invoke(ReqT req);
138+
139+
void close();
140+
}
141+
142+
143+
/**
144+
* The interface for managed bi-di message stream, which will automatically handle load balance change.
145+
*
146+
* @param <MsgT> the message received from server
147+
* @param <AckT> the ack send to server
148+
*/
149+
interface IMessageStream<MsgT, AckT> {
150+
boolean isClosed();
151+
152+
/**
153+
* Send ack to server.
154+
*
155+
* @param ack the ack
156+
*/
157+
void ack(AckT ack);
158+
159+
/**
160+
* Register a message consumer.
161+
*
162+
* @param consumer the consumer
163+
*/
164+
void onMessage(Consumer<MsgT> consumer);
165+
166+
/**
167+
* Register a retarget event consumer.
168+
*
169+
* @param consumer the consumer
170+
*/
171+
void onRetarget(Consumer<Long> consumer);
172+
173+
/**
174+
* Close the stream.
175+
*/
176+
void close();
177+
}
180178
}

base-rpc/base-rpc-client/src/main/java/com/baidu/bifromq/baserpc/client/IUnaryCaller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
import static java.util.Collections.emptyMap;
1717

18+
import jakarta.annotation.Nullable;
1819
import java.util.Map;
1920
import java.util.concurrent.CompletableFuture;
20-
import javax.annotation.Nullable;
2121

2222
/**
2323
* The caller for unary RPC.

base-rpc/base-rpc-client/src/main/java/com/baidu/bifromq/baserpc/client/ManagedBiDiStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import io.reactivex.rxjava3.functions.Action;
2828
import io.reactivex.rxjava3.functions.Consumer;
2929
import io.reactivex.rxjava3.schedulers.Schedulers;
30+
import jakarta.annotation.Nullable;
3031
import java.time.Duration;
3132
import java.util.Map;
3233
import java.util.Optional;
@@ -36,7 +37,6 @@
3637
import java.util.concurrent.atomic.AtomicBoolean;
3738
import java.util.concurrent.atomic.AtomicReference;
3839
import java.util.function.Supplier;
39-
import javax.annotation.Nullable;
4040
import lombok.extern.slf4j.Slf4j;
4141

4242
@Slf4j

base-rpc/base-rpc-client/src/main/java/com/baidu/bifromq/baserpc/client/ManagedMessageStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
import io.grpc.CallOptions;
2121
import io.grpc.MethodDescriptor;
2222
import io.reactivex.rxjava3.subjects.PublishSubject;
23+
import jakarta.annotation.Nullable;
2324
import java.util.Map;
2425
import java.util.concurrent.ConcurrentLinkedQueue;
2526
import java.util.concurrent.atomic.AtomicBoolean;
2627
import java.util.function.Consumer;
2728
import java.util.function.Supplier;
28-
import javax.annotation.Nullable;
2929
import lombok.extern.slf4j.Slf4j;
3030

3131
@Slf4j

base-rpc/base-rpc-client/src/main/java/com/baidu/bifromq/baserpc/client/ManagedRequestPipeline.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.baidu.bifromq.baserpc.metrics.RPCMetric;
2424
import io.grpc.CallOptions;
2525
import io.grpc.MethodDescriptor;
26+
import jakarta.annotation.Nullable;
2627
import java.util.Map;
2728
import java.util.Optional;
2829
import java.util.concurrent.CompletableFuture;
@@ -31,7 +32,6 @@
3132
import java.util.concurrent.atomic.AtomicBoolean;
3233
import java.util.concurrent.atomic.AtomicInteger;
3334
import java.util.function.Supplier;
34-
import javax.annotation.Nullable;
3535
import lombok.extern.slf4j.Slf4j;
3636

3737
@Slf4j

base-rpc/base-rpc-client/src/main/java/com/baidu/bifromq/baserpc/client/RPCClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
import io.grpc.MethodDescriptor;
2222
import io.reactivex.rxjava3.core.Observable;
2323
import io.reactivex.rxjava3.disposables.Disposable;
24+
import jakarta.annotation.Nullable;
2425
import java.util.Map;
2526
import java.util.concurrent.CompletableFuture;
2627
import java.util.concurrent.TimeUnit;
2728
import java.util.concurrent.atomic.AtomicInteger;
2829
import java.util.function.Supplier;
29-
import javax.annotation.Nullable;
3030
import lombok.NonNull;
3131
import lombok.extern.slf4j.Slf4j;
3232

base-rpc/base-rpc-client/src/main/java/com/baidu/bifromq/baserpc/client/UnaryCaller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
import io.grpc.Context;
3131
import io.grpc.MethodDescriptor;
3232
import io.grpc.stub.StreamObserver;
33+
import jakarta.annotation.Nullable;
3334
import java.util.Map;
3435
import java.util.Optional;
3536
import java.util.concurrent.CompletableFuture;
3637
import java.util.concurrent.TimeUnit;
3738
import java.util.concurrent.atomic.AtomicInteger;
3839
import java.util.function.Supplier;
39-
import javax.annotation.Nullable;
4040
import lombok.SneakyThrows;
4141
import lombok.extern.slf4j.Slf4j;
4242

0 commit comments

Comments
 (0)