Search code examples
hbasegeoserverdatastoretablenamegeomesa

Error in table names geomesa-hbase/geoserver


I am developing a geoserver with geomesa hbase, but when I create a new data store, I have some problems in the bigtable.table.name.

The problem is that the name of all my tables is like this 'published.cityos.fonts', but when I save the store throw me an error like this

Error creating data store, check the parameters. Error message: String index out of range: -1

I duplicated a table to do a test and named like this 'cityos.fonts' and I do not get any error.

Is it possible to solve the problem without having to duplicate and rename 100 tables?

Thank you very much in advance.

Error in console:

WARN [data.store] - Error obtaining new data store java.io.IOExceptionç Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(Unknown Source) at org.locationtech.geomesa.index.metadata.CachedLazyMetadata$.decodeRow(CachedLazyMetadata.scala:137) at org.locationtech.geomesa.index.metadata.CachedLazyMetadata$$anonfun$getFeatureTypes$1.apply(CachedLazyMetadata.scala:57) at org.locationtech.geomesa.index.metadata.CachedLazyMetadata$$anonfun$getFeatureTypes$1.apply(CachedLazyMetadata.scala:57) at scala.collection.Iterator$$anon$11.next(Iterator.scala:370) at org.locationtech.geomesa.utils.collection.CloseableIterator$$anon$2.next(CloseableIterator.scala:36) at scala.collection.Iterator$class.toStream(Iterator.scala:1180) at org.locationtech.geomesa.utils.collection.CloseableIterator$$anon$2.toStream(CloseableIterator.scala:34) at scala.collection.TraversableOnce$class.toSeq(TraversableOnce.scala:296) at org.locationtech.geomesa.utils.collection.CloseableIterator$$anon$2.toSeq(CloseableIterator.scala:34) at org.locationtech.geomesa.index.metadata.CachedLazyMetadata$class.getFeatureTypes(CachedLazyMetadata.scala:57) at org.locationtech.geomesa.hbase.data.HBaseBackedMetadata.getFeatureTypes(HBaseBackedMetadata.scala:19) at org.locationtech.geomesa.index.geotools.GeoMesaDataStore.getTypeNames(GeoMesaDataStore.scala:137) at org.vfny.geoserver.util.DataStoreUtils.getDataAccess(DataStoreUtils.java:97) at org.geoserver.catalog.ResourcePool.getDataStore(ResourcePool.java:649)


Solution

  • I think that the issue it not due to the table names, but due to the extra data in the first table. GeoMesa expects the catalog table to only contain simple feature type metadata. To determine the simple feature types in a given catalog, GeoMesa scans the table and uses a regex to pull out the type name from the row values. For example, abastament_agbarType~attributes indicates the type name is abastament_agbarType. The original table appears to have a lot of non-GeoMesa rows, which is causing the row regex to fail.

    I created a ticket to track the issue here. We can add a try/catch and log a warning on invalid rows. However, even with that fix, having lots of data in the catalog will make getTypeNames very slow, so if possible you should avoid it.