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

    https://github.com/apache/incubator-rya/pull/213#discussion_r135110434
  
    --- Diff: 
extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreateFluoPcj.java
 ---
    @@ -128,60 +131,92 @@ public CreateFluoPcj(final int spInsertBatchSize, 
final int joinBatchSize) {
         /**
          * Tells the Fluo PCJ Updater application to maintain a new PCJ. This 
method
          * creates the FluoQuery (metadata) inside of Fluo so that results can 
be incrementally generated
    -     * inside of Fluo.  This method assumes that the user will export the 
results to Kafka or
    -     * some other external resource.  The export id is equivalent to the 
queryId that is returned,
    -     * which is in contrast to the other createPcj methods in this class 
which accept an external pcjId
    -     * that is used to identify the Accumulo table or Kafka topic for 
exporting results.
    +     * inside of Fluo.  This method assumes that the user will export the 
results to Kafka 
    +     * according to the Kafka {@link ExportStrategy}.  
          *
          * @param sparql - sparql query String to be registered with Fluo
    +     * @param strategies - ExportStrategies used to specify how final 
results will be handled
          * @param fluo - A connection to the Fluo application that updates the 
PCJ index. (not null)
          * @return The metadata that was written to the Fluo application for 
the PCJ.
          * @throws MalformedQueryException The SPARQL query stored for the 
{@code pcjId} is malformed.
    +     * @throws UnsupportedQueryException 
          * @throws PcjException The PCJ Metadata for {@code pcjId} could not 
be read from {@code pcjStorage}.
          */
    -    public FluoQuery createPcj(String sparql, FluoClient fluo) throws 
MalformedQueryException {
    +    public FluoQuery createPcj(String sparql, FluoClient fluo) throws 
MalformedQueryException, UnsupportedQueryException {
             Preconditions.checkNotNull(sparql);
             Preconditions.checkNotNull(fluo);
             
    -        String pcjId = UUID.randomUUID().toString().replaceAll("-", "");
    -        return createPcj(pcjId, sparql, fluo);
    +        String pcjId = FluoQueryUtils.createNewPcjId();
    +        return createPcj(pcjId, sparql, 
Sets.newHashSet(ExportStrategy.Kafka), fluo);
         }
         
         /**
          * Tells the Fluo PCJ Updater application to maintain a new PCJ.  This 
method provides
          * no guarantees that a PCJ with the given pcjId exists outside of 
Fluo. This method merely
    -     * creates the FluoQuery (metadata) inside of Fluo so that results and 
be incrementally generated
    -     * inside of Fluo.  This method assumes that the user will export the 
results to Kafka or
    -     * some other external resource.
    +     * creates the FluoQuery (metadata) inside of Fluo so that results can 
be incrementally generated
    +     * inside of Fluo.  Results are exported according to the Set of 
{@link ExportStrategy} enums.  If
    +     * the Rya ExportStrategy is specified, care should be taken to verify 
that the PCJ table exists.
          *
          * @param pcjId - Identifies the PCJ that will be updated by the Fluo 
app. (not null)
          * @param sparql - sparql query String to be registered with Fluo
    +     * @param strategy - ExportStrategies used to specify how final 
results will be handled
          * @param fluo - A connection to the Fluo application that updates the 
PCJ index. (not null)
          * @return The metadata that was written to the Fluo application for 
the PCJ.
    +     * @throws UnsupportedQueryException 
          * @throws PcjException The PCJ Metadata for {@code pcjId} could not 
be read from {@code pcjStorage}.
          */
         public FluoQuery createPcj(
    --- End diff --
    
    done.


---
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