Examples of Instance


Examples of org.apache.mahout.classifier.df.data.Instance

                                                                     InterruptedException {
      if (firstId == null) {
        firstId = new LongWritable(key.get());
      }
     
      Instance instance = converter.convert(value.toString());
     
      context.write(firstId, new IntWritable((int) dataset.getLabel(instance)));
    }
View Full Code Here

Examples of org.apache.mahout.df.data.Instance

      if (line.isEmpty()) {
        continue; // skip empty lines
      }
     
      // write the tuple in files[tuple.label]
      Instance instance = converter.convert(id++, line);
      int label = instance.label;
      files[currents[label]].writeBytes(line);
      files[currents[label]].writeChar('\n');
     
      // update currents
View Full Code Here

Examples of org.apache.openejb.core.mdb.Instance

                }
            }

            // TODO: We need to keep these somehwere
            interceptorInstances.put(beanClass.getName(), bean);
            Instance instance = new Instance(bean,interceptorInstances);
            try {
                callContext.setCurrentOperation(Operation.POST_CONSTRUCT);
                callContext.setCurrentAllowedStates(MdbContext.getStates());

                List<InterceptorData> callbackInterceptors = deploymentInfo.getCallbackInterceptors();
View Full Code Here

Examples of org.apache.openejb.core.stateful.Instance

        startVerification();

        manager.addSessionManager(deploymentId, sessionManager);

        Instance instance = new Instance(deploymentInfo, primaryKey, new Object(), null, (Map<EntityManagerFactory, EntityManager>) null);
        manager.add(primaryKey, instance);
    }
View Full Code Here

Examples of org.apache.servicemix.kernel.gshell.admin.Instance

    public void setAdminService(AdminService adminService) {
        this.adminService = adminService;
    }

    protected Instance getExistingInstance(String name) {
        Instance i = adminService.getInstance(name);
        if (i == null) {
            throw new IllegalArgumentException("Instance '" + name + "' does not exist");
        }
        return i;
    }
View Full Code Here

Examples of org.apache.sling.discovery.impl.setup.Instance

        }
    }
   
    @Test
    public void testTwoNodes() throws Throwable {
        Instance instance1 = TopologyTestHelper.createInstance(instances, "instance1");
        Instance instance2 = TopologyTestHelper.createInstance(instances, "instance2");
        instance1.getConfig().setHeartbeatTimeout(2);
        instance1.getConfig().setHeartbeatInterval(1);
        instance2.getConfig().setHeartbeatTimeout(1);
        instance2.getConfig().setHeartbeatInterval(1);
       
        Set<InstanceDescription> instances1 = instance1.getDiscoveryService().getTopology().getInstances();
        Set<InstanceDescription> instances2 = instance2.getDiscoveryService().getTopology().getInstances();
       
        assertEquals(1, instances1.size());
        assertEquals(1, instances2.size());
        assertEquals(instance1.getSlingId(), instances1.iterator().next().getSlingId());
        assertEquals(instance2.getSlingId(), instances2.iterator().next().getSlingId());
       
        new Connector(instance1, instance2);
       
        // check instance 1's announcements
        Collection<Announcement> instance1LocalAnnouncements =
                instance1.getAnnouncementRegistry().listLocalAnnouncements();
        assertEquals(1, instance1LocalAnnouncements.size());
        Announcement instance1LocalAnnouncement = instance1LocalAnnouncements.iterator().next();
        assertEquals(instance2.getSlingId(), instance1LocalAnnouncement.getOwnerId());
        assertEquals(true, instance1LocalAnnouncement.isInherited());

        // check instance 2's announcements
        Collection<Announcement> instance2LocalAnnouncements =
                instance2.getAnnouncementRegistry().listLocalAnnouncements();
        assertEquals(1, instance2LocalAnnouncements.size());
        Announcement instance2LocalAnnouncement = instance2LocalAnnouncements.iterator().next();
        assertEquals(instance1.getSlingId(), instance2LocalAnnouncement.getOwnerId());
        assertEquals(false, instance2LocalAnnouncement.isInherited());
       
        // check topology
        TopologyTestHelper.assertTopologyConsistsOf(instance1.getDiscoveryService().getTopology(), instance1.getSlingId(), instance2.getSlingId());
        TopologyTestHelper.assertTopologyConsistsOf(instance2.getDiscoveryService().getTopology(), instance1.getSlingId(), instance2.getSlingId());

        instance1LocalAnnouncements =
                instance1.getAnnouncementRegistry().listLocalAnnouncements();
        assertEquals(1, instance1LocalAnnouncements.size());
        instance2LocalAnnouncements =
                instance2.getAnnouncementRegistry().listLocalAnnouncements();
        assertEquals(1, instance2LocalAnnouncements.size());

        Thread.sleep(1500);
       
        instance1LocalAnnouncements =
                instance1.getAnnouncementRegistry().listLocalAnnouncements();
        assertEquals(1, instance1LocalAnnouncements.size());
        instance2LocalAnnouncements =
                instance2.getAnnouncementRegistry().listLocalAnnouncements();
        assertEquals(0, instance2LocalAnnouncements.size());

        TopologyTestHelper.assertTopologyConsistsOf(instance1.getDiscoveryService().getTopology(), instance1.getSlingId(), instance2.getSlingId());
        TopologyTestHelper.assertTopologyConsistsOf(instance2.getDiscoveryService().getTopology(), instance2.getSlingId());
       
        Thread.sleep(1000);
        instance1LocalAnnouncements =
                instance1.getAnnouncementRegistry().listLocalAnnouncements();
        assertEquals(0, instance1LocalAnnouncements.size());
        instance2LocalAnnouncements =
                instance2.getAnnouncementRegistry().listLocalAnnouncements();
        assertEquals(0, instance2LocalAnnouncements.size());

        TopologyTestHelper.assertTopologyConsistsOf(instance1.getDiscoveryService().getTopology(), instance1.getSlingId());
        TopologyTestHelper.assertTopologyConsistsOf(instance2.getDiscoveryService().getTopology(), instance2.getSlingId());
    }
View Full Code Here

Examples of org.apache.whirr.Cluster.Instance

    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
    Configuration conf = getConfiguration(clusterSpec);

    LOG.info("Authorizing firewall");
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    event.getFirewallManager().addRules(
      Rule.create()
        .destination(instance)
        .ports(MASTER_WEB_UI_PORT, MASTER_PORT)
View Full Code Here

Examples of org.apache.whirr.service.Cluster.Instance

    return Sets.newHashSet(Collections2.transform(Sets.newHashSet(nodes),
        new Function<NodeMetadata, Instance>() {
      @Override
      public Instance apply(NodeMetadata node) {
        try {
          return new Instance(node.getCredentials(), Collections.singleton(ZOOKEEPER_ROLE),
            InetAddress.getByName(Iterables.get(node.getPublicAddresses(), 0)),
            InetAddress.getByName(Iterables.get(node.getPrivateAddresses(), 0)));
        } catch (UnknownHostException e) {
          throw new RuntimeException(e);
        }
View Full Code Here

Examples of org.dcm4che3.audit.Instance

        sopClass.setNumberOfInstances(numI);
        return sopClass;
    }

    public static Instance createInstance(String uid) {
        Instance inst = new Instance();
        inst.setUID(uid);
        return inst;
    }
View Full Code Here

Examples of org.dspace.app.xmlui.wing.element.Instance

    if (help)
      text.setHelp("This is helpfull text.");
    if (error)
      text.addError("This field is in error.");
    text.setValue("First is special");
    Instance instance = text.addInstance();
    instance.setValue("Second raw");
    instance.setInterpretedValue("Second interpreted");
    instance = text.addInstance();
    instance.setValue("Third raw");
    instance.setInterpretedValue("Third interpreted");

    // Select
    Select select = list.addItem().addSelect("select");
    select.setLabel("Text");
    select.enableAddOperation();
    select.enableDeleteOperation();
    select.setMultiple();
    select.setSize(4);
    if (help)
      select.setHelp("This is helpfull text.");
    if (error)
      select.addError("This field is in error.");
    select.addOption("one", "uno");
    select.addOption("two", "dos");
    select.addOption("three", "tres");
    select.addOption("four", "cuatro");
    select.addOption("five", "cinco");
   
    instance = select.addInstance();
    instance.setOptionSelected("one");
   
    instance = select.addInstance();
    instance.setOptionSelected("one");
    instance.setOptionSelected("two");
   
    instance = select.addInstance();
    instance.setOptionSelected("one");
    instance.setOptionSelected("two");
    instance.setOptionSelected("three");
   
    instance = select.addInstance();
    instance.setOptionSelected("one");
    instance.setOptionSelected("two");
    instance.setOptionSelected("three");
    instance.setOptionSelected("four");
   
    instance = select.addInstance();
    instance.setOptionSelected("one");
    instance.setOptionSelected("two");
    instance.setOptionSelected("three");
    instance.setOptionSelected("four");
    instance.setOptionSelected("five");
   

        // composite two text fields  
        Composite composite = list.addItem().addComposite("compositeA");
        composite.setLabel("Composite (two text fields)");
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.