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

    https://github.com/apache/incubator-rya/pull/220#discussion_r136431435
  
    --- Diff: 
extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/ListFluoQueries.java
 ---
    @@ -0,0 +1,149 @@
    +/*
    + * 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.pcj.fluo.api;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +import java.util.Set;
    +
    +import org.apache.fluo.api.client.FluoClient;
    +import org.apache.fluo.api.client.Snapshot;
    +import org.apache.rya.api.client.CreatePCJ.ExportStrategy;
    +import org.apache.rya.api.client.CreatePCJ.QueryType;
    +import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryMetadataDAO;
    +import org.apache.rya.indexing.pcj.fluo.app.query.QueryMetadata;
    +import org.openrdf.query.parser.ParsedQuery;
    +import org.openrdf.query.parser.sparql.SPARQLParser;
    +import org.openrdf.queryrender.sparql.SPARQLQueryRenderer;
    +
    +import com.google.common.base.Preconditions;
    +
    +/**
    + * Class for retrieving a List containing a String representation of each 
query maintained by Fluo.
    + *
    + */
    +public class ListFluoQueries {
    +
    +    private static final FluoQueryMetadataDAO dao = new 
FluoQueryMetadataDAO();
    +
    +    /**
    +     * Retrieve a list of String representations of each query maintained 
by Fluo
    +     * 
    +     * @param fluo - FluoClient for interacting with Fluo
    +     * @return - List of String representations of queries maintained by 
Fluo.
    +     * @throws Exception 
    +     */
    +    public List<String> listFluoQueries(FluoClient fluo) throws Exception {
    +
    +        List<String> queryStrings = new ArrayList<>();
    +        Snapshot sx = fluo.newSnapshot();
    +
    +        List<String> ids = new ListQueryIds().listQueryIds(fluo);
    +        for (String id : ids) {
    +            queryStrings.add(extractString(dao.readQueryMetadata(sx, id)));
    +        }
    +
    +        return queryStrings;
    +    }
    +
    +    private String extractString(QueryMetadata metadata) throws Exception {
    --- End diff --
    
    static


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