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

    https://github.com/apache/incubator-rya/pull/172#discussion_r159936556
  
    --- Diff: 
extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/pcj/PcjIndexer.java
 ---
    @@ -0,0 +1,38 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.rya.indexing.mongodb.pcj;
    +
    +import org.apache.hadoop.conf.Configuration;
    +import org.apache.rya.api.persist.index.RyaSecondaryIndexer;
    +import org.apache.rya.indexing.pcj.storage.mongo.MongoPcjDocuments;
    +
    +import edu.umd.cs.findbugs.annotations.Nullable;
    +
    +/**
    + * Updates the PCJs that are in a {@link MongoPcjDocuments}.
    + */
    +public interface PcjIndexer extends RyaSecondaryIndexer {
    +    /**
    +     * Creates the {@link MongoPcjDocuments} that will be used by the 
indexer.
    +     *
    +     * @param conf - Indicates how the {@link MongoPcjDocuments} is 
initialized. (not null)
    +     * @return The {@link MongoPcjDocuments} that will be used by this 
indexer.
    +     */
    +    public @Nullable MongoPcjDocuments getPcjStorage(Configuration conf);
    --- End diff --
    
    Seems like the primary purpose of this class is to parse the config object 
to create the MongoPcjDocuments object.  I don't think that this functionality 
should be lumped in with the role of the Indexer.  In the case of PCJs, the 
primary role of the indexer is to route statements to the updater service, 
which then routes Bindingset results to Kafka, Mongo, Accumulo, etc for use 
with PCJs.  You are primarily creating and using the indexer for the purpose of 
parsing the config object to create the MongoPcjDocuments object.  You are not 
using it for its primary purpose, which is confusing.  Also, you are adding a 
Mongo specific method to a very general indexing interface and not indicating 
that the extension is Mongo specific.  This is also very misleading.  I think 
all of this would be much cleaner if you separated the parsing of 
config/creation of MongoPcjDocuments from the indexing API.  By combining them 
you are abusing established patterns of usage.


---

Reply via email to