Skip to content

Commit

Permalink
Trying out keywords to report the indexes.
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Hughes <jhughes@ccri.com>
  • Loading branch information
Jim Hughes committed Apr 22, 2021
1 parent 706ae0c commit 8393e4e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ geospatial analytics.
**Current release: [3.2.0](https://github.com/locationtech/geomesa/releases/tag/geomesa-3.2.0)**

&nbsp;&nbsp;&nbsp;&nbsp;
[**HBase**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-hbase_2.12-3.2.0-bin.tar.gz) |
[**Accumulo**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-accumulo_2.12-3.2.0-bin.tar.gz) |
[**Cassandra**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-cassandra_2.12-3.2.0-bin.tar.gz) |
[**Kafka**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-kafka_2.12-3.2.0-bin.tar.gz) |
[**Redis**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-redis_2.12-3.2.0-bin.tar.gz) |
[**FileSystem**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-fs_2.12-3.2.0-bin.tar.gz) |
[**Bigtable**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-bigtable_2.12-3.2.0-bin.tar.gz)
[**HBase**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-hbase_2.11-3.2.0-bin.tar.gz) |
[**Accumulo**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-accumulo_2.11-3.2.0-bin.tar.gz) |
[**Cassandra**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-cassandra_2.11-3.2.0-bin.tar.gz) |
[**Kafka**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-kafka_2.11-3.2.0-bin.tar.gz) |
[**Redis**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-redis_2.11-3.2.0-bin.tar.gz) |
[**FileSystem**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-fs_2.11-3.2.0-bin.tar.gz) |
[**Bigtable**](https://github.com/locationtech/geomesa/releases/download/geomesa-3.2.0/geomesa-bigtable_2.11-3.2.0-bin.tar.gz)

### Verifying Downloads

Expand All @@ -60,7 +60,7 @@ $ gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys CD24F317
Then verify the file:

```bash
$ gpg2 --verify geomesa-accumulo_2.12-3.2.0-bin.tar.gz.asc geomesa-accumulo_2.12-3.2.0-bin.tar.gz
$ gpg2 --verify geomesa-accumulo_2.11-3.2.0-bin.tar.gz.asc geomesa-accumulo_2.11-3.2.0-bin.tar.gz
```

The keys currently used for signing are:
Expand Down Expand Up @@ -97,7 +97,7 @@ You may then include the desired `geomesa-*` dependencies, for example:
```xml
<dependency>
<groupId>org.locationtech.geomesa</groupId>
<artifactId>geomesa-utils_2.12</artifactId>
<artifactId>geomesa-utils_2.11</artifactId>
<version>3.2.0</version>
</dependency>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
package org.locationtech.geomesa.accumulo.data

import com.typesafe.config.ConfigFactory
import org.junit.runner.RunWith
import org.locationtech.geomesa.accumulo.TestWithMultipleSfts
import org.locationtech.geomesa.utils.geotools.RichSimpleFeatureType.RichSimpleFeatureType
import org.locationtech.geomesa.utils.geotools.SimpleFeatureTypes
import org.specs2.runner.JUnitRunner

import scala.collection.JavaConversions._

@RunWith(classOf[JUnitRunner])
class AccumuloDataStoreKeywordsTest extends TestWithMultipleSfts {

"AccumuloDataStore" should {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.locationtech.jts.geom._
import org.opengis.feature.`type`.AttributeDescriptor
import org.opengis.feature.simple.{SimpleFeature, SimpleFeatureType}

import scala.collection.JavaConverters.asScalaBufferConverter
import scala.reflect.ClassTag
import scala.util.Try

Expand Down Expand Up @@ -328,8 +329,14 @@ object RichSimpleFeatureType extends Conversions {

def getRemoteVersion: Option[SemanticVersion] = userData[String](RemoteVersion).map(SemanticVersion.apply)

def getKeywords: Set[String] =
userData[String](Keywords).map(_.split(KeywordsDelimiter).toSet).getOrElse(Set.empty)
def getKeywords: Set[String] = {
val foo: Set[String] = getIndices.flatMap(_.attributes).toSet
val extraKeyword: Set[String] = if (foo.nonEmpty) {
Set(s"geomesa.indices=${foo.mkString(",")}")
} else { Set() }
sft.getAttributeDescriptors.asScala.foreach{_.getType}
userData[String](Keywords).map(_.split(KeywordsDelimiter).toSet).getOrElse(Set.empty).union(extraKeyword)
}

def addKeywords(keywords: Set[String]): Unit =
sft.getUserData.put(Keywords, getKeywords.union(keywords).mkString(KeywordsDelimiter))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ object SimpleFeatureSpec {
*/
def toDescriptor: AttributeDescriptor = {
val builder = new AttributeTypeBuilder().binding(clazz)
builder.setDescription("GeoMesa Description!")
descriptorOptions.foreach { case (k, v) => builder.userData(k, v) }
builderHook(builder)
builder.buildDescriptor(name)
Expand Down

0 comments on commit 8393e4e

Please sign in to comment.