Github user isper3at commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/182#discussion_r129452909
  
    --- Diff: 
extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoIndexerType.java
 ---
    @@ -31,31 +28,49 @@
         /**
          * Geo Mesa based indexer.
          */
    -    GEO_MESA(GeoMesaGeoIndexer.class),
    +    GEO_MESA("org.apache.rya.indexing.accumulo.geo.GeoMesaGeoIndexer"),
         /**
          * Geo Wave based indexer.
          */
    -    GEO_WAVE(GeoWaveGeoIndexer.class),
    +    GEO_WAVE("org.apache.rya.indexing.accumulo.geo.GeoWaveGeoIndexer"),
         /**
          * MongoDB based indexer.
          */
    -    MONGO_DB(MongoGeoIndexer.class);
    +    MONGO_DB("org.apache.rya.indexing.mongodb.geo.MongoGeoIndexer"),
    +   
    +   
MONGO_GEO_TEMPORAL("org.apache.rya.indexing.geotemporal.mongo.MongoGeoTemporalIndexer"),
    +   
MONGO_GEO_TEMPORAL_OPTIMIZER("org.apache.rya.indexing.geotemporal.GeoTemporalOptimizer");
     
    -    private Class<? extends GeoIndexer> geoIndexerClass;
    +    //private Class<? extends GeoIndexer> geoIndexerClass;
    +   private String geoIndexerClassString;
     
         /**
          * Creates a new {@link GeoIndexerType}.
          * @param geoIndexerClass the {@link GeoIndexer} {@link Class}.
          * (not {@code null})
          */
    -    private GeoIndexerType(final Class<? extends GeoIndexer> 
geoIndexerClass) {
    -        this.geoIndexerClass = checkNotNull(geoIndexerClass);
    +    private GeoIndexerType(final String geoIndexerClassString) {
    +        this.geoIndexerClassString = checkNotNull(geoIndexerClassString);
         }
     
         /**
          * @return the {@link GeoIndexer} {@link Class}. (not {@code null})
          */
    -    public Class<? extends GeoIndexer> getGeoIndexerClass() {
    -        return geoIndexerClass;
    -    }
    +    public String getGeoIndexerClassString() {
    +           
    +        return geoIndexerClassString;
    +   }
    +
    +   /**
    +     * @return True if the class exists on the classpath.
    +     */
    +   public boolean isOnClassPath() {
    +           try {
    +                   Class.forName(geoIndexerClassString, false, 
this.getClass().getClassLoader());
    --- End diff --
    
    I have serious concerns about using this.  exception handling shouldn't be 
used as a conditional checker, and ideally this should be done by another class 
that uses the config option based on the enum to just instantiate the geo 
indexer.  A factory should be used here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to