Codota Logo
StreamsQuery.getQueryId
Code IndexAdd Codota to your IDE (free)

How to use
getQueryId
method
in
org.apache.rya.streams.api.entity.StreamsQuery

Best Java code snippets using org.apache.rya.streams.api.entity.StreamsQuery.getQueryId (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: apache/incubator-rya

private void append(final StringBuilder string, final StreamsQuery query) {
  requireNonNull(string);
  requireNonNull(query);
  string.append("    Streams Query {\n")
     .append("        Query ID: ").append(query.getQueryId()).append(",\n")
     .append("        Is Active: ").append(query.isActive()).append(",\n")
     .append("        SPARQL: ").append(query.getSparql()).append("\n")
     .append("    }");
}
origin: apache/incubator-rya

  final String id1 = query1.getQueryId().toString();
  final String id2 = query2.getQueryId().toString();
  return id1.compareTo(id2);
});
origin: apache/incubator-rya

@Override
public void startQuery(final String ryaInstance, final StreamsQuery query) throws QueryExecutorException {
  requireNonNull(ryaInstance);
  requireNonNull(query);
  checkState(state() == State.RUNNING, "The service must be RUNNING to execute this method.");
  lock.lock();
  try {
    // Make sure the Statements topic exists for the query.
    final Set<String> topics = Sets.newHashSet(
        KafkaTopics.statementsTopic(ryaInstance),
        KafkaTopics.queryResultsTopic(ryaInstance, query.getQueryId()));
    // Make sure the Query Results topic exists for the query.
    // Since this is running in the JVM, the properties are left empty
    //   so the cleanup.policy will default to delete to reduce memory usage.
    createKafkaTopic.createTopics(topics, 1, 1, Optional.empty());
    // Setup the Kafka Streams job that will execute.
    final KafkaStreams streams = streamsFactory.make(ryaInstance, query);
    streams.start();
    // Mark which Rya Instance the Query ID is for.
    ryaInstanceById.put(query.getQueryId(), ryaInstance);
    // Add the Query ID to the collection of running queries for the Rya instance.
    idByRyaInstance.put(ryaInstance, query.getQueryId());
    // Add the running Kafka Streams job for the Query ID.
    byQueryId.put(query.getQueryId(), streams);
  } catch (final KafkaStreamsFactoryException e) {
    throw new QueryExecutorException("Could not start query " + query.getQueryId(), e);
  } finally {
    lock.unlock();
  }
}
origin: apache/incubator-rya

/**
 * Pretty formats a {@link StreamsQuery}.
 *
 * @param query - The query to format. (not null)
 * @return The pretty formatted string.
 * @throws Exception A problem was encountered while pretty formatting the SPARQL.
 */
public static String format(final StreamsQuery query) throws Exception {
  requireNonNull(query);
  // Pretty format the SPARQL query.
  final ParsedQuery parsedQuery = new SPARQLParser().parseQuery(query.getSparql(), null);
  final String prettySparql = new SPARQLQueryRenderer().render(parsedQuery);
  final String[] lines = prettySparql.split("\n");
  // Create the formatted string.
  query.getQueryId();
  query.isActive();
  String.format(" QueryId: %s", query.getQueryId());
  final StringBuilder builder = new StringBuilder();
  builder.append(" Query ID: ").append( query.getQueryId() ) .append("\n");
  builder.append("Is Active: ").append( query.isActive() ).append("\n");
  builder.append("Is Insert: ").append( query.isInsert() ).append("\n");
  builder.append("   SPARQL: ").append( lines[0] ).append("\n");
  for(int i = 1; i < lines.length; i++) {
    builder.append("           ").append(lines[i]).append("\n");
  }
  return builder.toString();
}
origin: apache/incubator-rya

  @Override
  public KafkaStreams make(final String ryaInstance, final StreamsQuery query) throws KafkaStreamsFactoryException {
    requireNonNull(ryaInstance);
    requireNonNull(query);

    // Setup the Kafka Stream program.
    final Properties streamsProps = new Properties();

    // Configure the Kafka servers that will be talked to.
    streamsProps.setProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServersConfig);

    // Use the Query ID as the Application ID to ensure we resume where we left off the last time this command was run.
    streamsProps.put(StreamsConfig.APPLICATION_ID_CONFIG, "RyaStreams-Query-" + query.getQueryId());

    // Always start at the beginning of the input topic.
    streamsProps.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");

    // Setup the topology that processes the Query.
    final String statementsTopic = KafkaTopics.statementsTopic(ryaInstance);
    final String resultsTopic = KafkaTopics.queryResultsTopic(ryaInstance, query.getQueryId());

    try {
      final TopologyBuilder topologyBuilder = topologyFactory.build(query.getSparql(), statementsTopic, resultsTopic, new RandomUUIDFactory());
      return new KafkaStreams(topologyBuilder, new StreamsConfig(streamsProps));
    } catch (final MalformedQueryException | TopologyBuilderException e) {
      throw new KafkaStreamsFactoryException("Could not create a KafkaStreams processing topology for query " + query.getQueryId(), e);
    }
  }
}
origin: apache/incubator-rya

if(updatedQuery.isActive()) {
  log.info("Rya Instance " + ryaInstance + " updated Rya Streams query with ID " +
      updatedQuery.getQueryId() + " to be active.");
  final QueryEvent executeUpdatedQuery = QueryEvent.executing(ryaInstance, updatedQuery);
  offerUntilAcceptedOrShutdown(queryWorkQueue, executeUpdatedQuery, blockingValue, blockingUnits, shutdownSignal);
} else {
  log.info("Rya Instance " + ryaInstance + " updated Rya Streams query with ID " +
      updatedQuery.getQueryId() + " to be inactive.");
  final QueryEvent stopUpdatedQuery = QueryEvent.stopped(ryaInstance, updatedQuery.getQueryId());
  offerUntilAcceptedOrShutdown(queryWorkQueue, stopUpdatedQuery, blockingValue, blockingUnits, shutdownSignal);
origin: apache/incubator-rya

    QueryEvent.executing(ryaInstance, query) : QueryEvent.stopped(ryaInstance, query.getQueryId());
log.debug("LogEventWorker - offering: " + queryEvent);
origin: apache/incubator-rya

final StreamsQuery old = queriesCache.get(queryId);
final StreamsQuery updated = new StreamsQuery(
    old.getQueryId(),
    old.getSparql(),
    change.getIsActive().get(),
origin: org.apache.rya/rya.streams.api

final StreamsQuery old = queriesCache.get(queryId);
final StreamsQuery updated = new StreamsQuery(
    old.getQueryId(),
    old.getSparql(),
    change.getIsActive().get());
origin: apache/incubator-rya

return "The added query's ID is " + streamsQuery.getQueryId();
org.apache.rya.streams.api.entityStreamsQuerygetQueryId

Popular methods of StreamsQuery

  • getSparql
  • isActive
  • isInsert
  • <init>
    Constructs an instance of StreamsQuery.

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JTextField (javax.swing)
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now