Skip to content

Commit 7aa0826

Browse files
authored
Inline used Caffeine 3.3.1 cache classes into node-commons and remove external Caffeine dependency
1 parent ff81d80 commit 7aa0826

156 files changed

Lines changed: 32714 additions & 93 deletions

File tree

Some content is hidden

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

‎LICENSE‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,17 @@ License: https://github.com/apache/commons-collections/blob/master/LICENSE.txt
331331

332332
--------------------------------------------------------------------------------
333333

334+
The following files include code modified from Caffeine project.
335+
336+
./iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/external/caffeine/*
337+
338+
Caffeine is open source software licensed under the Apache License 2.0.
339+
Copyright 2014 Ben Manes. All Rights Reserved.
340+
Project page: https://github.com/ben-manes/caffeine
341+
License: https://github.com/ben-manes/caffeine/blob/master/LICENSE
342+
343+
--------------------------------------------------------------------------------
344+
334345
The following files include code modified from LMax Disruptor project.
335346

336347
./iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/dataregion/realtime/disruptor/*

‎LICENSE-binary‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.12
226226
com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-base:2.18.12
227227
com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-json-provider:2.18.12
228228
com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations:2.18.12
229-
com.github.ben-manes.caffeine:caffeine:2.9.3
230229
com.github.moquette-io.moquette:moquette-broker:0.18.0
231230
com.google.code.findbugs:jsr305:3.0.2
232231
com.google.errorprone:error_prone_annotations:2.18.0
@@ -311,7 +310,6 @@ com.github.luben:zstd-jni:1.5.6-3
311310
MIT License
312311
------------
313312
io.github.classgraph:classgraph:4.8.184
314-
org.checkerframework:checker-qual:3.33.0
315313
org.java-websocket:Java-WebSocket:1.5.4
316314
org.slf4j:slf4j-api:2.0.9
317315
org.slf4j:slf4j-reload4j:1.7.36

‎dependencies.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-base",
1414
"com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-json-provider",
1515
"com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations",
16-
"com.github.ben-manes.caffeine:caffeine",
1716
"com.github.luben:zstd-jni",
1817
"com.github.moquette-io.moquette:moquette-broker",
1918
"com.github.wendykierp:JTransforms",
@@ -94,7 +93,6 @@
9493
"org.apache.thrift:libthrift",
9594
"org.apache.tsfile:common",
9695
"org.apache.tsfile:tsfile",
97-
"org.checkerframework:checker-qual",
9896
"org.eclipse.collections:eclipse-collections",
9997
"org.eclipse.collections:eclipse-collections-api",
10098
"org.eclipse.jetty:jetty-http",

‎iotdb-core/datanode/pom.xml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,6 @@
222222
</exclusion>
223223
</exclusions>
224224
</dependency>
225-
<dependency>
226-
<groupId>com.github.ben-manes.caffeine</groupId>
227-
<artifactId>caffeine</artifactId>
228-
</dependency>
229225
<dependency>
230226
<groupId>org.java-websocket</groupId>
231227
<artifactId>Java-WebSocket</artifactId>

‎iotdb-core/datanode/src/main/java/org/apache/iotdb/db/auth/BasicAuthorityCache.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
import org.apache.iotdb.commons.auth.entity.Role;
2323
import org.apache.iotdb.commons.auth.entity.User;
24+
import org.apache.iotdb.commons.external.caffeine.cache.Cache;
25+
import org.apache.iotdb.commons.external.caffeine.cache.Caffeine;
2426
import org.apache.iotdb.db.conf.IoTDBDescriptor;
2527

26-
import com.github.benmanes.caffeine.cache.Cache;
27-
import com.github.benmanes.caffeine.cache.Caffeine;
2828
import org.slf4j.Logger;
2929
import org.slf4j.LoggerFactory;
3030

‎iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/processor/downsampling/PartialPathLastObjectCache.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919

2020
package org.apache.iotdb.db.pipe.processor.downsampling;
2121

22+
import org.apache.iotdb.commons.external.caffeine.cache.Cache;
23+
import org.apache.iotdb.commons.external.caffeine.cache.Caffeine;
24+
import org.apache.iotdb.commons.external.caffeine.cache.Weigher;
2225
import org.apache.iotdb.db.i18n.DataNodePipeMessages;
2326
import org.apache.iotdb.db.pipe.resource.PipeDataNodeResourceManager;
2427
import org.apache.iotdb.db.pipe.resource.memory.PipeMemoryBlock;
2528
import org.apache.iotdb.db.pipe.resource.memory.PipeMemoryBlockCategory;
2629
import org.apache.iotdb.db.utils.MemUtils;
2730

28-
import com.github.benmanes.caffeine.cache.Cache;
29-
import com.github.benmanes.caffeine.cache.Caffeine;
30-
import com.github.benmanes.caffeine.cache.Weigher;
3131
import org.slf4j.Logger;
3232
import org.slf4j.LoggerFactory;
3333

‎iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/client/IoTDBDataNodeCacheLeaderClientManager.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
package org.apache.iotdb.db.pipe.sink.client;
2121

2222
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
23+
import org.apache.iotdb.commons.external.caffeine.cache.Cache;
24+
import org.apache.iotdb.commons.external.caffeine.cache.Caffeine;
25+
import org.apache.iotdb.commons.external.caffeine.cache.Weigher;
2326
import org.apache.iotdb.commons.pipe.config.PipeConfig;
2427
import org.apache.iotdb.db.i18n.DataNodePipeMessages;
2528
import org.apache.iotdb.db.pipe.resource.PipeDataNodeResourceManager;
2629
import org.apache.iotdb.db.pipe.resource.memory.PipeMemoryBlock;
2730
import org.apache.iotdb.db.pipe.resource.memory.PipeMemoryBlockCategory;
2831
import org.apache.iotdb.rpc.UrlUtils;
2932

30-
import com.github.benmanes.caffeine.cache.Cache;
31-
import com.github.benmanes.caffeine.cache.Caffeine;
32-
import com.github.benmanes.caffeine.cache.Weigher;
3333
import org.apache.tsfile.utils.Pair;
3434
import org.slf4j.Logger;
3535
import org.slf4j.LoggerFactory;

‎iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/partition/PartitionCache.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
import org.apache.iotdb.commons.exception.IoTDBRuntimeException;
3232
import org.apache.iotdb.commons.exception.MetadataException;
3333
import org.apache.iotdb.commons.exception.MetadataLeaseFencedException.LeaseFencedRetryPolicy;
34+
import org.apache.iotdb.commons.external.caffeine.cache.Cache;
35+
import org.apache.iotdb.commons.external.caffeine.cache.Caffeine;
3436
import org.apache.iotdb.commons.memory.IMemoryBlock;
3537
import org.apache.iotdb.commons.memory.MemoryBlockType;
3638
import org.apache.iotdb.commons.partition.DataPartition;
@@ -67,8 +69,6 @@
6769
import org.apache.iotdb.db.service.metrics.CacheMetrics;
6870
import org.apache.iotdb.rpc.TSStatusCode;
6971

70-
import com.github.benmanes.caffeine.cache.Cache;
71-
import com.github.benmanes.caffeine.cache.Caffeine;
7272
import org.apache.thrift.TException;
7373
import org.apache.tsfile.annotations.TableModel;
7474
import org.apache.tsfile.annotations.TreeModel;

‎iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/schema/DataNodeDevicePathCache.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@
2020
package org.apache.iotdb.db.queryengine.plan.analyze.cache.schema;
2121

2222
import org.apache.iotdb.commons.exception.IllegalPathException;
23+
import org.apache.iotdb.commons.external.caffeine.cache.Cache;
24+
import org.apache.iotdb.commons.external.caffeine.cache.Caffeine;
25+
import org.apache.iotdb.commons.external.caffeine.cache.Weigher;
2326
import org.apache.iotdb.commons.memory.IMemoryBlock;
2427
import org.apache.iotdb.commons.memory.MemoryBlockType;
2528
import org.apache.iotdb.commons.path.PartialPath;
2629
import org.apache.iotdb.db.conf.DataNodeMemoryConfig;
2730
import org.apache.iotdb.db.conf.IoTDBDescriptor;
2831

29-
import com.github.benmanes.caffeine.cache.Cache;
30-
import com.github.benmanes.caffeine.cache.Caffeine;
31-
import com.github.benmanes.caffeine.cache.Weigher;
32-
3332
/** This cache is for reducing duplicated DeviceId PartialPath initialization in write process. */
3433
public class DataNodeDevicePathCache {
3534

‎iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/DeviceSchemaRequestCache.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
package org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.cache;
2121

22+
import org.apache.iotdb.commons.external.caffeine.cache.Cache;
23+
import org.apache.iotdb.commons.external.caffeine.cache.Caffeine;
2224
import org.apache.iotdb.db.conf.IoTDBDescriptor;
2325
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.FetchDevice;
2426

25-
import com.github.benmanes.caffeine.cache.Cache;
26-
import com.github.benmanes.caffeine.cache.Caffeine;
2727
import org.apache.tsfile.file.metadata.IDeviceID;
2828
import org.apache.tsfile.utils.Binary;
2929

0 commit comments

Comments
 (0)