Search in sources :

Example 1 with SchemaResult

use of org.apache.apex.malhar.lib.appdata.schemas.SchemaResult in project apex-malhar by apache.

the class AbstractAppDataSnapshotServer method processQuery.

/**
 * process the query send.
 * provide this method to give sub class a chance to override.
 * @param queryJSON
 */
protected void processQuery(String queryJSON) {
    LOG.debug("query {}", queryJSON);
    Message query = null;
    try {
        query = queryDeserializerFactory.deserialize(queryJSON);
    } catch (IOException ex) {
        LOG.error("Error parsing query: {}", queryJSON);
        LOG.error("{}", ex);
        return;
    }
    if (query instanceof SchemaQuery) {
        SchemaResult schemaResult = schemaRegistry.getSchemaResult((SchemaQuery) query);
        if (schemaResult != null) {
            LOG.debug("queueing {}", schemaResult);
            schemaQueue.add(schemaResult);
        }
    } else if (query instanceof DataQuerySnapshot) {
        queryProcessor.enqueue((DataQuerySnapshot) query, null, null);
    }
}
Also used : SchemaResult(org.apache.apex.malhar.lib.appdata.schemas.SchemaResult) Message(org.apache.apex.malhar.lib.appdata.schemas.Message) DataQuerySnapshot(org.apache.apex.malhar.lib.appdata.schemas.DataQuerySnapshot) IOException(java.io.IOException) SchemaQuery(org.apache.apex.malhar.lib.appdata.schemas.SchemaQuery)

Aggregations

IOException (java.io.IOException)1 DataQuerySnapshot (org.apache.apex.malhar.lib.appdata.schemas.DataQuerySnapshot)1 Message (org.apache.apex.malhar.lib.appdata.schemas.Message)1 SchemaQuery (org.apache.apex.malhar.lib.appdata.schemas.SchemaQuery)1 SchemaResult (org.apache.apex.malhar.lib.appdata.schemas.SchemaResult)1