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"));
}
Aggregations