Search in sources :

Example 1 with TestJobService

use of org.apache.beam.runners.portability.testing.TestJobService in project beam by apache.

the class PortableRunnerTest method createJobServer.

private void createJobServer(JobState.Enum jobState, JobApi.MetricResults metricResults) throws IOException {
    ArtifactStagingService stagingService = new ArtifactStagingService(new ArtifactStagingService.ArtifactDestinationProvider() {

        @Override
        public ArtifactStagingService.ArtifactDestination getDestination(String stagingToken, String name) throws IOException {
            return ArtifactStagingService.ArtifactDestination.create("/dev/null", ByteString.EMPTY, ByteStreams.nullOutputStream());
        }

        @Override
        public void removeStagedArtifacts(String stagingToken) {
        }
    });
    stagingService.registerJob("TestStagingToken", ImmutableMap.of());
    Server server = grpcCleanupRule.register(InProcessServerBuilder.forName(ENDPOINT_URL).addService(new TestJobService(ENDPOINT_DESCRIPTOR, "prepId", "jobId", jobState, metricResults)).addService(stagingService).build());
    server.start();
}
Also used : Server(org.apache.beam.vendor.grpc.v1p43p2.io.grpc.Server) TestJobService(org.apache.beam.runners.portability.testing.TestJobService) ByteString(org.apache.beam.vendor.grpc.v1p43p2.com.google.protobuf.ByteString) IOException(java.io.IOException) ArtifactStagingService(org.apache.beam.runners.fnexecution.artifact.ArtifactStagingService)

Aggregations

IOException (java.io.IOException)1 ArtifactStagingService (org.apache.beam.runners.fnexecution.artifact.ArtifactStagingService)1 TestJobService (org.apache.beam.runners.portability.testing.TestJobService)1 ByteString (org.apache.beam.vendor.grpc.v1p43p2.com.google.protobuf.ByteString)1 Server (org.apache.beam.vendor.grpc.v1p43p2.io.grpc.Server)1