Skip to content

Commit

Permalink
update from proto names
Browse files Browse the repository at this point in the history
  • Loading branch information
rohdesamuel committed Feb 13, 2023
1 parent fe9ab2a commit 07d37ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public class ProcessBundleHandler {
private final Cache<Object, Object> processWideCache;
@VisibleForTesting final BundleProcessorCache bundleProcessorCache;
private final Set<String> runnerCapabilities;

private final @Nullable DataSampler dataSampler;

public ProcessBundleHandler(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ byte[] encodeString(String s) throws IOException {
BeamFnApi.InstructionResponse getAllSamples(DataSampler dataSampler) {
BeamFnApi.InstructionRequest request =
BeamFnApi.InstructionRequest.newBuilder()
.setSample(BeamFnApi.SampleDataRequest.newBuilder().build())
.setSampleData(BeamFnApi.SampleDataRequest.newBuilder().build())
.build();
return dataSampler.handleDataSampleRequest(request).build();
}
Expand All @@ -66,7 +66,7 @@ BeamFnApi.InstructionResponse getSamplesForPCollection(
DataSampler dataSampler, String pcollection) {
BeamFnApi.InstructionRequest request =
BeamFnApi.InstructionRequest.newBuilder()
.setSample(
.setSampleData(
BeamFnApi.SampleDataRequest.newBuilder().addPcollectionIds(pcollection).build())
.build();
return dataSampler.handleDataSampleRequest(request).build();
Expand All @@ -76,7 +76,7 @@ BeamFnApi.InstructionResponse getSamplesForPCollections(
DataSampler dataSampler, Iterable<String> pcollections) {
BeamFnApi.InstructionRequest request =
BeamFnApi.InstructionRequest.newBuilder()
.setSample(
.setSampleData(
BeamFnApi.SampleDataRequest.newBuilder().addAllPcollectionIds(pcollections).build())
.build();
return dataSampler.handleDataSampleRequest(request).build();
Expand All @@ -85,7 +85,7 @@ BeamFnApi.InstructionResponse getSamplesForPCollections(
void assertHasSamples(
BeamFnApi.InstructionResponse response, String pcollection, Iterable<byte[]> elements) {
Map<String, BeamFnApi.SampleDataResponse.ElementList> elementSamplesMap =
response.getSample().getElementSamplesMap();
response.getSampleData().getElementSamplesMap();

assertFalse(elementSamplesMap.isEmpty());

Expand Down Expand Up @@ -189,7 +189,7 @@ public void testFiltersMultiplePCollectionIds() throws Exception {
generateStringSamples(sampler);

BeamFnApi.InstructionResponse samples = getSamplesForPCollections(sampler, pcollectionIds);
assertThat(samples.getSample().getElementSamplesMap().size(), equalTo(2));
assertThat(samples.getSampleData().getElementSamplesMap().size(), equalTo(2));
assertHasSamples(samples, "a", ImmutableList.of(encodeString("a1"), encodeString("a2")));
assertHasSamples(samples, "c", ImmutableList.of(encodeString("c1"), encodeString("c2")));
}
Expand Down

0 comments on commit 07d37ea

Please sign in to comment.