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