Search in sources :

Example 1 with AdminRequestOrResponseType

use of com.github.ambry.protocol.AdminRequestOrResponseType in project ambry by linkedin.

the class AmbryRequestsTest method controlRequestSuccessTest.

/**
 * Tests that {@link AdminRequestOrResponseType#RequestControl} works correctly.
 * @throws InterruptedException
 * @throws IOException
 */
@Test
public void controlRequestSuccessTest() throws InterruptedException, IOException {
    RequestOrResponseType[] requestOrResponseTypes = { RequestOrResponseType.PutRequest, RequestOrResponseType.DeleteRequest, RequestOrResponseType.GetRequest, RequestOrResponseType.ReplicaMetadataRequest };
    for (RequestOrResponseType requestType : requestOrResponseTypes) {
        List<? extends PartitionId> partitionIds = clusterMap.getWritablePartitionIds();
        for (PartitionId id : partitionIds) {
            doRequestControlRequestTest(requestType, id);
        }
        doRequestControlRequestTest(requestType, null);
    }
}
Also used : AdminRequestOrResponseType(com.github.ambry.protocol.AdminRequestOrResponseType) RequestOrResponseType(com.github.ambry.protocol.RequestOrResponseType) PartitionId(com.github.ambry.clustermap.PartitionId) UtilsTest(com.github.ambry.utils.UtilsTest) Test(org.junit.Test)

Example 2 with AdminRequestOrResponseType

use of com.github.ambry.protocol.AdminRequestOrResponseType in project ambry by linkedin.

the class AmbryServerRequestsTest method controlRequestSuccessTest.

/**
 * Tests that {@link AdminRequestOrResponseType#RequestControl} works correctly.
 * @throws InterruptedException
 * @throws IOException
 */
@Test
public void controlRequestSuccessTest() throws InterruptedException, IOException {
    RequestOrResponseType[] requestOrResponseTypes = { RequestOrResponseType.PutRequest, RequestOrResponseType.DeleteRequest, RequestOrResponseType.GetRequest, RequestOrResponseType.ReplicaMetadataRequest, RequestOrResponseType.TtlUpdateRequest, RequestOrResponseType.UndeleteRequest };
    for (RequestOrResponseType requestType : requestOrResponseTypes) {
        List<? extends PartitionId> partitionIds = clusterMap.getWritablePartitionIds(DEFAULT_PARTITION_CLASS);
        for (PartitionId id : partitionIds) {
            doRequestControlRequestTest(requestType, id);
        }
        doRequestControlRequestTest(requestType, null);
    }
}
Also used : AdminRequestOrResponseType(com.github.ambry.protocol.AdminRequestOrResponseType) RequestOrResponseType(com.github.ambry.protocol.RequestOrResponseType) MockPartitionId(com.github.ambry.clustermap.MockPartitionId) PartitionId(com.github.ambry.clustermap.PartitionId) Test(org.junit.Test) MessageInfoTest(com.github.ambry.store.MessageInfoTest) MessageFormatInputStreamTest(com.github.ambry.messageformat.MessageFormatInputStreamTest)

Aggregations

PartitionId (com.github.ambry.clustermap.PartitionId)2 AdminRequestOrResponseType (com.github.ambry.protocol.AdminRequestOrResponseType)2 RequestOrResponseType (com.github.ambry.protocol.RequestOrResponseType)2 Test (org.junit.Test)2 MockPartitionId (com.github.ambry.clustermap.MockPartitionId)1 MessageFormatInputStreamTest (com.github.ambry.messageformat.MessageFormatInputStreamTest)1 MessageInfoTest (com.github.ambry.store.MessageInfoTest)1 UtilsTest (com.github.ambry.utils.UtilsTest)1