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

    https://github.com/apache/incubator-rya/pull/182#discussion_r129997867
  
    --- 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 agree.  A factory seems like a better pattern, it seems like we could be 
doing something more elegant 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to