use of com.google.cloud.datacatalog.v1beta1.LookupEntryRequest in project DataflowTemplates by GoogleCloudPlatform.
the class DataCatalogSchemaUtils method lookupPubSubEntry.
static Entry lookupPubSubEntry(DataCatalogClient client, String pubsubTopic, String gcpProject) {
String linkedResource = String.format(DATA_CATALOG_PUBSUB_URI_TEMPLATE, gcpProject, pubsubTopic);
LOG.info("Looking up LinkedResource {}", linkedResource);
LookupEntryRequest request = LookupEntryRequest.newBuilder().setLinkedResource(linkedResource).build();
try {
Entry entry = client.lookupEntry(request);
return entry;
} catch (ApiException e) {
System.out.println("CANT LOOKUP ENTRY" + e.toString());
e.printStackTrace();
LOG.error("ApiException thrown by Data Catalog API:", e);
return null;
}
}
Aggregations