Examples of Computer


Examples of hudson.model.Computer

    /**
     * Removes a {@link Node} from Hudson.
     */
    public synchronized void removeNode(Node n) throws IOException {
        Computer c = n.toComputer();
        if (c!=null)
            c.disconnect(OfflineCause.create(Messages._Hudson_NodeBeingRemoved()));

        ArrayList<Node> nl = new ArrayList<Node>(this.slaves);
        nl.remove(n);
        setNodes(nl);
    }
View Full Code Here

Examples of hudson.model.Computer

            }
        }

        Multimap<Computer,iOSDevice> devices = LinkedHashMultimap.create();
        for (Entry<Future<List<iOSDevice>>, Computer> e : futures.entrySet()) {
            Computer c = e.getValue();
            try {
                List<iOSDevice> devs = e.getKey().get();
                for (iOSDevice d : devs)
                    d.computer = c;
                devices.putAll(c, devs);
            } catch (Exception x) {
                x.printStackTrace(listener.error("Failed to list up iOS devices on "+c.getName()));
            }
        }

        this.devices = devices;
    }
View Full Code Here

Examples of hudson.model.Computer

            if (m==null)    return null;

            // figure out how many executors we need on each computer?
            Map<Computer,Integer> footprint = new HashMap<Computer, Integer>();
            for (Entry<WorkChunk, ExecutorChunk> e : m.toMap().entrySet()) {
                Computer c = e.getValue().computer;
                Integer v = footprint.get(c);
                if (v==null)    v = 0;
                v += e.getKey().size();
                footprint.put(c,v);
            }

            // the point of a tentative plan is to displace other jobs to create a point in time
            // where this task can start executing. An incorrectly estimated duration is not
            // a problem in this regard, as we just need enough idle executors in the right moment.
            // The downside of guessing the duration wrong is that we can end up creating tentative plans
            // afterward that may be incorrect, but those plans will be rebuilt.
            long d = bi.task.getEstimatedDuration();
            if (d<=0)    d = TimeUnit2.MINUTES.toMillis(5);

            TimeRange slot = new TimeRange(System.currentTimeMillis(), d);

            // now, based on the real predicted loads, figure out the approximation of when we can
            // start executing this guy.
            for (Entry<Computer, Integer> e : footprint.entrySet()) {
                Computer computer = e.getKey();
                Timeline timeline = new Timeline();
                for (LoadPredictor lp : LoadPredictor.all()) {
                    for (FutureLoad fl : Iterables.limit(lp.predict(worksheet, computer, slot.start, slot.end),100)) {
                        timeline.insert(fl.startTime, fl.startTime+fl.duration, fl.numExecutors);
                    }
                }

                Long x = timeline.fit(slot.start, slot.duration, computer.countExecutors()-e.getValue());
                // if no suitable range was found in [slot.start,slot.end), slot.end would be a good approximation
                if (x==null)    x = slot.end;
                slot = slot.shiftTo(x);
            }
View Full Code Here

Examples of hudson.model.Computer

  @Override
  protected void buildEnvVars(EnvVars env, MavenInstallation mi) throws IOException, InterruptedException {
    super.buildEnvVars(env, mi);
    // Override JDK in case it is set on Sonar publisher
    if (jdk != null) {
      Computer computer = Computer.currentComputer();
      if (computer != null) {
        // just in case were not in a build
        jdk = jdk.forNode(computer.getNode(), listener);
      }
      jdk.buildEnvVars(env);
    }
  }
View Full Code Here

Examples of hudson.model.Computer

  }

  private void computeJdkToUse(AbstractBuild<?, ?> build, BuildListener listener, EnvVars env) throws IOException, InterruptedException {
    JDK jdkToUse = getJdkToUse(build.getProject());
    if (jdkToUse != null) {
      Computer computer = Computer.currentComputer();
      // just in case we are not in a build
      if (computer != null) {
        jdkToUse = jdkToUse.forNode(computer.getNode(), listener);
      }
      jdkToUse.buildEnvVars(env);
    }
  }
View Full Code Here

Examples of hudson.model.Computer

     */
    public boolean shouldDisplaySummary(StaplerRequest request) {
        List<Ancestor> ancestors = request.getAncestors();
        Ancestor ancestor = ancestors.get(ancestors.size() - 1);
        if (ancestor.getObject() instanceof Computer) {
            Computer computer = (Computer)ancestor.getObject();
            return computer.getNode().getNodeProperties().get(MetadataNodeProperty.class) == this;
        }
        return false;
    }
View Full Code Here

Examples of hudson.model.Computer

    build = build_;
    listener = listener_;
    launcher = launcher_;
    sdk = sdk_;

    final Computer computer = Computer.currentComputer();

    // Use the Port Allocator plugin to reserve the two ports we need
    portAllocator = PortAllocationManager.getManager(computer);
    final int PORT_RANGE_START = 5560;
    final int PORT_RANGE_END = 5900;
View Full Code Here

Examples of org.hibernate.test.annotations.id.entities.Computer

    Session s = openSession();
    Transaction tx = s.beginTransaction();

    Ball b = new Ball();
    Dog d = new Dog();
    Computer c = new Computer();
    s.persist(b);
    s.persist(d);
    s.persist(c);
    tx.commit();
    s.close();
    assertEquals("table id not generated", new Integer(1), b.getId());
    assertEquals("generator should not be shared", new Integer(1), d
        .getId());
    assertEquals("default value should work", new Long(1), c.getId());

    s = openSession();
    tx = s.beginTransaction();
    s.delete(s.get(Ball.class, new Integer(1)));
    s.delete(s.get(Dog.class, new Integer(1)));
View Full Code Here

Examples of org.hibernate.test.annotations.id.entities.Computer

    Session s = openSession();
    Transaction tx = s.beginTransaction();

    Ball b = new Ball();
    Dog d = new Dog();
    Computer c = new Computer();
    s.persist(b);
    s.persist(d);
    s.persist(c);
    tx.commit();
    s.close();
    assertEquals("table id not generated", new Integer(1), b.getId());
    assertEquals("generator should not be shared", new Integer(1), d
        .getId());
    assertEquals("default value should work", new Long(1), c.getId());

    s = openSession();
    tx = s.beginTransaction();
    s.delete(s.get(Ball.class, new Integer(1)));
    s.delete(s.get(Dog.class, new Integer(1)));
View Full Code Here

Examples of org.hibernate.test.annotations.id.sequences.entities.Computer

    Session s = openSession();
    Transaction tx = s.beginTransaction();

    Ball b = new Ball();
    Dog d = new Dog();
    Computer c = new Computer();
    s.persist( b );
    s.persist( d );
    s.persist( c );
    tx.commit();
    s.close();
    assertEquals( "table id not generated", new Integer( 1 ), b.getId() );
    assertEquals(
        "generator should not be shared", new Integer( 1 ), d
            .getId()
    );
    assertEquals( "default value should work", new Long( 1 ), c.getId() );

    s = openSession();
    tx = s.beginTransaction();
    s.delete( s.get( Ball.class, new Integer( 1 ) ) );
    s.delete( s.get( Dog.class, new Integer( 1 ) ) );
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.