use of com.walmartlabs.concord.runtime.v2.model.Location in project metacat by Netflix.
the class S3ConnectorInfoConverter method toFields.
private List<FieldInfo> toFields(final Table table) {
List<FieldInfo> result = Lists.newArrayList();
final Location location = table.getLocation();
if (location != null) {
final Schema schema = location.getSchema();
if (schema != null) {
result = schema.getFields().stream().sorted(Comparator.comparing(Field::getPos)).map(this::toFieldInfo).collect(Collectors.toList());
}
}
return result;
}
use of com.walmartlabs.concord.runtime.v2.model.Location in project metacat by Netflix.
the class S3ConnectorInfoConverter method toAuditInfo.
/**
* Creates audit info from s3 table info.
* @param table table info
* @return audit info
*/
public AuditInfo toAuditInfo(final Table table) {
final AuditInfo result = AuditInfo.builder().createdDate(table.getCreatedDate()).lastModifiedDate(table.getLastUpdatedDate()).build();
final Location location = table.getLocation();
if (location != null) {
final Info info = location.getInfo();
if (info != null) {
result.setCreatedBy(info.getOwner());
result.setLastModifiedBy(info.getOwner());
}
}
return result;
}
use of com.walmartlabs.concord.runtime.v2.model.Location in project metacat by Netflix.
the class S3ConnectorInfoConverter method toLocation.
/**
* Creates location.
* @param tableInfo table info
* @return location
*/
public Location toLocation(final TableInfo tableInfo) {
final Location location = fromStorageInfo(tableInfo.getSerde());
final Schema schema = new Schema();
schema.setLocation(location);
schema.setFields(toFields(tableInfo, schema));
location.setSchema(schema);
return location;
}
use of com.walmartlabs.concord.runtime.v2.model.Location in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineApplicationCreateDialog method doOKAction.
@Override
protected void doOKAction() {
final Location selectedLocation = ((AppEngineLocationSelectorItem) regionComboBox.getSelectedItem()).getLocation();
// show loading state
disable();
try {
UsageTrackerProvider.getInstance().trackEvent(GctTracking.APP_ENGINE_APPLICATION_CREATE).ping();
// attempt to create the application, and close the dialog if successful
ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> AppEngineAdminService.getInstance().createApplication(selectedLocation.getLocationId(), gcpProjectId, userCredential), GctBundle.message("appengine.application.create.loading", selectedLocation.getLocationId()), true, /* cancellable */
ProjectManager.getInstance().getDefaultProject());
UsageTrackerProvider.getInstance().trackEvent(GctTracking.APP_ENGINE_APPLICATION_CREATE_SUCCESS).ping();
close(OK_EXIT_CODE);
} catch (IOException e) {
trackApplicationCreateFailure();
setStatusMessage(GctBundle.message("appengine.application.create.error.transient"), true);
} catch (GoogleApiException e) {
trackApplicationCreateFailure();
setStatusMessage(e.getMessage(), true);
} catch (Exception e) {
trackApplicationCreateFailure();
throw new RuntimeException(e);
} finally {
enable();
}
}
use of com.walmartlabs.concord.runtime.v2.model.Location in project google-cloud-intellij by GoogleCloudPlatform.
the class GoogleApiClientAppEngineAdminService method fetchAllAppEngineLocations.
private List<Location> fetchAllAppEngineLocations(Credential credential) throws GoogleApiException, IOException {
try {
ListLocationsResponse response = fetchAppEngineLocationPage(credential, null);
List<Location> locations = new ArrayList<>(response.getLocations());
while (response.getNextPageToken() != null) {
response = fetchAppEngineLocationPage(credential, response.getNextPageToken());
locations.addAll(response.getLocations());
}
return locations;
} catch (GoogleJsonResponseException e) {
throw GoogleApiException.from(e);
}
}
Aggregations