Search in sources :

Example 31 with SetAttributePOptions

use of alluxio.grpc.SetAttributePOptions in project alluxio by Alluxio.

the class ReplicateIntegrationTest method requestBackoffTest.

// Tests that we send one request and log one message when job master is at capacity
@Test
@LocalAlluxioClusterResource.Config(confParams = { PropertyKey.Name.JOB_MASTER_JOB_CAPACITY, "0", PropertyKey.Name.JOB_MASTER_FINISHED_JOB_RETENTION_TIME, "0" })
public void requestBackoffTest() throws Exception {
    String rootDir = "/backofftest";
    for (int i = 0; i < 10; i++) {
        AlluxioURI uri = new AlluxioURI(rootDir + "/" + i);
        createFileOutsideOfAlluxio(uri);
    }
    SetAttributePOptions opts = SetAttributePOptions.newBuilder().setReplicationMin(2).build();
    mFileSystem.setAttribute(new AlluxioURI(rootDir), opts);
    HeartbeatScheduler.execute(HeartbeatContext.MASTER_REPLICATION_CHECK);
    // After logging we expect only one log message to be logged as the job master has a zero job
    // capacity even though there should be 10 replication jobs.
    Assert.assertEquals(1, mLogger.logCount("The job service is busy, will retry later."));
    Assert.assertEquals(2, mLogger.logCount("Job master is at full capacity of 0 jobs"));
}
Also used : SetAttributePOptions(alluxio.grpc.SetAttributePOptions) AlluxioURI(alluxio.AlluxioURI) JobIntegrationTest(alluxio.job.JobIntegrationTest) Test(org.junit.Test)

Aggregations

SetAttributePOptions (alluxio.grpc.SetAttributePOptions)31 AlluxioURI (alluxio.AlluxioURI)20 Test (org.junit.Test)17 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)11 Mode (alluxio.security.authorization.Mode)6 URIStatus (alluxio.client.file.URIStatus)3 ConfigurationRule (alluxio.ConfigurationRule)2 BaseIntegrationTest (alluxio.testutils.BaseIntegrationTest)2 Closeable (java.io.Closeable)2 FileAlreadyExistsException (java.nio.file.FileAlreadyExistsException)2 InvalidPathException (java.nio.file.InvalidPathException)2 FuseContext (ru.serce.jnrfuse.struct.FuseContext)2 FileOutStream (alluxio.client.file.FileOutStream)1 FileSystem (alluxio.client.file.FileSystem)1 AlluxioException (alluxio.exception.AlluxioException)1 CreateFilePOptions (alluxio.grpc.CreateFilePOptions)1 GetStatusPOptions (alluxio.grpc.GetStatusPOptions)1 FuseContext (alluxio.jnifuse.struct.FuseContext)1 JobIntegrationTest (alluxio.job.JobIntegrationTest)1 ListAllMyBucketsResult (alluxio.proxy.s3.ListAllMyBucketsResult)1