Package org.apache.ambari.server.controller.ivory

Examples of org.apache.ambari.server.controller.ivory.Instance



  // ----- helper methods -----------------------------------------------------

  protected static Instance getInstance(String feedName, String instanceId, Map<String, Object> propertyMap) {
    return new Instance(
        feedName,
        instanceId,
        (String) propertyMap.get(INSTANCE_STATUS_PROPERTY_ID),
        (String) propertyMap.get(INSTANCE_START_TIME_PROPERTY_ID),
        (String) propertyMap.get(INSTANCE_END_TIME_PROPERTY_ID),
View Full Code Here


  private String setInstanceStatus(String feedName, String instanceId, String status) {
    String currentStatus = null;
    Map<String, Instance> instances = instanceMap.get(feedName);

    if (instances != null) {
      Instance instance = instances.get(instanceId);
      if (instance != null) {
        currentStatus = instance.getStatus();
        if (!currentStatus.equals(status)) {
          instance = new Instance(instance.getFeedName(),
                                  instance.getId(),
                                  status,
                                  instance.getStartTime(),
                                  instance.getEndTime(),
                                  instance.getDetails(),
                                  instance.getLog());
          instances.put(instance.getId(), instance);
        }
      }
    }
    return currentStatus;
  }
View Full Code Here

      instances = new HashMap<String, Instance>();
      instanceMap.put(feedName, instances);
    }

    String id = "Instance" + instanceCounter++;
    Instance instance = new Instance(feedName, id, "RUNNING",
        "2011-01-01T00:00Z", "2011-01-01T00:10Z", "details", "stdout" );
    instances.put(id, instance);
  }
View Full Code Here

    Map<String, Object> properties = new HashMap<String, Object>();

    List<Instance> instances = new LinkedList<Instance>();

    Instance instance1 = new Instance("Feed1", "Instance1", "s", "st", "et", "d", "l");
    Instance instance2 = new Instance("Feed1", "Instance2", "s", "st", "et", "d", "l");
    Instance instance3 = new Instance("Feed1", "Instance3", "s", "st", "et", "d", "l");

    instances.add(instance1);
    instances.add(instance2);
    instances.add(instance3);
View Full Code Here

  @Test
  public void testDeleteResources() throws Exception {
    IvoryService service = createMock(IvoryService.class);

    Instance instance1 = new Instance("Feed1", "Instance1", "SUBMITTED", "start", "end", "details", "log");

    // set expectations
    expect(service.getFeedNames()).andReturn(Collections.singletonList("Feed1"));
    expect(service.getInstances("Feed1")).andReturn(Collections.singletonList(instance1));
    service.killInstance("Feed1", "Instance1");
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.controller.ivory.Instance

Copyright © 2018 www.massapicom. 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.