fredia commented on code in PR #24682: URL: https://github.com/apache/flink/pull/24682#discussion_r1577638164
########## flink-state-backends/flink-statebackend-forst/src/test/java/org/apache/flink/state/forst/ForStMultiClassLoaderTest.java: ########## @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.state.forst; + +import org.apache.flink.util.FlinkUserCodeClassLoaders; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.rocksdb.RocksDB; + +import java.lang.reflect.Method; +import java.net.URL; + +import static org.apache.flink.util.FlinkUserCodeClassLoader.NOOP_EXCEPTION_HANDLER; +import static org.junit.Assert.assertNotEquals; + +/** + * This test validates that the ForSt JNI library loading works properly in the presence of the + * ForSt code being loaded dynamically via reflection. That can happen when ForSt is in the user + * code JAR, or in certain test setups. + */ +public class ForStMultiClassLoaderTest { + + @Rule public final TemporaryFolder tmp = new TemporaryFolder(); + + @Test + public void testTwoSeparateClassLoaders() throws Exception { + // collect the libraries / class folders with RocksDB related code: the state backend and + // RocksDB itself Review Comment: How about adding a TODO that tests loading RocksDB and ForSt at the same time. ########## flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/restore/ForStRestoreOperation.java: ########## @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.state.forst.restore; + +import org.apache.flink.annotation.Internal; +import org.apache.flink.runtime.state.RestoreOperation; + +/** Interface for ForSt restore. */ +@Internal +public interface ForStRestoreOperation extends RestoreOperation<ForStRestoreResult>, AutoCloseable { Review Comment: Does the restore-related component need to be introduced in the first PR? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
