use of com.facebook.buck.distributed.thrift.StoreBuildGraphRequest in project buck by facebook.
the class DistBuildService method uploadTargetGraph.
public ListenableFuture<Void> uploadTargetGraph(final BuildJobState buildJobStateArg, final StampedeId stampedeId, ListeningExecutorService executorService) {
// TODO(shivanker): We shouldn't be doing this. Fix after we stop reading all files into memory.
final BuildJobState buildJobState = buildJobStateArg.deepCopy();
return executorService.submit(() -> {
// Get rid of file contents from buildJobState
for (BuildJobStateFileHashes cell : buildJobState.getFileHashes()) {
if (!cell.isSetEntries()) {
continue;
}
for (BuildJobStateFileHashEntry file : cell.getEntries()) {
file.unsetContents();
}
}
// Now serialize and send the whole buildJobState
StoreBuildGraphRequest storeBuildGraphRequest = new StoreBuildGraphRequest();
storeBuildGraphRequest.setStampedeId(stampedeId);
storeBuildGraphRequest.setBuildGraph(BuildJobStateSerializer.serialize(buildJobState));
FrontendRequest request = new FrontendRequest();
request.setType(FrontendRequestType.STORE_BUILD_GRAPH);
request.setStoreBuildGraphRequest(storeBuildGraphRequest);
makeRequestChecked(request);
// No response expected.
return null;
});
}
Aggregations