Skip to content

Commit

Permalink
Fixed OperationalFuture references.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtisvg committed Nov 13, 2017
1 parent bbc6669 commit ada14ac
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 24 deletions.
8 changes: 4 additions & 4 deletions dlp/src/main/java/com/example/dlp/Inspect.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.example.dlp;

import com.google.api.gax.rpc.OperationFuture;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.cloud.ServiceOptions;
import com.google.cloud.dlp.v2beta1.DlpServiceClient;
import com.google.longrunning.Operation;
Expand Down Expand Up @@ -235,7 +235,7 @@ private static void inspectGcsFile(
OutputStorageConfig outputConfig = OutputStorageConfig.getDefaultInstance();

// asynchronously submit an inspect operation
OperationFuture<InspectOperationResult, InspectOperationMetadata, Operation> responseFuture =
OperationFuture<InspectOperationResult, InspectOperationMetadata> responseFuture =
dlpServiceClient.createInspectOperationAsync(inspectConfig, storageConfig, outputConfig);

// ...
Expand Down Expand Up @@ -309,7 +309,7 @@ private static void inspectDatastore(
OutputStorageConfig outputConfig = OutputStorageConfig.getDefaultInstance();

// asynchronously submit an inspect operation
OperationFuture<InspectOperationResult, InspectOperationMetadata, Operation> responseFuture =
OperationFuture<InspectOperationResult, InspectOperationMetadata> responseFuture =
dlpServiceClient.createInspectOperationAsync(inspectConfig, storageConfig, outputConfig);

// ...
Expand Down Expand Up @@ -387,7 +387,7 @@ private static void inspectBigquery(
OutputStorageConfig outputConfig = OutputStorageConfig.getDefaultInstance();

// asynchronously submit an inspect operation
OperationFuture<InspectOperationResult, InspectOperationMetadata, Operation> responseFuture =
OperationFuture<InspectOperationResult, InspectOperationMetadata> responseFuture =
dlpServiceClient.createInspectOperationAsync(
inspectConfig, storageConfig, outputConfig);

Expand Down
10 changes: 5 additions & 5 deletions dlp/src/main/java/com/example/dlp/RiskAnalysis.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.example.dlp;

import com.google.api.gax.rpc.OperationFuture;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.cloud.ServiceOptions;
import com.google.cloud.dlp.v2beta1.DlpServiceClient;
import com.google.longrunning.Operation;
Expand Down Expand Up @@ -102,7 +102,7 @@ private static void calculateNumericalStats(
.build();

// asynchronously submit a risk analysis operation
OperationFuture<RiskAnalysisOperationResult, RiskAnalysisOperationMetadata, Operation>
OperationFuture<RiskAnalysisOperationResult, RiskAnalysisOperationMetadata>
responseFuture = dlpServiceClient.analyzeDataSourceRiskAsync(request);

// ...
Expand Down Expand Up @@ -180,7 +180,7 @@ private static void calculateCategoricalStats(
.build();

// asynchronously submit a risk analysis operation
OperationFuture<RiskAnalysisOperationResult, RiskAnalysisOperationMetadata, Operation>
OperationFuture<RiskAnalysisOperationResult, RiskAnalysisOperationMetadata>
responseFuture = dlpServiceClient.analyzeDataSourceRiskAsync(request);

// ...
Expand Down Expand Up @@ -259,7 +259,7 @@ private static void calculateKAnonymity(
.build();

// asynchronously submit a risk analysis operation
OperationFuture<RiskAnalysisOperationResult, RiskAnalysisOperationMetadata, Operation>
OperationFuture<RiskAnalysisOperationResult, RiskAnalysisOperationMetadata>
responseFuture = dlpServiceClient.analyzeDataSourceRiskAsync(request);

// ...
Expand Down Expand Up @@ -352,7 +352,7 @@ private static void calculateLDiversity(
.build();

// asynchronously submit a risk analysis operation
OperationFuture<RiskAnalysisOperationResult, RiskAnalysisOperationMetadata, Operation>
OperationFuture<RiskAnalysisOperationResult, RiskAnalysisOperationMetadata>
responseFuture = dlpServiceClient.analyzeDataSourceRiskAsync(request);

// ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import com.google.api.gax.rpc.ApiStreamObserver;
import com.google.api.gax.rpc.BidiStreamingCallable;
import com.google.api.gax.rpc.OperationFuture;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.cloud.speech.v1.LongRunningRecognizeMetadata;
import com.google.cloud.speech.v1.LongRunningRecognizeResponse;
import com.google.cloud.speech.v1.RecognitionAudio;
Expand All @@ -34,7 +34,6 @@
import com.google.cloud.speech.v1.StreamingRecognizeResponse;
import com.google.cloud.speech.v1.WordInfo;
import com.google.common.util.concurrent.SettableFuture;
import com.google.longrunning.Operation;
import com.google.protobuf.ByteString;
import java.io.IOException;
import java.nio.file.Files;
Expand Down Expand Up @@ -221,8 +220,7 @@ public static void asyncRecognizeFile(String fileName) throws Exception, IOExcep
.build();

// Use non-blocking call for getting file transcription
OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata,
Operation> response =
OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata> response =
speech.longRunningRecognizeAsync(config, audio);

while (!response.isDone()) {
Expand Down Expand Up @@ -263,8 +261,7 @@ public static void asyncRecognizeWords(String gcsUri) throws Exception, IOExcept
.build();

// Use non-blocking call for getting file transcription
OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata,
Operation> response =
OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata> response =
speech.longRunningRecognizeAsync(config, audio);
while (!response.isDone()) {
System.out.println("Waiting for response...");
Expand Down Expand Up @@ -311,8 +308,7 @@ public static void asyncRecognizeGcs(String gcsUri) throws Exception, IOExceptio
.build();

// Use non-blocking call for getting file transcription
OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata,
Operation> response =
OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata> response =
speech.longRunningRecognizeAsync(config, audio);
while (!response.isDone()) {
System.out.println("Waiting for response...");
Expand Down
12 changes: 6 additions & 6 deletions video/cloud-client/src/main/java/com/example/video/Detect.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.example.video;

import com.google.api.gax.rpc.OperationFuture;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.cloud.videointelligence.v1beta2.AnnotateVideoProgress;
import com.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest;
import com.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse;
Expand Down Expand Up @@ -113,7 +113,7 @@ public static void analyzeFaces(String gcsUri) throws Exception {
.build();

// asynchronously perform facial analysis on videos
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> response
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> response
= client.annotateVideoAsync(request);

boolean faceFound = false;
Expand Down Expand Up @@ -174,7 +174,7 @@ public static void analyzeLabels(String gcsUri) throws Exception {
.addFeatures(Feature.LABEL_DETECTION)
.build();
// Create an operation that will contain the response when the operation completes.
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down Expand Up @@ -261,7 +261,7 @@ public static void analyzeLabelsFile(String filePath) throws Exception {
.build();

// Create an operation that will contain the response when the operation completes.
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down Expand Up @@ -344,7 +344,7 @@ public static void analyzeShots(String gcsUri) throws Exception {
.build();

// Create an operation that will contain the response when the operation completes.
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
client.annotateVideoAsync(request);
System.out.println("Waiting for operation to complete...");

Expand Down Expand Up @@ -382,7 +382,7 @@ public static void analyzeExplicitContent(String gcsUri) throws Exception {
.addFeatures(Feature.EXPLICIT_CONTENT_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// [START videointelligence_quickstart]

import com.google.api.gax.rpc.OperationFuture;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.cloud.videointelligence.v1beta2.AnnotateVideoProgress;
import com.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest;
import com.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse;
Expand Down

0 comments on commit ada14ac

Please sign in to comment.