Merge pull request #292 from apache/revert-273-GORA-698
Revert "[IN-PROGRESS] GORA-698 Geode DataStore"
diff --git a/gora-geode/pom.xml b/gora-geode/pom.xml
deleted file mode 100644
index 420e90c..0000000
--- a/gora-geode/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>gora</artifactId>
- <groupId>org.apache.gora</groupId>
- <version>1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>gora-geode</artifactId>
-
- <properties>
- <maven.compiler.source>8</maven.compiler.source>
- <maven.compiler.target>8</maven.compiler.target>
- </properties>
-
- <dependencies>
- <!-- Gora Internal Dependencies -->
- <dependency>
- <groupId>org.apache.gora</groupId>
- <artifactId>gora-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.gora</groupId>
- <artifactId>gora-core</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.avro</groupId>
- <artifactId>avro</artifactId>
- </dependency>
-
- <!-- Hadoop Dependencies -->
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-client</artifactId>
- </dependency>
-
- <!-- Geode Dependencies -->
- <dependency>
- <groupId>org.apache.geode</groupId>
- <artifactId>geode-core</artifactId>
- </dependency>
-
- <!-- Logging Dependencies -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <exclusions>
- <exclusion>
- <groupId>javax.jms</groupId>
- <artifactId>jms</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- Testing Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-minicluster</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.testcontainers</groupId>
- <artifactId>testcontainers</artifactId>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
\ No newline at end of file
diff --git a/gora-geode/src/main/java/org/apache/gora/geode/query/GeodeQuery.java b/gora-geode/src/main/java/org/apache/gora/geode/query/GeodeQuery.java
deleted file mode 100644
index f6684d5..0000000
--- a/gora-geode/src/main/java/org/apache/gora/geode/query/GeodeQuery.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * 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.gora.geode.query;
-
-import org.apache.gora.persistency.impl.PersistentBase;
-import org.apache.gora.query.impl.QueryBase;
-import org.apache.gora.store.DataStore;
-
-/**
- * {@link GeodeQuery} is the primary class
- * responsible for representing a cache manipulation query.
- */
-public class GeodeQuery<K, T extends PersistentBase> extends QueryBase<K, T> {
-
- public GeodeQuery() {
- super(null);
- }
-
- public GeodeQuery(DataStore<K, T> dataStore) {
- super(dataStore);
- }
-
-}
diff --git a/gora-geode/src/main/java/org/apache/gora/geode/query/GeodeResult.java b/gora-geode/src/main/java/org/apache/gora/geode/query/GeodeResult.java
deleted file mode 100644
index 9583270..0000000
--- a/gora-geode/src/main/java/org/apache/gora/geode/query/GeodeResult.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * 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.gora.geode.query;
-
-import org.apache.gora.geode.store.GeodeStore;
-import org.apache.gora.persistency.impl.PersistentBase;
-import org.apache.gora.query.Query;
-import org.apache.gora.query.impl.ResultBase;
-import org.apache.gora.store.DataStore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.NavigableSet;
-
-/**
- * {@link GeodeResult} is the primary class
- * responsible for representing result set of a cache manipulation query
- * {@link org.apache.gora.geode.query.GeodeQuery}
- */
-public class GeodeResult<K, T extends PersistentBase> extends ResultBase<K, T> {
-
- private static final Logger LOG = LoggerFactory.getLogger(GeodeResult.class);
- private NavigableSet<K> cacheKeySet;
- private Iterator<K> iterator;
- private int current;
-
- public GeodeResult(DataStore<K, T> dataStore, Query<K, T> query) {
- super(dataStore, query);
- }
-
- public GeodeResult(DataStore<K, T> dataStore, Query<K, T> query, NavigableSet<K> cacheKeySet) {
- super(dataStore, query);
- this.cacheKeySet = cacheKeySet;
- this.iterator = cacheKeySet.iterator();
- this.current = 0;
- }
-
- public GeodeStore<K, T> getDataStore() {
- return (GeodeStore<K, T>) super.getDataStore();
- }
-
- @Override
- public float getProgress() throws IOException {
- if (cacheKeySet.size() == 0) {
- return 1;
- }
- return ((float) current / (float) cacheKeySet.size());
- }
-
- @Override
- protected boolean nextInner() throws IOException {
- if (!iterator.hasNext()) {
- return false;
- }
- key = iterator.next();
- LOG.info("Results set pointer is now moved to key {}.", key);
- persistent = dataStore.get(key);
- this.current++;
- return true;
- }
-
- @Override
- public int size() {
- int totalSize = cacheKeySet.size();
- int intLimit = (int) this.limit;
- return intLimit > 0 && totalSize > intLimit ? intLimit : totalSize;
- }
-}
diff --git a/gora-geode/src/main/java/org/apache/gora/geode/store/GeodeStore.java b/gora-geode/src/main/java/org/apache/gora/geode/store/GeodeStore.java
deleted file mode 100644
index 97136c1..0000000
--- a/gora-geode/src/main/java/org/apache/gora/geode/store/GeodeStore.java
+++ /dev/null
@@ -1,200 +0,0 @@
-package org.apache.gora.geode.store;
-
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.cache.RegionFactory;
-import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.client.ClientCache;
-import org.apache.geode.cache.client.ClientCacheFactory;
-import org.apache.gora.geode.query.GeodeQuery;
-import org.apache.gora.geode.query.GeodeResult;
-import org.apache.gora.persistency.impl.PersistentBase;
-import org.apache.gora.query.PartitionQuery;
-import org.apache.gora.query.Query;
-import org.apache.gora.query.Result;
-import org.apache.gora.query.impl.PartitionQueryImpl;
-import org.apache.gora.store.impl.DataStoreBase;
-import org.apache.gora.util.GoraException;
-
-import java.io.IOException;
-import java.util.NavigableSet;
-import java.util.Properties;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.concurrent.ConcurrentSkipListSet;
-
-import static org.apache.geode.cache.RegionShortcut.REPLICATE;
-import static org.apache.gora.geode.store.GeodeStoreParameters.GEODE_USERNAME;
-import static org.apache.gora.geode.store.GeodeStoreParameters.GEODE_SERVER_PORT;
-import static org.apache.gora.geode.store.GeodeStoreParameters.GEODE_SERVER_HOST;
-import static org.apache.gora.geode.store.GeodeStoreParameters.GEODE_PASSWORD;
-import static org.apache.gora.geode.store.GeodeStoreParameters.GEODE_REGION_SHORTCUT;
-import static org.apache.gora.geode.store.GeodeStoreParameters.PREFERRED_SCHEMA_NAME;
-
-
-public class GeodeStore<K, T extends PersistentBase> extends DataStoreBase<K, T> {
-
- private ClientCache clientCache;
- private Region<K, T> region;
- private Properties geodeProperties;
- private CacheFactory cacheFactory;
-
- @Override
- public void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties) throws GoraException {
- super.initialize(keyClass, persistentClass, properties);
- String geodeHostName = (String) properties.get(GEODE_SERVER_HOST);
- int portNumber = Integer.parseInt((String) properties.get(GEODE_SERVER_PORT));
- clientCache = new ClientCacheFactory().addPoolLocator(geodeHostName, portNumber).create();
- String userName = properties.getProperty(GEODE_USERNAME);
- String password = properties.getProperty(GEODE_PASSWORD);
- geodeProperties = properties;
-
- Properties clientProperties = clientCache.getDistributedSystem().getProperties();
- if (userName != null) {
- clientProperties.setProperty("security-username", userName);
- clientProperties.setProperty("security-password", password);
- } else throw new GoraException();
- cacheFactory = new CacheFactory(clientProperties);
- }
-
- @Override
- /*
- Schema Name can be assigned via Property file using @PREFERRED_SCHEMA_NAME, or else PersistentClass name is used as the default schema name.
- */
- public String getSchemaName() {
- String preferredSchemaName = properties.getProperty(PREFERRED_SCHEMA_NAME);
- if (preferredSchemaName == null) {
- return persistentClass.getSimpleName();
- }
- return preferredSchemaName;
- }
-
- @Override
- public void createSchema() throws GoraException {
- try {
- Cache cache = cacheFactory.create();
- String regionShortCut = geodeProperties.getProperty(GEODE_REGION_SHORTCUT);
- RegionFactory<K, T> regionFactory;
- if (regionShortCut != null) {
- regionFactory = cache.createRegionFactory(RegionShortcut.valueOf(regionShortCut));
- } else {
- regionFactory = cache.createRegionFactory(REPLICATE);
- }
- region = regionFactory.create(getSchemaName());
- } catch (Exception e) {
- throw new GoraException(e);
- }
- }
-
- @Override
- public void deleteSchema() {
- region.destroyRegion();
- }
-
- @Override
- public boolean schemaExists() {
- Properties properties = clientCache.getDistributedSystem().getProperties();
- CacheFactory factory = new CacheFactory(properties);
- Cache cache = factory.create();
- Region<K, T> rf = cache.getRegion(getSchemaName());
- return rf != null;
- }
-
- @Override
- public boolean exists(K key) {
- for (K existingKey : region.getInterestList()) {
- if (existingKey.equals(key)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public T get(K key, String[] fields) {
- return region.get(key);
- }
-
- @Override
- public void put(K key, T obj) {
- region.put(key, obj);
- }
-
- @Override
- public boolean delete(K key) {
- region.destroy(key);
- return true;
- }
-
- @Override
- public long deleteByQuery(Query<K, T> query) throws GoraException {
- try {
- long deletedRows = 0;
- Result<K, T> result = query.execute();
- while (result.next()) {
- if (delete(result.getKey())) {
- deletedRows++;
- }
- }
- LOG.info("Geode datastore deleted {} rows from Persistent datastore.", deletedRows);
- return deletedRows;
- } catch (Exception e) {
- throw new GoraException(e);
- }
- }
-
- @Override
- public Result<K, T> execute(Query<K, T> query) {
- K startKey = query.getStartKey();
- K endKey = query.getEndKey();
- NavigableSet<K> cacheEntrySubList = new ConcurrentSkipListSet<>();
- if (startKey != null && endKey != null) {
- boolean isInTheRegion = false;
- for (K key : region.keySet()) {
- if (key == startKey) {
- isInTheRegion = true;
- }
- if (isInTheRegion) {
- cacheEntrySubList.add(key);
- }
- if (key == endKey) {
- break;
- }
- }
- } else {
- // Empty
- cacheEntrySubList = Collections.emptyNavigableSet();
- }
- return new GeodeResult<>(this, query, cacheEntrySubList);
- }
-
-
- @Override
- public Query<K, T> newQuery() {
- GeodeQuery<K, T> query = new GeodeQuery<>(this);
- query.setFields(getFieldsToQuery(null));
- return query;
- }
-
- @Override
- public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query) throws IOException {
- List<PartitionQuery<K, T>> partitions = new ArrayList<>();
- PartitionQueryImpl<K, T> partitionQuery = new PartitionQueryImpl<>(
- query);
- partitionQuery.setConf(this.getConf());
- partitions.add(partitionQuery);
- return partitions;
- }
-
- @Override
- public void flush() {
- LOG.info("Geode datastore flushed successfully.");
- }
-
- @Override
- public void close() {
-
- }
-}
diff --git a/gora-geode/src/main/java/org/apache/gora/geode/store/GeodeStoreParameters.java b/gora-geode/src/main/java/org/apache/gora/geode/store/GeodeStoreParameters.java
deleted file mode 100644
index 138bc29..0000000
--- a/gora-geode/src/main/java/org/apache/gora/geode/store/GeodeStoreParameters.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.gora.geode.store;
-
-/**
- * Configuration Properties.
- */
-public class GeodeStoreParameters {
-
- /**
- * Property pointing to geode server contact points.
- * string (multiple values with comma separated)
- */
- public static final String GEODE_SERVER_HOST = "gora.geode.server.hostname";
-
- /**
- * Property pointing to the port to use to connect to the geode hosts.
- * integer
- */
- public static final String GEODE_SERVER_PORT = "gora.geode.server.port";
-
- /**
- * Property pointing to the gora schemaName.
- * integer
- */
- public static final String PREFERRED_SCHEMA_NAME = "gora.geode.preferred.schemaName";
-
- /**
- * Property pointing to the geode region shortcut.
- * integer
- */
- public static final String GEODE_REGION_SHORTCUT = "gora.geode.region.shortcut";
-
- /**
- * Property pointing to the username to connect to the server.
- * string
- */
- public static final String GEODE_USERNAME = "gora.geode.username";
-
- /**
- * Property pointing to the password to connect to the server.
- * string
- */
- public static final String GEODE_PASSWORD = "gora.geode.password";
-
-}
diff --git a/gora-geode/src/test/conf/gora.properties b/gora-geode/src/test/conf/gora.properties
deleted file mode 100644
index 3e8e111..0000000
--- a/gora-geode/src/test/conf/gora.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-
-gora.datastore.default=org.apache.gora.geode.store.GeodeStore
-gora.datastore.geode.server=localhost
-gora.datastore.geode.port="gora.geode.server.port"
\ No newline at end of file
diff --git a/gora-geode/src/test/java/org/apache/gora/geode/GeodeStartupLogWaitStrategy.java b/gora-geode/src/test/java/org/apache/gora/geode/GeodeStartupLogWaitStrategy.java
deleted file mode 100644
index 67110ba..0000000
--- a/gora-geode/src/test/java/org/apache/gora/geode/GeodeStartupLogWaitStrategy.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.gora.geode;
-
-import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
-
-
-/**
- * Log based Geode server startup wait strategy to sync server
- * startup to test suit startup.
- */
-public class GeodeStartupLogWaitStrategy extends LogMessageWaitStrategy {
-
- private static final String regEx = ".*Apache Geode has started. Time to relax..*";
-
- public GeodeStartupLogWaitStrategy() {
- withRegEx(regEx);
- }
-
-}
\ No newline at end of file
diff --git a/gora-geode/src/test/java/org/apache/gora/geode/GoraGeodeTestDriver.java b/gora-geode/src/test/java/org/apache/gora/geode/GoraGeodeTestDriver.java
deleted file mode 100644
index c11e5c5..0000000
--- a/gora-geode/src/test/java/org/apache/gora/geode/GoraGeodeTestDriver.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.gora.geode;
-
-import org.apache.gora.GoraTestDriver;
-
-import org.apache.gora.geode.store.GeodeStore;
-import org.apache.gora.geode.store.GeodeStoreParameters;
-import org.apache.gora.persistency.Persistent;
-import org.apache.gora.store.DataStore;
-import org.apache.gora.store.DataStoreFactory;
-import org.apache.gora.util.GoraException;
-import org.testcontainers.containers.GenericContainer;
-
-import java.util.Properties;
-
-import static org.apache.gora.geode.store.GeodeStoreParameters.GEODE_SERVER_PORT;
-
-/**
- * Helper class for third party tests using gora-geode backend.
- * @see GoraTestDriver for test specifics.
- * This driver is the base for all test cases that require an Geode server.
- * In this case we use docker container. A docker container is run before tests
- * and it is stopped after tests.
- *
- */
-public class GoraGeodeTestDriver extends GoraTestDriver {
-
- private final GenericContainer GeodeContainer;
- private Properties properties = DataStoreFactory.createProps();
-
- /**
- * Default constructor
- */
- public GoraGeodeTestDriver(GenericContainer GeodeContainer) {
- super(GeodeStore.class);
- this.GeodeContainer = GeodeContainer;
- }
-
- @Override
- public void setUpClass() {
- log.info("Setting up Geode Test Driver");
- properties.put(GeodeStoreParameters.GEODE_SERVER_HOST, GeodeContainer.getContainerIpAddress());
- properties.put(GEODE_SERVER_PORT, GeodeContainer.getMappedPort(10334).toString());
- }
-
- @Override
- public void tearDownClass() {
- log.info("Teardown Geode test driver");
- }
-
- /**
- * Instantiate a new {@link DataStore}. Uses 'null' schema.
- *
- * @param keyClass The key class.
- * @param persistentClass The value class.
- * @return A new store instance.
- * @throws GoraException
- */
- @Override
- public <K, T extends Persistent> DataStore<K, T> createDataStore(Class<K> keyClass, Class<T> persistentClass)
- throws GoraException {
-
- final DataStore<K, T> dataStore = DataStoreFactory
- .createDataStore((Class<? extends DataStore<K, T>>) dataStoreClass, keyClass, persistentClass, conf,
- properties);
- dataStores.add(dataStore);
- log.info("Datastore for {} was added.", persistentClass);
- return dataStore;
- }
-
-}
diff --git a/gora-geode/src/test/java/store/TestGeodeStore.java b/gora-geode/src/test/java/store/TestGeodeStore.java
deleted file mode 100644
index 421a766..0000000
--- a/gora-geode/src/test/java/store/TestGeodeStore.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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 store;
-
-
-
-import org.apache.avro.util.Utf8;
-import org.apache.gora.examples.WebPageDataCreator;
-import org.apache.gora.examples.generated.WebPage;
-import org.apache.gora.geode.GeodeStartupLogWaitStrategy;
-import org.apache.gora.geode.GoraGeodeTestDriver;
-import org.apache.gora.geode.query.GeodeResult;
-import org.apache.gora.query.Query;
-import org.apache.gora.store.DataStoreTestBase;
-import org.apache.gora.util.GoraException;
-import org.junit.ClassRule;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.testcontainers.containers.GenericContainer;
-
-
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.time.Duration;
-
-import static org.junit.Assert.*;
-
-/**
- * Tests extending {@link DataStoreTestBase}
- * which run the base JUnit test suite for Gora.
- */
-public class TestGeodeStore extends DataStoreTestBase {
-
- private static final String DOCKER_CONTAINER_NAME = "apachegeode/" +
- "" +
- "geode:1.15.0";
-
- /**
- * JUnit integration testing with Docker and Testcontainers
- */
- @ClassRule
- public static GenericContainer Geode_CONTAINER = new GenericContainer(DOCKER_CONTAINER_NAME)
- .withExposedPorts(10334)
- .waitingFor(new GeodeStartupLogWaitStrategy())
- .withStartupTimeout(Duration.ofSeconds(300));
-
-
- // void withCommand("tail","-f","/dev/null").start();
-
- // geode = new GenericContainer<>("apachegeode/geode:1.12.0");
-
-
- static {
- try {
- setTestDriver(new GoraGeodeTestDriver(Geode_CONTAINER));
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
- @Test
- public void testPutAndGet() throws GoraException {
- WebPage page = webPageStore.newPersistent();
-
- // Write webpage data
- page.setUrl(new Utf8("http://example.com"));
- byte[] contentBytes = "example content in example.com".getBytes(Charset.defaultCharset());
- ByteBuffer buff = ByteBuffer.wrap(contentBytes);
- page.setContent(buff);
- webPageStore.put("com.example/http", page);
- webPageStore.flush();
-
- WebPage storedPage = webPageStore.get("com.example/http");
-
- assertNotNull(storedPage);
- assertEquals(page.getUrl(), storedPage.getUrl());
- }
-
- @Test
- public void testCreateAndDeleteSchema() throws IOException {
- WebPage page = webPageStore.newPersistent();
-
- // Write webpage data
- page.setUrl(new Utf8("http://example.com"));
- webPageStore.put("com.example/http", page);
- webPageStore.flush();
-
- assertEquals("WebPage isn't created.", page.getUrl(), webPageStore.get("com.example/http").getUrl());
-
- webPageStore.deleteSchema();
-
- assertNull(webPageStore.get("com.example/http"));
- }
-
- @Test
- public void testGetSchemaName() throws IOException {
- assertEquals("WebPage", webPageStore.getSchemaName());
- assertEquals("Employee", employeeStore.getSchemaName());
- }
-
- @Test
- public void testExecute() throws IOException {
- WebPageDataCreator.createWebPageData(webPageStore);
-
- final Query<String, WebPage> query = webPageStore.newQuery();
-
- int limit = 5;
- query.setLimit(limit);
- GeodeResult<String, WebPage> result = (GeodeResult<String, WebPage>) webPageStore.execute(query);
- assertEquals(limit, result.size());
-
- limit = 10;
- query.setLimit(limit);
- result = (GeodeResult<String, WebPage>) webPageStore.execute(query);
- assertEquals(limit, result.size());
-
- }
-
- /**
- * By design, you cannot update a Geode document blindly, you can only attempt to update a specific revision of a document. FIXME
- */
- @Test
- @Ignore
- public void testUpdate() throws Exception {
- //By design, you cannot update a Geode document blindly, you can only attempt to update a specific revision of a document. FIXME
- }
-
- @Ignore("GeodeStore doesn't support 3 types union field yet")
- @Override
- public void testGet3UnionField() throws Exception {
- // GeodeStore doesn't support 3 types union field yet
- }
-
- @Ignore("Skip until GORA-66 is fixed: need better semantic for end/start keys")
- @Override
- public void testDeleteByQueryFields() throws IOException {
- // Skip until GORA-66 is fixed: need better semantic for end/start keys
- }
-
-}
diff --git a/pom.xml b/pom.xml
index ab2244e..5dc91ea 100755
--- a/pom.xml
+++ b/pom.xml
@@ -780,7 +780,6 @@
<module>gora-arangodb</module>
<module>gora-rethinkdb</module>
<module>gora-elasticsearch</module>
- <module>gora-geode</module>
<module>gora-tutorial</module>
<module>gora-benchmark</module>
<module>sources-dist</module>
@@ -1640,13 +1639,6 @@
<version>2.0.10</version>
</dependency>
- <!-- Geode Dependencies -->
- <dependency>
- <groupId>org.apache.geode</groupId>
- <artifactId>geode-core</artifactId>
- <version>1.15.0</version>
- </dependency>
-
<!-- Amazon Dependencies -->
<dependency>
<groupId>com.amazonaws</groupId>