@Test public void getReplicasWithBadInputTest() { try { getReplicasHandler.getReplicas("12345", new MockRestResponseChannel()); fail("Exception should have been thrown because the blobid is invalid"); } catch (RestServiceException e) { assertEquals("Unexpected RestServiceErrorCode", RestServiceErrorCode.NotFound, e.getErrorCode()); } String blobId = "AAEAAQAAAAAAAADFAAAAJDMyYWZiOTJmLTBkNDYtNDQyNS1iYzU0LWEwMWQ1Yzg3OTJkZQ.gif"; try { getReplicasHandler.getReplicas(blobId, new MockRestResponseChannel()); fail("Exception should have been thrown because the blobid is invalid"); } catch (RestServiceException e) { assertEquals("Unexpected RestServiceErrorCode", RestServiceErrorCode.NotFound, e.getErrorCode()); } }
ReadableStreamChannel getReplicas(String blobId, RestResponseChannel restResponseChannel) throws RestServiceException { logger.trace("Getting replicas of blob ID - {}", blobId); long startTime = System.currentTimeMillis(); ReadableStreamChannel channel = null; try { channel = FrontendUtils.serializeJsonToChannel(getReplicas(blobId)); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, channel.getSize()); } finally { metrics.getReplicasProcessingTimeInMs.update(System.currentTimeMillis() - startTime); } return channel; }
GetReplicasHandler { ReadableStreamChannel getReplicas(String blobId, RestResponseChannel restResponseChannel) throws RestServiceException { logger.trace("Getting replicas of blob ID - {}", blobId); long startTime = System.currentTimeMillis(); ReadableStreamChannel channel = null; try { channel = FrontendUtils.serializeJsonToChannel(getReplicas(blobId)); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, channel.getSize()); } finally { metrics.getReplicasProcessingTimeInMs.update(System.currentTimeMillis() - startTime); } return channel; } }
GetReplicasHandler { ReadableStreamChannel getReplicas(String blobId, RestResponseChannel restResponseChannel) throws RestServiceException { logger.trace("Getting replicas of blob ID - {}", blobId); long startTime = System.currentTimeMillis(); ReadableStreamChannel channel = null; try { channel = FrontendUtils.serializeJsonToChannel(getReplicas(blobId)); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, channel.getSize()); } finally { metrics.getReplicasProcessingTimeInMs.update(System.currentTimeMillis() - startTime); } return channel; } GetReplicasHandler(FrontendMetrics metrics, ClusterMap clusterMap); }
GetReplicasHandler { ReadableStreamChannel getReplicas(String blobId, RestResponseChannel restResponseChannel) throws RestServiceException { logger.trace("Getting replicas of blob ID - {}", blobId); long startTime = System.currentTimeMillis(); ReadableStreamChannel channel = null; try { channel = FrontendUtils.serializeJsonToChannel(getReplicas(blobId)); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, channel.getSize()); } finally { metrics.getReplicasProcessingTimeInMs.update(System.currentTimeMillis() - startTime); } return channel; } GetReplicasHandler(FrontendMetrics metrics, ClusterMap clusterMap);  }
GetReplicasHandler { ReadableStreamChannel getReplicas(String blobId, RestResponseChannel restResponseChannel) throws RestServiceException { logger.trace("Getting replicas of blob ID - {}", blobId); long startTime = System.currentTimeMillis(); ReadableStreamChannel channel = null; try { channel = FrontendUtils.serializeJsonToChannel(getReplicas(blobId)); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, channel.getSize()); } finally { metrics.getReplicasProcessingTimeInMs.update(System.currentTimeMillis() - startTime); } return channel; } GetReplicasHandler(FrontendMetrics metrics, ClusterMap clusterMap);   }