Examples of IoRunnable


Examples of com.sun.sgs.impl.util.IoRunnable

      /*
       * Send "close" notification to channel's servers.
       */
      for (final long nodeId : serverNodeIds) {
    channelService.runIoTask(
        new IoRunnable() {
      public void run() throws IOException {
          ChannelServer server = getChannelServer(nodeId);
          if (server != null) {
        server.close(channelRefId, timestamp);
          }
View Full Code Here

Examples of com.sun.sgs.impl.util.IoRunnable

        }
    }
    taskScheduler.scheduleTask(
        new AbstractKernelRunnable("relocateMemberships") {
      public void run() {
          runIoTask(new IoRunnable() {
              public void run() throws IOException {
            getChannelServer(newNodeId).
          relocateChannelMemberships(
               sessionRefId, localNodeId,
              channelRefIds, deliveryOrdinals,
View Full Code Here

Examples of com.sun.sgs.impl.util.IoRunnable

       * Finished adding relocating session to channels, so notify
       * old node that we are done.
       */
      final ChannelServer server = getChannelServer(oldNodeId);
      runIoTask(
    new IoRunnable() {
        public void run() throws IOException {
      server.relocateChannelMembershipsCompleted(
          sessionRefId, localNodeId);
        } },
    oldNodeId);
View Full Code Here

Examples of com.sun.sgs.impl.util.IoRunnable

        final long runNum = runNumber.incrementAndGet();
        for (final Map.Entry<Long, LPAClient> ce : clientProxies.entrySet()) {
            long nodeId = ce.getKey();
            try {
                boolean ok = runIoTask(new IoRunnable() {
                    public void run() throws IOException {
                        ce.getValue().prepareAlgorithm(runNum);
                    } }, wdog, nodeId, maxIoAttempts, retryWaitTime,
                         CLASS_NAME);
                if (!ok) {
View Full Code Here

Examples of com.sun.sgs.impl.util.IoRunnable

            latch = new CountDownLatch(cleanSize);
            for (final Map.Entry<Long, LPAClient> ce : clientProxies.entrySet())
            {
                long nodeId = ce.getKey();
                try {
                    boolean ok = runIoTask(new IoRunnable() {
                    public void run() throws IOException {
                        ce.getValue().startIteration(currentIteration);
                    } }, wdog, nodeId, maxIoAttempts, retryWaitTime,
                         CLASS_NAME);
                    if (!ok) {
View Full Code Here

Examples of com.sun.sgs.impl.util.IoRunnable

            final LPAClient proxy = ce.getValue();
            // TODO:  use executor to make parallel requests
            executor.execute(new Runnable() {
                public void run() {
                    try {
                        boolean ok = runIoTask(new IoRunnable() {
                            public void run() throws IOException {
                                returnedGroups.put(nodeId,
                                      proxy.getAffinityGroups(runNum, true));
                            } }, wdog, nodeId, maxIoAttempts, retryWaitTime,
                                 CLASS_NAME);
View Full Code Here

Examples of com.sun.sgs.impl.util.IoRunnable

                assert (map != null);            
                synchronized (map) {
                    mapEntries = new HashSet<Object>(map.keySet());
                }
                boolean ok =
                        LabelPropagationServer.runIoTask(new IoRunnable() {
                    public void run() throws IOException {
                        proxy.notifyCrossNodeEdges(mapEntries, localNodeId);
                    } },
                    wdog, nodeId, maxIoAttempts, retryWaitTime, CLASS_NAME);
                if (!ok) {
                    failed = true;
                    break;
                }
            } else {
                logger.log(Level.FINE, "{0}: could not exchange edges with {1}",
                           localNodeId, nodeId);
                failed = true;
                break;
            }
        }

        // Tell the server we're ready for the iterations to begin.  If we
        // cannot contact the server, the server will eventually detect this
        // by timing out waiting for a response from this node.
        final boolean runFailed = failed;
        LabelPropagationServer.runIoTask(new IoRunnable() {
            public void run() throws IOException {
                server.readyToBegin(localNodeId, runFailed);
            } }, wdog, localNodeId, maxIoAttempts, retryWaitTime, CLASS_NAME);
        synchronized (stateLock) {
            state = State.WAITING_FOR_SERVER;
View Full Code Here

Examples of com.sun.sgs.impl.util.IoRunnable

            }
        }
        // Tell the server we've finished this iteration
        final boolean converged = !changed;
        final boolean runFailed = failed;
        LabelPropagationServer.runIoTask(new IoRunnable() {
            public void run() throws IOException {
                server.finishedIteration(localNodeId, converged,
                                         runFailed, iteration);
            } }, wdog, localNodeId, maxIoAttempts, retryWaitTime, CLASS_NAME);
View Full Code Here

Examples of com.sun.sgs.impl.util.IoRunnable

    ChannelServiceImpl.getInstance();
      channelService.getTaskService().scheduleNonDurableTask(
          new AbstractKernelRunnable("SendServiceEventQueue") {
      public void run() {
          channelService.runIoTask(
       new IoRunnable() {
        public void run() throws IOException {
            coordinator.serviceEventQueue(channelRefId);
        } }, coord);
      }
    }, false);
View Full Code Here

Examples of com.sun.sgs.impl.util.IoRunnable

                               id, oldNode, newNode);
        if (oldNode != null) {
            final NotifyClient oldClient = notifyMap.get(oldNode.getId());
            if (oldClient != null) {
                runIoTask(
                    new IoRunnable() {
                        public void run() throws IOException {
                            oldClient.removed(id, newNode);
                        }
                    }, oldNode.getId());
            }
        }
       
        if (newNode != null) {
            final NotifyClient newClient = notifyMap.get(newNode.getId());
            if (newClient != null) {
                runIoTask(
                    new IoRunnable() {
                        public void run() throws IOException {
                            newClient.added(id, oldNode);
                        }
                    }, newNode.getId());
            }
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.