Search in sources :

Example 11 with ProgramRunInfo

use of io.cdap.cdap.runtime.spi.ProgramRunInfo in project cdap by caskdata.

the class DataprocRuntimeJobManagerTest method longJobNameTest.

@Test
public void longJobNameTest() {
    ProgramRunInfo runInfo = new ProgramRunInfo.Builder().setNamespace("namespace").setApplication("very_very_long_app_name_is_provided_this_should_be" + "_trimed_so_that_correct_name_is_produced").setVersion("1.0").setProgramType("workflow").setProgram("program").setRun(UUID.randomUUID().toString()).build();
    String jobName = DataprocRuntimeJobManager.getJobId(runInfo);
    Assert.assertTrue(jobName.startsWith("namespace_very_very_long_app_name_is_provided_this_should_be_tr_"));
    Assert.assertEquals(100, jobName.length());
}
Also used : ProgramRunInfo(io.cdap.cdap.runtime.spi.ProgramRunInfo) Test(org.junit.Test)

Aggregations

ProgramRunInfo (io.cdap.cdap.runtime.spi.ProgramRunInfo)11 Test (org.junit.Test)7 AlreadyExistsException (com.google.api.gax.rpc.AlreadyExistsException)2 ApiException (com.google.api.gax.rpc.ApiException)2 HadoopJob (com.google.cloud.dataproc.v1beta2.HadoopJob)2 Job (com.google.cloud.dataproc.v1beta2.Job)2 SubmitJobRequest (com.google.cloud.dataproc.v1beta2.SubmitJobRequest)2 StorageException (com.google.cloud.storage.StorageException)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 File (java.io.File)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 CredentialsProvider (com.google.api.gax.core.CredentialsProvider)1 FixedCredentialsProvider (com.google.api.gax.core.FixedCredentialsProvider)1 StatusCode (com.google.api.gax.rpc.StatusCode)1 GoogleCredentials (com.google.auth.oauth2.GoogleCredentials)1 WriteChannel (com.google.cloud.WriteChannel)1 GetJobRequest (com.google.cloud.dataproc.v1beta2.GetJobRequest)1 JobControllerClient (com.google.cloud.dataproc.v1beta2.JobControllerClient)1 JobControllerSettings (com.google.cloud.dataproc.v1beta2.JobControllerSettings)1