Search in sources :

Example 1 with OMKeyCreateRequest

use of org.apache.hadoop.ozone.om.request.key.OMKeyCreateRequest in project ozone by apache.

the class TestCleanupTableInfo method anOMKeyCreateRequest.

private OMKeyCreateRequest anOMKeyCreateRequest() {
    OMRequest protoRequest = mock(OMRequest.class);
    when(protoRequest.getCreateKeyRequest()).thenReturn(aKeyCreateRequest());
    when(protoRequest.getCmdType()).thenReturn(Type.CreateKey);
    when(protoRequest.getTraceID()).thenReturn("");
    return new OMKeyCreateRequest(protoRequest);
}
Also used : OMRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest) OMKeyCreateRequest(org.apache.hadoop.ozone.om.request.key.OMKeyCreateRequest)

Example 2 with OMKeyCreateRequest

use of org.apache.hadoop.ozone.om.request.key.OMKeyCreateRequest in project ozone by apache.

the class TestCleanupTableInfo method testKeyCreateRequestSetsAllTouchedTableCachesForEviction.

@Test
public void testKeyCreateRequestSetsAllTouchedTableCachesForEviction() {
    OMKeyCreateRequest request = anOMKeyCreateRequest();
    when(om.getEnableFileSystemPaths()).thenReturn(true);
    Map<String, Integer> cacheItemCount = recordCacheItemCounts();
    request.validateAndUpdateCache(om, 1, dbh);
    assertCacheItemCounts(cacheItemCount, OMKeyCreateResponse.class);
    verify(omMetrics, times(1)).incNumKeyAllocates();
}
Also used : OMKeyCreateRequest(org.apache.hadoop.ozone.om.request.key.OMKeyCreateRequest) Test(org.junit.Test)

Aggregations

OMKeyCreateRequest (org.apache.hadoop.ozone.om.request.key.OMKeyCreateRequest)2 OMRequest (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest)1 Test (org.junit.Test)1