This is an automated email from the ASF dual-hosted git repository.

gaojun2048 pushed a commit to branch st-engine
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git


The following commit(s) were added to refs/heads/st-engine by this push:
     new af4171666 [Engine][Feature] Add Imap persistence (#2738)
af4171666 is described below

commit af417166618ca2d806be1efac2a756f47ec7478c
Author: ic4y <[email protected]>
AuthorDate: Thu Sep 15 18:45:03 2022 +0800

    [Engine][Feature] Add Imap persistence (#2738)
---
 .../src/main/resources/hazelcast.yaml              |  8 +++
 .../engine/server/persistence/FileMapStore.java    | 74 ++++++++++++++++++++++
 2 files changed, 82 insertions(+)

diff --git 
a/seatunnel-engine/seatunnel-engine-common/src/main/resources/hazelcast.yaml 
b/seatunnel-engine/seatunnel-engine-common/src/main/resources/hazelcast.yaml
index 885326b00..21f4d544d 100644
--- a/seatunnel-engine/seatunnel-engine-common/src/main/resources/hazelcast.yaml
+++ b/seatunnel-engine/seatunnel-engine-common/src/main/resources/hazelcast.yaml
@@ -27,3 +27,11 @@ hazelcast:
       auto-increment: true
       port-count: 100
       port: 5801
+  map:
+    map-name-template:
+      map-store:
+        enabled: true
+        initial-mode: EAGER
+        class-name: org.apache.seatunnel.engine.server.persistence.FileMapStore
+        properties:
+          path: /tmp/file-store-map
\ No newline at end of file
diff --git 
a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/persistence/FileMapStore.java
 
b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/persistence/FileMapStore.java
new file mode 100644
index 000000000..f18c33de0
--- /dev/null
+++ 
b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/persistence/FileMapStore.java
@@ -0,0 +1,74 @@
+/*
+ * 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.seatunnel.engine.server.persistence;
+
+import com.hazelcast.core.HazelcastInstance;
+import com.hazelcast.map.MapLoaderLifecycleSupport;
+import com.hazelcast.map.MapStore;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Properties;
+
+public class FileMapStore implements MapStore<Object, Object>, 
MapLoaderLifecycleSupport {
+    //TODO Wait for the file Kv storage development to complete
+
+    @Override
+    public void init(HazelcastInstance hazelcastInstance, Properties 
properties, String mapName) {
+    }
+
+    @Override
+    public void destroy() {
+
+    }
+
+    @Override
+    public void store(Object key, Object value) {
+    }
+
+    @Override
+    public void storeAll(Map<Object, Object> map) {
+
+    }
+
+    @Override
+    public void delete(Object key) {
+
+    }
+
+    @Override
+    public void deleteAll(Collection<Object> keys) {
+
+    }
+
+    @Override
+    public String load(Object key) {
+        return null;
+    }
+
+    @Override
+    public Map<Object, Object> loadAll(Collection<Object> keys) {
+        return null;
+    }
+
+    @Override
+    public Iterable<Object> loadAllKeys() {
+        return null;
+    }
+
+}

Reply via email to