Examples of scheduleAtFixedRate()


Examples of java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate()

  private void startTagUpdateService() {

    ScheduledExecutorService scheduler = Executors
        .newSingleThreadScheduledExecutor();
    scheduler.scheduleAtFixedRate(new Runnable() {
      @Override
      public void run() {
        try {
          updateTags();
        } catch (Throwable t) {
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate()

                    System.err.println("Negative value spotted for openConnection metric: " + value);
                    negativeOpenConnectionCountSpotted.set(true);
                }
            }
        };
        openConnectionsWatcherExecutor.scheduleAtFixedRate(openConnectionsWatcher, 1, 1, SECONDS);

        // Insert 100k lines in a newly created 1k columns table
        PreparedStatement insertStatement = session.prepare(generateJava349InsertStatement());
        for (int key = 0; key < numberOfInserts; key++) {
            session.executeAsync(insertStatement.bind(key)).addListener(progressReporter, progressReportExecutor);
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate()

                int inFlight = session.getState().getInFlightQueries(host);
                if (inFlight > maxRequests)
                    excessInflightQueriesSpotted.set(true);
            }
        };
        openConnectionsWatcherExecutor.scheduleAtFixedRate(openConnectionsWatcher, 200, 200, TimeUnit.MILLISECONDS);

        // Generate the load
        for (int i = 0; i < 10000; i++)
            session.executeAsync("SELECT release_version FROM system.local");
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate()

    //Schedule Nimbus monitor
    MonitorRunnable r1 = new MonitorRunnable(data);
   
    int monitor_freq_secs = (Integer) conf.get(Config.NIMBUS_MONITOR_FREQ_SECS);
    scheduExec.scheduleAtFixedRate(r1, monitor_freq_secs, monitor_freq_secs,TimeUnit.SECONDS);
   
    //Schedule Nimbus inbox cleaner.����/nimbus/inbox�¹��ڵ�jar
    String dir_location=StormConfig.masterInbox(conf);
    int inbox_jar_expiration_secs=(Integer)conf.get(Config.NIMBUS_INBOX_JAR_EXPIRATION_SECS);
    CleanRunnable r2 = new CleanRunnable(dir_location,inbox_jar_expiration_secs);
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate()

    //Schedule Nimbus inbox cleaner.����/nimbus/inbox�¹��ڵ�jar
    String dir_location=StormConfig.masterInbox(conf);
    int inbox_jar_expiration_secs=(Integer)conf.get(Config.NIMBUS_INBOX_JAR_EXPIRATION_SECS);
    CleanRunnable r2 = new CleanRunnable(dir_location,inbox_jar_expiration_secs);
    int cleanup_inbox_freq_secs = (Integer) conf.get(Config.NIMBUS_CLEANUP_INBOX_FREQ_SECS);
    scheduExec.scheduleAtFixedRate(r2, cleanup_inbox_freq_secs, cleanup_inbox_freq_secs,TimeUnit.SECONDS);

    //Thrift server���ü���������
    Integer thrift_port = (Integer) conf.get(Config.NIMBUS_THRIFT_PORT);
    TNonblockingServerSocket socket = new TNonblockingServerSocket(
        thrift_port);
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate()

    /** The default implementation of Scheduler. */
    private static class BasicScheduler implements Scheduler {
  public TaskHandle scheduleRecurringTask(Runnable task, long period) {
      final ScheduledExecutorService executor =
    Executors.newSingleThreadScheduledExecutor();
      executor.scheduleAtFixedRate(
    task, period, period, TimeUnit.MILLISECONDS);
      return new TaskHandle() {
    public synchronized void cancel() {
        if (executor.isShutdown()) {
      throw new IllegalStateException(
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate()

        final int FACTS_PER_POLL = 1000;
        final int POLL_INTERVAL = 500;

        ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
        executor.scheduleAtFixedRate(
                new Runnable() {

                    public void run() {
                        for ( int j = 0; j < FACTS_PER_POLL; j++ ) {
                            ksession.insert( new MyFact() );
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate()

   * Instantiates the ScheduledExecutorService which will iterate through all monitored Metrics at the specified period,
   * send the current value of the Metric, and then clear the value.
   */
  private void setMonitor() {
    ScheduledExecutorService eScheduledService = Executors.newSingleThreadScheduledExecutor();
    eScheduledService.scheduleAtFixedRate(new TimerTask() {
      public void run() {
        updateCount++;
        for (Metricable gmetric : gmetrics) {
          if (updateCount > initPeriod) {
            sendGMetricInit(gmetric);
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate()

        final int FACTS_PER_POLL = 1000;
        final int POLL_INTERVAL = 500;

        ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
        executor.scheduleAtFixedRate(
                new Runnable() {

                    public void run() {
                        for ( int j = 0; j < FACTS_PER_POLL; j++ ) {
                            ksession.insert( new MyFact() );
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate()

    /**
     * Due to the lack of contract in CDI guaranteeing when beans will be available, we use an executor to search for
     * the beans every 100ms until it finds them. Or, after a 25 seconds, blow up if they don't become available.
     */
    final ScheduledExecutorService startupScheduler = Executors.newScheduledThreadPool(1);
    startupScheduler.scheduleAtFixedRate(
        new StartupCallback(beanManager, bus, startupScheduler, 25), 0, 100, TimeUnit.MILLISECONDS);

    for (final Class<?> remoteInterfaceType : managedTypes.getRemoteInterfaces()) {
      createRPCScaffolding(remoteInterfaceType, bus, beanManager);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.