Search in sources :

Example 11 with RequestOrResponseType

use of com.github.ambry.protocol.RequestOrResponseType 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

RequestOrResponseType (com.github.ambry.protocol.RequestOrResponseType)11 RequestOrResponse (com.github.ambry.protocol.RequestOrResponse)5 PartitionId (com.github.ambry.clustermap.PartitionId)4 AdminRequestOrResponseType (com.github.ambry.protocol.AdminRequestOrResponseType)4 RequestInfo (com.github.ambry.network.RequestInfo)3 ResponseInfo (com.github.ambry.network.ResponseInfo)3 AdminResponse (com.github.ambry.protocol.AdminResponse)3 CatchupStatusAdminResponse (com.github.ambry.protocol.CatchupStatusAdminResponse)3 ClusterMap (com.github.ambry.clustermap.ClusterMap)2 MessageFormatException (com.github.ambry.messageformat.MessageFormatException)2 MessageFormatInputStreamTest (com.github.ambry.messageformat.MessageFormatInputStreamTest)2 GetResponse (com.github.ambry.protocol.GetResponse)2 PartitionResponseInfo (com.github.ambry.protocol.PartitionResponseInfo)2 RequestControlAdminRequest (com.github.ambry.protocol.RequestControlAdminRequest)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Map (java.util.Map)2 Test (org.junit.Test)2