Examples of scheduleWithFixedDelay()


Examples of com.google.common.util.concurrent.ListeningScheduledExecutorService.scheduleWithFixedDelay()

      try {
         // this is sensitive to formatting as we are looking for the stack traces to match. if you wrap the below
         // line again, you'll need to change incrementInitialElement to 3 line numbers instead of 2.
         submission = getStackTraceAsString(incrementInitialElement(new RuntimeException(), 2))
               .replaceFirst(format(".*%s", LINE_SEPARATOR), "");
         sched.scheduleWithFixedDelay(runnableThrowsRTE(), 0, 1, TimeUnit.MICROSECONDS).get();
      } catch (ExecutionException e) {
         assertTraceHasSubmission(getStackTraceAsString(e), submission);
         assertTraceHasSubmission(getStackTraceAsString(e.getCause()), submission);
      }
   }
View Full Code Here

Examples of com.hazelcast.client.spi.ClientExecutionService.scheduleWithFixedDelay()

    }

    public void start() {
        getInitialPartitions();
        ClientExecutionService clientExecutionService = client.getClientExecutionService();
        clientExecutionService.scheduleWithFixedDelay(new RefreshTask(), INITIAL_DELAY, PERIOD, TimeUnit.SECONDS);
    }

    public void refreshPartitions() {
        try {
            client.getClientExecutionService().execute(new RefreshTask());
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService.scheduleWithFixedDelay()

        ExecutionService executionService = nodeEngine.getExecutionService();
        executionService.register(EXECUTOR_NAME, 2, 1000, ExecutorType.CACHED);

        long mergeNextRunDelay = node.getGroupProperties().MERGE_NEXT_RUN_DELAY_SECONDS.getLong() * 1000;
        mergeNextRunDelay = mergeNextRunDelay <= 0 ? 100 : mergeNextRunDelay; // milliseconds
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new SplitBrainHandler(node),
                mergeFirstRunDelay, mergeNextRunDelay, TimeUnit.MILLISECONDS);

        long heartbeatInterval = node.groupProperties.HEARTBEAT_INTERVAL_SECONDS.getInteger();
        heartbeatInterval = heartbeatInterval <= 0 ? 1 : heartbeatInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService.scheduleWithFixedDelay()

        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new SplitBrainHandler(node),
                mergeFirstRunDelay, mergeNextRunDelay, TimeUnit.MILLISECONDS);

        long heartbeatInterval = node.groupProperties.HEARTBEAT_INTERVAL_SECONDS.getInteger();
        heartbeatInterval = heartbeatInterval <= 0 ? 1 : heartbeatInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                heartBeater();
            }
        }, heartbeatInterval, heartbeatInterval, TimeUnit.SECONDS);
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService.scheduleWithFixedDelay()

            }
        }, heartbeatInterval, heartbeatInterval, TimeUnit.SECONDS);

        long masterConfirmationInterval = node.groupProperties.MASTER_CONFIRMATION_INTERVAL_SECONDS.getInteger();
        masterConfirmationInterval = masterConfirmationInterval <= 0 ? 1 : masterConfirmationInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                sendMasterConfirmation();
            }
        }, masterConfirmationInterval, masterConfirmationInterval, TimeUnit.SECONDS);
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService.scheduleWithFixedDelay()

            }
        }, masterConfirmationInterval, masterConfirmationInterval, TimeUnit.SECONDS);

        long memberListPublishInterval = node.groupProperties.MEMBER_LIST_PUBLISH_INTERVAL_SECONDS.getInteger();
        memberListPublishInterval = memberListPublishInterval <= 0 ? 1 : memberListPublishInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                sendMemberListToOthers();
            }
        }, memberListPublishInterval, memberListPublishInterval, TimeUnit.SECONDS);
    }
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService.scheduleWithFixedDelay()

        int backupSyncCheckInterval = node.groupProperties.PARTITION_BACKUP_SYNC_INTERVAL.getInteger();
        if (backupSyncCheckInterval <= 0) {
            backupSyncCheckInterval = 1;
        }
        executionService.scheduleWithFixedDelay(new SyncReplicaVersionTask(),
                backupSyncCheckInterval, backupSyncCheckInterval, TimeUnit.SECONDS);
    }

    @Override
    public Address getPartitionOwner(int partitionId) {
View Full Code Here

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

   public void start()
   {
      // start a thread, garbage expired cookie token every [DELAY_TIME]
      final AbstractTokenService service = this;
      ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
      executor.scheduleWithFixedDelay(new Runnable()
      {
         public void run()
         {
            service.cleanExpiredTokens();
         }
View Full Code Here

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

            counter.set(0);
            commit();
        }

        final ScheduledExecutorService commitService = commitExecutorService();
        commitService.scheduleWithFixedDelay(new Runnable() {
            @Override
            public void run() {
                try {
                    commit();
                } catch (Exception e) {
View Full Code Here

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

            }
        }));

        // every so often, we bring back a black-listed server
        ScheduledExecutorService background = Executors.newSingleThreadScheduledExecutor();
        background.scheduleWithFixedDelay(new Runnable() {
            @Override
            public void run() {
                if (serverBlackList.size() > 0) {
                    serverBlackList.elementSet().remove(serverBlackList.iterator().next());
                }
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.