use of org.apache.hadoop.ozone.OzoneConsts.TRANSACTION_INFO_KEY in project ozone by apache.
the class InterSCMGrpcService method download.
@Override
public void download(CopyDBCheckpointRequestProto request, StreamObserver<CopyDBCheckpointResponseProto> responseObserver) {
try {
scm.getScmHAManager().asSCMHADBTransactionBuffer().flush();
Table<String, TransactionInfo> transactionInfoTable = Arrays.stream(new SCMDBDefinition().getColumnFamilies()).filter(t -> t.getValueType() == TransactionInfo.class).findFirst().get().getTable(scm.getScmMetadataStore().getStore());
TransactionInfo transactionInfo = transactionInfoTable.get(TRANSACTION_INFO_KEY);
Preconditions.checkNotNull(transactionInfo);
SCMGrpcOutputStream outputStream = new SCMGrpcOutputStream(responseObserver, scm.getClusterId(), BUFFER_SIZE);
provider.writeDBCheckPointToSream(outputStream, request.getFlush());
} catch (IOException e) {
LOG.error("Error streaming SCM DB checkpoint", e);
responseObserver.onError(e);
}
}
Aggregations