Skip to content

Commit aebb9d2

Browse files
authored
[#5633] remove the key-value storage backend logic (#5645)
<!-- 1. Title: [#<issue>] <type>(<scope>): <subject> Examples: - "[#123] feat(operator): support xxx" - "[#233] fix: check null before access result in xxx" - "[MINOR] refactor: fix typo in variable name" - "[MINOR] docs: fix typo in README" - "[#255] test: fix flaky test NameOfTheTest" Reference: https://www.conventionalcommits.org/en/v1.0.0/ 2. If the PR is unfinished, please mark this PR as draft. --> ### What changes were proposed in this pull request? Remove Key-Value storage backend storage implementations ### Why are the changes needed? Fix: #5633 ### Does this PR introduce _any_ user-facing change? yes ### How was this patch tested? Remove tests for the Key-Value storage implementation code
1 parent 8fa24a4 commit aebb9d2

File tree

75 files changed

+73
-7998
lines changed

Some content is hidden

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

75 files changed

+73
-7998
lines changed

LICENSE.bin

-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@
384384

385385
JSR305
386386
LevelDB JNI
387-
RocksDB JNI
388387
JCraft
389388
Javolution
390389
ANTLR4

LICENSE.rest

-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@
314314
JSR305
315315
LevelDB JNI
316316
Protobuf
317-
RocksDB JNI
318317
Stax2 API
319318
XMLenc
320319

build.gradle.kts

+43-45
Original file line numberDiff line numberDiff line change
@@ -303,51 +303,49 @@ subprojects {
303303
}
304304
}
305305

306-
if (project.name != "meta") {
307-
apply(plugin = "net.ltgt.errorprone")
308-
dependencies {
309-
errorprone("com.google.errorprone:error_prone_core:2.10.0")
310-
}
311-
312-
tasks.withType<JavaCompile>().configureEach {
313-
options.errorprone.isEnabled.set(true)
314-
options.errorprone.disableWarningsInGeneratedCode.set(true)
315-
options.errorprone.disable(
316-
"AlmostJavadoc",
317-
"CanonicalDuration",
318-
"CheckReturnValue",
319-
"ComparableType",
320-
"ConstantOverflow",
321-
"DoubleBraceInitialization",
322-
"EqualsUnsafeCast",
323-
"EmptyBlockTag",
324-
"FutureReturnValueIgnored",
325-
"InconsistentCapitalization",
326-
"InconsistentHashCode",
327-
"JavaTimeDefaultTimeZone",
328-
"JdkObsolete",
329-
"LockNotBeforeTry",
330-
"MissingSummary",
331-
"MissingOverride",
332-
"MutableConstantField",
333-
"NonOverridingEquals",
334-
"ObjectEqualsForPrimitives",
335-
"OperatorPrecedence",
336-
"ReturnValueIgnored",
337-
"SameNameButDifferent",
338-
"StaticAssignmentInConstructor",
339-
"StringSplitter",
340-
"ThreadPriorityCheck",
341-
"ThrowIfUncheckedKnownChecked",
342-
"TypeParameterUnusedInFormals",
343-
"UnicodeEscape",
344-
"UnnecessaryParentheses",
345-
"UnsafeReflectiveConstructionCast",
346-
"UnusedMethod",
347-
"VariableNameSameAsType",
348-
"WaitNotInLoop"
349-
)
350-
}
306+
apply(plugin = "net.ltgt.errorprone")
307+
dependencies {
308+
errorprone("com.google.errorprone:error_prone_core:2.10.0")
309+
}
310+
311+
tasks.withType<JavaCompile>().configureEach {
312+
options.errorprone.isEnabled.set(true)
313+
options.errorprone.disableWarningsInGeneratedCode.set(true)
314+
options.errorprone.disable(
315+
"AlmostJavadoc",
316+
"CanonicalDuration",
317+
"CheckReturnValue",
318+
"ComparableType",
319+
"ConstantOverflow",
320+
"DoubleBraceInitialization",
321+
"EqualsUnsafeCast",
322+
"EmptyBlockTag",
323+
"FutureReturnValueIgnored",
324+
"InconsistentCapitalization",
325+
"InconsistentHashCode",
326+
"JavaTimeDefaultTimeZone",
327+
"JdkObsolete",
328+
"LockNotBeforeTry",
329+
"MissingSummary",
330+
"MissingOverride",
331+
"MutableConstantField",
332+
"NonOverridingEquals",
333+
"ObjectEqualsForPrimitives",
334+
"OperatorPrecedence",
335+
"ReturnValueIgnored",
336+
"SameNameButDifferent",
337+
"StaticAssignmentInConstructor",
338+
"StringSplitter",
339+
"ThreadPriorityCheck",
340+
"ThrowIfUncheckedKnownChecked",
341+
"TypeParameterUnusedInFormals",
342+
"UnicodeEscape",
343+
"UnnecessaryParentheses",
344+
"UnsafeReflectiveConstructionCast",
345+
"UnusedMethod",
346+
"VariableNameSameAsType",
347+
"WaitNotInLoop"
348+
)
351349
}
352350

353351
tasks.withType<Javadoc> {

catalogs/catalog-hadoop/src/test/java/org/apache/gravitino/catalog/hadoop/TestHadoopCatalogOperations.java

-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import static org.apache.gravitino.Configs.ENTITY_RELATIONAL_JDBC_BACKEND_URL;
2626
import static org.apache.gravitino.Configs.ENTITY_RELATIONAL_JDBC_BACKEND_USER;
2727
import static org.apache.gravitino.Configs.ENTITY_RELATIONAL_STORE;
28-
import static org.apache.gravitino.Configs.ENTITY_SERDE;
2928
import static org.apache.gravitino.Configs.ENTITY_STORE;
3029
import static org.apache.gravitino.Configs.RELATIONAL_ENTITY_STORE;
3130
import static org.apache.gravitino.Configs.STORE_DELETE_AFTER_TIME;
@@ -189,7 +188,6 @@ public static void setUp() {
189188
when(config.get(VERSION_RETENTION_COUNT)).thenReturn(1L);
190189
when(config.get(STORE_TRANSACTION_MAX_SKEW_TIME)).thenReturn(1000L);
191190
when(config.get(STORE_DELETE_AFTER_TIME)).thenReturn(20 * 60 * 1000L);
192-
when(config.get(ENTITY_SERDE)).thenReturn("proto");
193191

194192
store = EntityStoreFactory.createEntityStore(config);
195193
store.initialize(config);

catalogs/catalog-kafka/src/test/java/org/apache/gravitino/catalog/kafka/TestKafkaCatalogOperations.java

-12
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@
1919
package org.apache.gravitino.catalog.kafka;
2020

2121
import static org.apache.gravitino.Catalog.Type.MESSAGING;
22-
import static org.apache.gravitino.Configs.DEFAULT_ENTITY_KV_STORE;
2322
import static org.apache.gravitino.Configs.DEFAULT_ENTITY_RELATIONAL_STORE;
24-
import static org.apache.gravitino.Configs.ENTITY_KV_ROCKSDB_BACKEND_PATH;
25-
import static org.apache.gravitino.Configs.ENTITY_KV_STORE;
2623
import static org.apache.gravitino.Configs.ENTITY_RELATIONAL_JDBC_BACKEND_DRIVER;
2724
import static org.apache.gravitino.Configs.ENTITY_RELATIONAL_JDBC_BACKEND_PASSWORD;
2825
import static org.apache.gravitino.Configs.ENTITY_RELATIONAL_JDBC_BACKEND_PATH;
2926
import static org.apache.gravitino.Configs.ENTITY_RELATIONAL_JDBC_BACKEND_URL;
3027
import static org.apache.gravitino.Configs.ENTITY_RELATIONAL_JDBC_BACKEND_USER;
3128
import static org.apache.gravitino.Configs.ENTITY_RELATIONAL_STORE;
32-
import static org.apache.gravitino.Configs.ENTITY_SERDE;
3329
import static org.apache.gravitino.Configs.ENTITY_STORE;
3430
import static org.apache.gravitino.Configs.RELATIONAL_ENTITY_STORE;
3531
import static org.apache.gravitino.Configs.STORE_DELETE_AFTER_TIME;
@@ -53,7 +49,6 @@
5349
import java.util.Map;
5450
import org.apache.commons.io.FileUtils;
5551
import org.apache.gravitino.Config;
56-
import org.apache.gravitino.Configs;
5752
import org.apache.gravitino.EntityStore;
5853
import org.apache.gravitino.EntityStoreFactory;
5954
import org.apache.gravitino.NameIdentifier;
@@ -131,12 +126,6 @@ public PropertiesMetadata modelPropertiesMetadata() throws UnsupportedOperationE
131126
@BeforeAll
132127
public static void setUp() {
133128
Config config = Mockito.mock(Config.class);
134-
Mockito.when(config.get(ENTITY_STORE)).thenReturn("kv");
135-
Mockito.when(config.get(ENTITY_KV_STORE)).thenReturn(DEFAULT_ENTITY_KV_STORE);
136-
Mockito.when(config.get(Configs.ENTITY_SERDE)).thenReturn("proto");
137-
Mockito.when(config.get(ENTITY_KV_ROCKSDB_BACKEND_PATH)).thenReturn(STORE_PATH);
138-
139-
Assertions.assertEquals(STORE_PATH, config.get(ENTITY_KV_ROCKSDB_BACKEND_PATH));
140129
Mockito.when(config.get(STORE_TRANSACTION_MAX_SKEW_TIME)).thenReturn(1000L);
141130
Mockito.when(config.get(STORE_DELETE_AFTER_TIME)).thenReturn(20 * 60 * 1000L);
142131

@@ -156,7 +145,6 @@ public static void setUp() {
156145
when(config.get(VERSION_RETENTION_COUNT)).thenReturn(1L);
157146
when(config.get(STORE_TRANSACTION_MAX_SKEW_TIME)).thenReturn(1000L);
158147
when(config.get(STORE_DELETE_AFTER_TIME)).thenReturn(20 * 60 * 1000L);
159-
when(config.get(ENTITY_SERDE)).thenReturn("proto");
160148

161149
// Mock
162150
MetalakeMetaService metalakeMetaService = MetalakeMetaService.getInstance();

core/build.gradle.kts

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ dependencies {
2626
implementation(project(":api"))
2727
implementation(project(":common"))
2828
implementation(project(":catalogs:catalog-common"))
29-
implementation(project(":meta"))
3029
implementation(libs.bundles.log4j)
3130
implementation(libs.bundles.metrics)
3231
implementation(libs.bundles.prometheus)
@@ -41,7 +40,6 @@ dependencies {
4140
exclude("com.google.guava", "guava")
4241
.because("Brings in Guava for Android, which we don't want (and breaks multimaps).")
4342
}
44-
implementation(libs.rocksdbjni)
4543

4644
annotationProcessor(libs.lombok)
4745

core/src/main/java/org/apache/gravitino/Config.java

-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ public abstract class Config {
4949
// Constant Array to hold all deprecated configuration keys, when a configuration is deprecated,
5050
// we should add it here.
5151
private final DeprecatedConfig[] deprecatedConfigs = {
52-
new DeprecatedConfig(
53-
"gravitino.entity.store.kv.deleteAfterTimeMs",
54-
"0.5.0",
55-
"Please use gravitino.entity.store.deleteAfterTimeMs instead."),
5652
new DeprecatedConfig(
5753
"gravitino.authenticator", "0.6.0", "Please use gravitino.authenticators instead.")
5854
};

core/src/main/java/org/apache/gravitino/Configs.java

+2-59
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,9 @@ public class Configs {
3333

3434
private Configs() {}
3535

36-
public static final String KV_STORE_KEY = "kv";
3736
public static final String RELATIONAL_ENTITY_STORE = "relational";
3837
public static final String ENTITY_STORE_KEY = "gravitino.entity.store";
3938

40-
public static final String DEFAULT_ENTITY_KV_STORE = "RocksDBKvBackend";
41-
public static final String ENTITY_KV_STORE_KEY = "gravitino.entity.store.kv";
42-
4339
public static final String DEFAULT_ENTITY_RELATIONAL_STORE = "JDBCBackend";
4440
public static final String ENTITY_RELATIONAL_STORE_KEY = "gravitino.entity.store.relational";
4541

@@ -55,18 +51,13 @@ private Configs() {}
5551
public static final String ENTITY_RELATIONAL_JDBC_BACKEND_STORAGE_PATH_KEY =
5652
"gravitino.entity.store.relational.storagePath";
5753

58-
public static final String ENTITY_KV_ROCKSDB_BACKEND_PATH_KEY =
59-
"gravitino.entity.store.kv.rocksdbPath";
60-
61-
public static final Long DEFAULT_KV_DELETE_AFTER_TIME = 604800000L; // 7 days
62-
public static final String KV_DELETE_AFTER_TIME_KEY =
63-
"gravitino.entity.store.kv.deleteAfterTimeMs";
54+
public static final Long DEFAULT_DELETE_AFTER_TIME = 604800000L; // 7 days
6455

6556
// Config for data keep time after soft deletion, in milliseconds.
6657
public static final String STORE_DELETE_AFTER_TIME_KEY =
6758
"gravitino.entity.store.deleteAfterTimeMs";
6859
// using the fallback default value
69-
public static final Long DEFAULT_STORE_DELETE_AFTER_TIME = DEFAULT_KV_DELETE_AFTER_TIME;
60+
public static final Long DEFAULT_STORE_DELETE_AFTER_TIME = DEFAULT_DELETE_AFTER_TIME;
7061
// The maximum allowed keep time for data deletion, in milliseconds. Equivalent to 30 days.
7162
public static final Long MAX_DELETE_TIME_ALLOW = 1000 * 60 * 60 * 24 * 30L;
7263
// The minimum allowed keep time for data deletion, in milliseconds. Equivalent to 10 minutes.
@@ -82,10 +73,6 @@ private Configs() {}
8273
// The minimum allowed count of versions to be retained
8374
public static final Long MIN_VERSION_RETENTION_COUNT = 1L;
8475

85-
// Default path for RocksDB backend is "${GRAVITINO_HOME}/data/rocksdb"
86-
public static final String DEFAULT_KV_ROCKSDB_BACKEND_PATH =
87-
String.join(File.separator, System.getenv("GRAVITINO_HOME"), "data", "rocksdb");
88-
8976
public static final String DEFAULT_RELATIONAL_JDBC_BACKEND_PATH =
9077
String.join(File.separator, System.getenv("GRAVITINO_HOME"), "data", "jdbc");
9178

@@ -111,13 +98,6 @@ private Configs() {}
11198
.stringConf()
11299
.createWithDefault(RELATIONAL_ENTITY_STORE);
113100

114-
public static final ConfigEntry<String> ENTITY_KV_STORE =
115-
new ConfigBuilder(ENTITY_KV_STORE_KEY)
116-
.doc("Detailed implementation of Kv storage")
117-
.version(ConfigConstants.VERSION_0_1_0)
118-
.stringConf()
119-
.createWithDefault(DEFAULT_ENTITY_KV_STORE);
120-
121101
public static final ConfigEntry<String> ENTITY_RELATIONAL_STORE =
122102
new ConfigBuilder(ENTITY_RELATIONAL_STORE_KEY)
123103
.doc("Detailed implementation of relational storage")
@@ -168,24 +148,6 @@ private Configs() {}
168148
.stringConf()
169149
.createWithDefault(DEFAULT_RELATIONAL_JDBC_BACKEND_PATH);
170150

171-
public static final ConfigEntry<String> ENTITY_KV_ROCKSDB_BACKEND_PATH =
172-
new ConfigBuilder(ENTITY_KV_ROCKSDB_BACKEND_PATH_KEY)
173-
.doc(
174-
"The storage path for RocksDB storage implementation. It supports both absolute and"
175-
+ " relative path, if the value is a relative path, the final path is "
176-
+ "`${GRAVITINO_HOME}/${PATH_YOU_HAVA_SET}`, default value is "
177-
+ "`${GRAVITINO_HOME}/data/rocksdb`")
178-
.version(ConfigConstants.VERSION_0_1_0)
179-
.stringConf()
180-
.createWithDefault(DEFAULT_KV_ROCKSDB_BACKEND_PATH);
181-
182-
public static final ConfigEntry<String> ENTITY_SERDE =
183-
new ConfigBuilder("gravitino.entity.serde")
184-
.doc("The entity SerDe to use")
185-
.version(ConfigConstants.VERSION_0_1_0)
186-
.stringConf()
187-
.createWithDefault("proto");
188-
189151
public static final ConfigEntry<Long> CATALOG_CACHE_EVICTION_INTERVAL_MS =
190152
new ConfigBuilder("gravitino.catalog.cache.evictionIntervalMs")
191153
.doc("The interval in milliseconds to evict the catalog cache")
@@ -232,24 +194,6 @@ private Configs() {}
232194
.longConf()
233195
.createWithDefault(2000L);
234196

235-
public static final ConfigEntry<Long> KV_DELETE_AFTER_TIME =
236-
new ConfigBuilder(KV_DELETE_AFTER_TIME_KEY)
237-
.doc(
238-
String.format(
239-
"The maximum time in milliseconds that the deleted data and old version data is kept, "
240-
+ "max delete time allow is %s ms(30 days), "
241-
+ "min delete time allow is %s ms(10 minutes)",
242-
MAX_DELETE_TIME_ALLOW, MIN_DELETE_TIME_ALLOW))
243-
.version(ConfigConstants.VERSION_0_5_0)
244-
.deprecated()
245-
.longConf()
246-
.checkValue(
247-
v -> v >= MIN_DELETE_TIME_ALLOW && v <= MAX_DELETE_TIME_ALLOW,
248-
String.format(
249-
"The value of %s is out of range, which must be between %s and %s",
250-
KV_DELETE_AFTER_TIME_KEY, MIN_DELETE_TIME_ALLOW, MAX_DELETE_TIME_ALLOW))
251-
.createWithDefault(DEFAULT_KV_DELETE_AFTER_TIME);
252-
253197
public static final ConfigEntry<Long> STORE_DELETE_AFTER_TIME =
254198
new ConfigBuilder(STORE_DELETE_AFTER_TIME_KEY)
255199
.doc(
@@ -259,7 +203,6 @@ private Configs() {}
259203
+ "min delete time allow is %s ms(10 minutes)",
260204
MAX_DELETE_TIME_ALLOW, MIN_DELETE_TIME_ALLOW))
261205
.version(ConfigConstants.VERSION_0_5_0)
262-
.alternatives(Lists.newArrayList(KV_DELETE_AFTER_TIME_KEY))
263206
.longConf()
264207
.checkValue(
265208
v -> v >= MIN_DELETE_TIME_ALLOW && v <= MAX_DELETE_TIME_ALLOW,

core/src/main/java/org/apache/gravitino/EntitySerDe.java

-68
This file was deleted.

0 commit comments

Comments
 (0)