List of usage examples for com.amazonaws.services.elasticmapreduce.model StepState RUNNING
StepState RUNNING
To view the source code for com.amazonaws.services.elasticmapreduce.model StepState RUNNING.
Click Source Link
From source file:org.finra.dm.dao.impl.EmrDaoImpl.java
License:Apache License
/** * Gets the active step on the cluster if any. * * @param clusterId, the cluster id./*w w w . ja va2s . com*/ * @param awsParamsDto, AWS related parameters for access/secret keys and proxy details. * * @return the step summary object. */ @Override public StepSummary getClusterActiveStep(String clusterId, AwsParamsDto awsParamsDto) { ListStepsRequest listStepsRequest = new ListStepsRequest().withClusterId(clusterId) .withStepStates(StepState.RUNNING); List<StepSummary> stepSummaryList = emrOperations .listStepsRequest(getEmrClient(awsParamsDto), listStepsRequest).getSteps(); return (stepSummaryList != null && stepSummaryList.size() > 0) ? stepSummaryList.get(0) : null; }
From source file:org.finra.dm.dao.impl.MockEmrOperationsImpl.java
License:Apache License
private MockEmrJobFlow addClusterStep(String jobFlowId, StepConfig step) { List<MockEmrJobFlow> mockSteps = getStepsByClusterId(jobFlowId); if (mockSteps == null) { mockSteps = new ArrayList<>(); }//from w w w. j av a 2 s . com MockEmrJobFlow mockStep = new MockEmrJobFlow(); mockStep.setJobFlowId(getNewJobFlowId()); mockStep.setJobFlowName(step.getName()); if (step.getName().equalsIgnoreCase(MOCK_STEP_RUNNING_NAME)) { mockStep.setStatus(StepState.RUNNING.toString()); } else { mockStep.setStatus(StepState.PENDING.toString()); } mockStep.setJarLocation(step.getHadoopJarStep().getJar()); mockSteps.add(mockStep); setStepsByClusterId(jobFlowId, mockSteps); return mockStep; }
From source file:org.finra.herd.dao.impl.EmrDaoImpl.java
License:Apache License
@Override public StepSummary getClusterActiveStep(String clusterId, AwsParamsDto awsParamsDto) { ListStepsRequest listStepsRequest = new ListStepsRequest().withClusterId(clusterId) .withStepStates(StepState.RUNNING); List<StepSummary> stepSummaryList = emrOperations .listStepsRequest(getEmrClient(awsParamsDto), listStepsRequest).getSteps(); return !stepSummaryList.isEmpty() ? stepSummaryList.get(0) : null; }
From source file:org.finra.herd.dao.impl.MockEmrOperationsImpl.java
License:Apache License
private MockEmrJobFlow addClusterStep(String jobFlowId, StepConfig step) { List<MockEmrJobFlow> mockSteps = getStepsByClusterId(jobFlowId); if (mockSteps == null) { mockSteps = new ArrayList<>(); }/* w ww . ja va 2 s.co m*/ MockEmrJobFlow mockStep = new MockEmrJobFlow(); if (!step.getName().equalsIgnoreCase(MOCK_STEP_RUNNING_WITHOUT_ID_NAME)) { mockStep.setJobFlowId(getNewJobFlowId()); } mockStep.setJobFlowName(step.getName()); if (step.getName().equalsIgnoreCase(MOCK_STEP_RUNNING_NAME) || step.getName().equalsIgnoreCase(MOCK_STEP_RUNNING_WITHOUT_ID_NAME)) { mockStep.setStatus(StepState.RUNNING.toString()); } else { mockStep.setStatus(StepState.PENDING.toString()); } mockStep.setJarLocation(step.getHadoopJarStep().getJar()); mockSteps.add(mockStep); setStepsByClusterId(jobFlowId, mockSteps); return mockStep; }