use of com.google.cloud.logging.Sink in project google-cloud-java by GoogleCloudPlatform.
the class LoggingSnippets method getSinkAsync.
/**
* Example of asynchronously getting a sink.
*/
// [TARGET getSinkAsync(String)]
// [VARIABLE "my_sink_name"]
public Sink getSinkAsync(String sinkName) throws ExecutionException, InterruptedException {
// [START getSinkAsync]
Future<Sink> future = logging.getSinkAsync(sinkName);
// ...
Sink sink = future.get();
if (sink == null) {
// sink was not found
}
// [END getSinkAsync]
return sink;
}