use of com.github.ambry.server.ServerErrorCode in project ambry by linkedin.
the class ServerAdminTool method getBlob.
/**
* Gets blob data for {@code blobId}.
* @param dataNodeId the {@link DataNodeId} to contact.
* @param blobId the {@link BlobId} to operate on.
* @param getOption the {@link GetOption} to send with the {@link GetRequest}.
* @param clusterMap the {@link ClusterMap} to use.
* @return the {@link ServerErrorCode} and {@link BlobData} for {@code blobId}
* @throws Exception
*/
public Pair<ServerErrorCode, BlobData> getBlob(DataNodeId dataNodeId, BlobId blobId, GetOption getOption, ClusterMap clusterMap) throws Exception {
Pair<ServerErrorCode, InputStream> response = getGetResponse(dataNodeId, blobId, MessageFormatFlags.Blob, getOption, clusterMap);
InputStream stream = response.getSecond();
BlobData blobData = stream != null ? MessageFormatRecord.deserializeBlob(stream) : null;
return new Pair<>(response.getFirst(), blobData);
}
Aggregations