Repository: gora Updated Branches: refs/heads/master d5e5560ba -> 7a56d2484
Add initial gora-aerospike module Project: http://git-wip-us.apache.org/repos/asf/gora/repo Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/e796c8c5 Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/e796c8c5 Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/e796c8c5 Branch: refs/heads/master Commit: e796c8c511463cefdb6da785baf9373d19795995 Parents: 1b20b10 Author: nishadi <ndime...@gmail.com> Authored: Thu Jun 8 21:03:29 2017 +0530 Committer: nishadi <ndime...@gmail.com> Committed: Thu Jun 8 21:03:29 2017 +0530 ---------------------------------------------------------------------- gora-aerospike/pom.xml | 141 +++++++++++++++++++ .../org/apache/gora/aerospike/package-info.java | 20 +++ .../gora/aerospike/store/AerospikeStore.java | 110 +++++++++++++++ .../gora/aerospike/store/package-info.java | 20 +++ pom.xml | 7 + 5 files changed, 298 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/gora/blob/e796c8c5/gora-aerospike/pom.xml ---------------------------------------------------------------------- diff --git a/gora-aerospike/pom.xml b/gora-aerospike/pom.xml new file mode 100644 index 0000000..1a557f4 --- /dev/null +++ b/gora-aerospike/pom.xml @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<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"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.gora</groupId> + <artifactId>gora</artifactId> + <version>0.8-SNAPSHOT</version> + <relativePath>../</relativePath> + </parent> + <artifactId>gora-aerospike</artifactId> + <packaging>bundle</packaging> + + <name>Apache Gora :: Aerospike</name> + <url>http://gora.apache.org</url> + <description>The Apache Gora open source framework provides an in-memory data model and + persistence for big data. Gora supports persisting to column stores, key value stores, + document stores and RDBMSs, and analyzing the data with extensive Apache Hadoop MapReduce + support.</description> + <inceptionYear>2010</inceptionYear> + <organization> + <name>The Apache Software Foundation</name> + <url>http://www.apache.org/</url> + </organization> + <issueManagement> + <system>JIRA</system> + <url>https://issues.apache.org/jira/browse/GORA</url> + </issueManagement> + <ciManagement> + <system>Jenkins</system> + <url>https://builds.apache.org/job/Gora-trunk/</url> + </ciManagement> + + <properties> + <aerospike.version>3.3.2</aerospike.version> + <osgi.import>*</osgi.import> + <osgi.export>org.apache.gora.aerospike*;version="${project.version}";-noimport:=true</osgi.export> + </properties> + + <build> + <directory>target</directory> + <outputDirectory>target/classes</outputDirectory> + <finalName>${project.artifactId}-${project.version}</finalName> + <testOutputDirectory>target/test-classes</testOutputDirectory> + <testSourceDirectory>src/test/java</testSourceDirectory> + <sourceDirectory>src/main/java</sourceDirectory> + <testResources> + <testResource> + <directory>${project.basedir}/src/test/resources</directory> + <includes> + <include>**/*</include> + </includes> + </testResource> + </testResources> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>${build-helper-maven-plugin.version}</version> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>src/examples/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <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> + + <!--Aerospike Dependency --> + <dependency> + <groupId>com.aerospike</groupId> + <artifactId>aerospike-client</artifactId> + <version>${aerospike.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.avro</groupId> + <artifactId>avro</artifactId> + </dependency> + + <!-- Hadoop Dependencies --> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-client</artifactId> + </dependency> + + <!-- Logging Dependencies --> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </dependency> + + <!-- Testing Dependencies --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> + + </dependencies> + +</project> http://git-wip-us.apache.org/repos/asf/gora/blob/e796c8c5/gora-aerospike/src/main/java/org/apache/gora/aerospike/package-info.java ---------------------------------------------------------------------- diff --git a/gora-aerospike/src/main/java/org/apache/gora/aerospike/package-info.java b/gora-aerospike/src/main/java/org/apache/gora/aerospike/package-info.java new file mode 100644 index 0000000..0dbf8dd --- /dev/null +++ b/gora-aerospike/src/main/java/org/apache/gora/aerospike/package-info.java @@ -0,0 +1,20 @@ +/** + * 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. + */ +/** + * This package contains Aerospike datastore related all classes. + */ +package org.apache.gora.aerospike; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/gora/blob/e796c8c5/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java ---------------------------------------------------------------------- diff --git a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java new file mode 100644 index 0000000..8c31773 --- /dev/null +++ b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java @@ -0,0 +1,110 @@ +/** + * 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.aerospike.store; + +import java.io.IOException; +import java.util.List; +import java.util.Properties; + +import com.aerospike.client.*; +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.store.DataStoreFactory; +import org.apache.gora.store.impl.DataStoreBase; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +/** + * Implementation of a Aerospike data store to be used by gora. + * + * @param <K> + * class to be used for the key + * @param <T> + * class to be persisted within the store + */ +public class AerospikeStore<K,T extends PersistentBase> extends DataStoreBase<K,T> { + + public static final Logger LOG = LoggerFactory.getLogger(AerospikeStore.class); + + private AerospikeClient aerospikeClient; + + @Override + public void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties) { + super.initialize(keyClass, persistentClass, properties); + } + + @Override + public String getSchemaName() { + return null; + } + + @Override + public void createSchema() { + } + + @Override + public void deleteSchema() { + } + + @Override + public boolean schemaExists() { + return true; + } + + @Override + public T get(K key, String[] fields) { + return null; + } + + @Override + public void put(K key, T val) { + } + + @Override + public boolean delete(K key) { + return true; + } + + @Override + public long deleteByQuery(Query<K,T> query) { + return 0; + } + + @Override + public Result<K,T> execute(Query<K,T> query) { + return null; + } + + @Override + public Query<K,T> newQuery() { + return null; + } + + @Override + public List<PartitionQuery<K,T>> getPartitions(Query<K,T> query) throws IOException { + return null; + } + + public void flush() { + } + + @Override + public void close() { + aerospikeClient.close(); + } +} http://git-wip-us.apache.org/repos/asf/gora/blob/e796c8c5/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/package-info.java ---------------------------------------------------------------------- diff --git a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/package-info.java b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/package-info.java new file mode 100644 index 0000000..e92fa51 --- /dev/null +++ b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/package-info.java @@ -0,0 +1,20 @@ +/** + * 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. + */ +/** + * This package contains all the Aerospike store related classes. + */ +package org.apache.gora.aerospike.store; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/gora/blob/e796c8c5/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index f3f3058..618cda1 100644 --- a/pom.xml +++ b/pom.xml @@ -733,6 +733,7 @@ <module>gora-solr-5</module> <module>gora-tutorial</module> <module>sources-dist</module> + <module>gora-aerospike</module> </modules> <properties> @@ -764,6 +765,7 @@ <restlet.version>2.3.1</restlet.version> <spark.version>1.4.1</spark.version> + <aerospike.version>3.3.2</aerospike.version> <!-- Misc Dependencies --> <guava.version>13.0</guava.version> <commons-lang.version>2.6</commons-lang.version> @@ -935,6 +937,11 @@ <version>${project.version}</version> <type>test-jar</type> </dependency> + <dependency> + <groupId>org.apache.gora</groupId> + <artifactId>gora-aerospike</artifactId> + <version>${project.version}</version> + </dependency> <!-- End of Internal Depednecies --> <dependency>