Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-users] Invalid method name: 'beginFateOperation' when creating a table

Hi Luca,

You raise a good point. We do all of our development in scala, which doesn't have typed exceptions, so we sometimes lose sight of what exceptions are appropriate. However, in this particular case, I would think some type of runtime exception would be appropriate - maybe a NullPointerException since the value was null or an IllegalArgumentException since the feature type does not exist. I would think IOException would be reserved for when something goes wrong with e.g. our connection to accumulo. Maybe others on the list can chime in with what they would expect.

For your particular use case, you can call getSchema(featureName), which will return null if the feature has not been created, as per the DataStore interface.

Thanks,

Emilio

On 03/25/2015 01:08 AM, Luca Morandini wrote:
On 24/03/15 23:21, Emilio Lahr-Vivaz wrote:
Hi Luca,

It definitely seems like a classpath issue. It appears from the stack trace that
you have an accumulo 1.6 jar on your classpath somewhere.

Indeed I had a wrong property in my POM, thanks for the quick reply.

Bear with me, for I have another issue:

I wanted to check the existence of a table before creating it; therefore, I added this line: SimpleFeatureSource featureSource = dataStore.getFeatureSource(options
        .get(ftName));

To my surprise, an RTE was raised:
Exception in thread "main" java.lang.RuntimeException: Feature 'null' has not been initialized. Please call 'createSchema' first.

I looked in the GeoMesa source code, and found this in AccumuloDataStore.scala:
protected def validateMetadata(featureName: String): Unit = {
    metadata.read(featureName, ATTRIBUTES_KEY)
.getOrElse(throw new RuntimeException(s"Feature '$featureName' has not been initialized. Please call 'createSchema' first."))

Well, must it really be an RTE ? Should not a missing featureSource be a recoverable exception (such as IOException), hence forced to be declared in the calling methods/functions ?

Regards,

Luca Morandini
Data Architect - AURIN project
Melbourne eResearch Group
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini
_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
http://www.locationtech.org/mailman/listinfo/geomesa-users



Back to the top