use of com.google.cloud.aiplatform.v1.Dataset in project java-aiplatform by googleapis.
the class CreateTrainingPipelineImageObjectDetectionSample method createTrainingPipelineImageObjectDetectionSample.
static void createTrainingPipelineImageObjectDetectionSample(String project, String trainingPipelineDisplayName, String datasetId, String modelDisplayName) throws IOException {
PipelineServiceSettings pipelineServiceSettings = PipelineServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create(pipelineServiceSettings)) {
String location = "us-central1";
String trainingTaskDefinition = "gs://google-cloud-aiplatform/schema/trainingjob/definition/" + "automl_image_object_detection_1.0.0.yaml";
LocationName locationName = LocationName.of(project, location);
AutoMlImageObjectDetectionInputs autoMlImageObjectDetectionInputs = AutoMlImageObjectDetectionInputs.newBuilder().setModelType(ModelType.CLOUD_HIGH_ACCURACY_1).setBudgetMilliNodeHours(20000).setDisableEarlyStopping(false).build();
InputDataConfig trainingInputDataConfig = InputDataConfig.newBuilder().setDatasetId(datasetId).build();
Model model = Model.newBuilder().setDisplayName(modelDisplayName).build();
TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().setDisplayName(trainingPipelineDisplayName).setTrainingTaskDefinition(trainingTaskDefinition).setTrainingTaskInputs(ValueConverter.toValue(autoMlImageObjectDetectionInputs)).setInputDataConfig(trainingInputDataConfig).setModelToUpload(model).build();
TrainingPipeline trainingPipelineResponse = pipelineServiceClient.createTrainingPipeline(locationName, trainingPipeline);
System.out.println("Create Training Pipeline Image Object Detection Response");
System.out.format("Name: %s\n", trainingPipelineResponse.getName());
System.out.format("Display Name: %s\n", trainingPipelineResponse.getDisplayName());
System.out.format("Training Task Definition %s\n", trainingPipelineResponse.getTrainingTaskDefinition());
System.out.format("Training Task Inputs: %s\n", trainingPipelineResponse.getTrainingTaskInputs());
System.out.format("Training Task Metadata: %s\n", trainingPipelineResponse.getTrainingTaskMetadata());
System.out.format("State: %s\n", trainingPipelineResponse.getState());
System.out.format("Create Time: %s\n", trainingPipelineResponse.getCreateTime());
System.out.format("StartTime %s\n", trainingPipelineResponse.getStartTime());
System.out.format("End Time: %s\n", trainingPipelineResponse.getEndTime());
System.out.format("Update Time: %s\n", trainingPipelineResponse.getUpdateTime());
System.out.format("Labels: %s\n", trainingPipelineResponse.getLabelsMap());
InputDataConfig inputDataConfig = trainingPipelineResponse.getInputDataConfig();
System.out.println("Input Data Config");
System.out.format("Dataset Id: %s", inputDataConfig.getDatasetId());
System.out.format("Annotations Filter: %s\n", inputDataConfig.getAnnotationsFilter());
FractionSplit fractionSplit = inputDataConfig.getFractionSplit();
System.out.println("Fraction Split");
System.out.format("Training Fraction: %s\n", fractionSplit.getTrainingFraction());
System.out.format("Validation Fraction: %s\n", fractionSplit.getValidationFraction());
System.out.format("Test Fraction: %s\n", fractionSplit.getTestFraction());
FilterSplit filterSplit = inputDataConfig.getFilterSplit();
System.out.println("Filter Split");
System.out.format("Training Filter: %s\n", filterSplit.getTrainingFilter());
System.out.format("Validation Filter: %s\n", filterSplit.getValidationFilter());
System.out.format("Test Filter: %s\n", filterSplit.getTestFilter());
PredefinedSplit predefinedSplit = inputDataConfig.getPredefinedSplit();
System.out.println("Predefined Split");
System.out.format("Key: %s\n", predefinedSplit.getKey());
TimestampSplit timestampSplit = inputDataConfig.getTimestampSplit();
System.out.println("Timestamp Split");
System.out.format("Training Fraction: %s\n", timestampSplit.getTrainingFraction());
System.out.format("Validation Fraction: %s\n", timestampSplit.getValidationFraction());
System.out.format("Test Fraction: %s\n", timestampSplit.getTestFraction());
System.out.format("Key: %s\n", timestampSplit.getKey());
Model modelResponse = trainingPipelineResponse.getModelToUpload();
System.out.println("Model To Upload");
System.out.format("Name: %s\n", modelResponse.getName());
System.out.format("Display Name: %s\n", modelResponse.getDisplayName());
System.out.format("Description: %s\n", modelResponse.getDescription());
System.out.format("Metadata Schema Uri: %s\n", modelResponse.getMetadataSchemaUri());
System.out.format("Metadata: %s\n", modelResponse.getMetadata());
System.out.format("Training Pipeline: %s\n", modelResponse.getTrainingPipeline());
System.out.format("Artifact Uri: %s\n", modelResponse.getArtifactUri());
System.out.format("Supported Deployment Resources Types: %s\n", modelResponse.getSupportedDeploymentResourcesTypesList());
System.out.format("Supported Input Storage Formats: %s\n", modelResponse.getSupportedInputStorageFormatsList());
System.out.format("Supported Output Storage Formats: %s\n", modelResponse.getSupportedOutputStorageFormatsList());
System.out.format("Create Time: %s\n", modelResponse.getCreateTime());
System.out.format("Update Time: %s\n", modelResponse.getUpdateTime());
System.out.format("Labels: %sn\n", modelResponse.getLabelsMap());
PredictSchemata predictSchemata = modelResponse.getPredictSchemata();
System.out.println("Predict Schemata");
System.out.format("Instance Schema Uri: %s\n", predictSchemata.getInstanceSchemaUri());
System.out.format("Parameters Schema Uri: %s\n", predictSchemata.getParametersSchemaUri());
System.out.format("Prediction Schema Uri: %s\n", predictSchemata.getPredictionSchemaUri());
for (ExportFormat exportFormat : modelResponse.getSupportedExportFormatsList()) {
System.out.println("Supported Export Format");
System.out.format("Id: %s\n", exportFormat.getId());
}
ModelContainerSpec modelContainerSpec = modelResponse.getContainerSpec();
System.out.println("Container Spec");
System.out.format("Image Uri: %s\n", modelContainerSpec.getImageUri());
System.out.format("Command: %s\n", modelContainerSpec.getCommandList());
System.out.format("Args: %s\n", modelContainerSpec.getArgsList());
System.out.format("Predict Route: %s\n", modelContainerSpec.getPredictRoute());
System.out.format("Health Route: %s\n", modelContainerSpec.getHealthRoute());
for (EnvVar envVar : modelContainerSpec.getEnvList()) {
System.out.println("Env");
System.out.format("Name: %s\n", envVar.getName());
System.out.format("Value: %s\n", envVar.getValue());
}
for (Port port : modelContainerSpec.getPortsList()) {
System.out.println("Port");
System.out.format("Container Port: %s\n", port.getContainerPort());
}
for (DeployedModelRef deployedModelRef : modelResponse.getDeployedModelsList()) {
System.out.println("Deployed Model");
System.out.format("Endpoint: %s\n", deployedModelRef.getEndpoint());
System.out.format("Deployed Model Id: %s\n", deployedModelRef.getDeployedModelId());
}
Status status = trainingPipelineResponse.getError();
System.out.println("Error");
System.out.format("Code: %s\n", status.getCode());
System.out.format("Message: %s\n", status.getMessage());
}
}
use of com.google.cloud.aiplatform.v1.Dataset in project java-aiplatform by googleapis.
the class CreateBatchPredictionJobVideoClassificationSample method createBatchPredictionJobVideoClassification.
static void createBatchPredictionJobVideoClassification(String batchPredictionDisplayName, String modelId, String gcsSourceUri, String gcsDestinationOutputUriPrefix, String project) throws IOException {
JobServiceSettings jobServiceSettings = JobServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings)) {
String location = "us-central1";
LocationName locationName = LocationName.of(project, location);
VideoClassificationPredictionParams modelParamsObj = VideoClassificationPredictionParams.newBuilder().setConfidenceThreshold(((float) 0.5)).setMaxPredictions(10000).setSegmentClassification(true).setShotClassification(true).setOneSecIntervalClassification(true).build();
Value modelParameters = ValueConverter.toValue(modelParamsObj);
ModelName modelName = ModelName.of(project, location, modelId);
GcsSource.Builder gcsSource = GcsSource.newBuilder();
gcsSource.addUris(gcsSourceUri);
InputConfig inputConfig = InputConfig.newBuilder().setInstancesFormat("jsonl").setGcsSource(gcsSource).build();
GcsDestination gcsDestination = GcsDestination.newBuilder().setOutputUriPrefix(gcsDestinationOutputUriPrefix).build();
OutputConfig outputConfig = OutputConfig.newBuilder().setPredictionsFormat("jsonl").setGcsDestination(gcsDestination).build();
BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().setDisplayName(batchPredictionDisplayName).setModel(modelName.toString()).setModelParameters(modelParameters).setInputConfig(inputConfig).setOutputConfig(outputConfig).build();
BatchPredictionJob batchPredictionJobResponse = jobServiceClient.createBatchPredictionJob(locationName, batchPredictionJob);
System.out.println("Create Batch Prediction Job Video Classification Response");
System.out.format("\tName: %s\n", batchPredictionJobResponse.getName());
System.out.format("\tDisplay Name: %s\n", batchPredictionJobResponse.getDisplayName());
System.out.format("\tModel %s\n", batchPredictionJobResponse.getModel());
System.out.format("\tModel Parameters: %s\n", batchPredictionJobResponse.getModelParameters());
System.out.format("\tState: %s\n", batchPredictionJobResponse.getState());
System.out.format("\tCreate Time: %s\n", batchPredictionJobResponse.getCreateTime());
System.out.format("\tStart Time: %s\n", batchPredictionJobResponse.getStartTime());
System.out.format("\tEnd Time: %s\n", batchPredictionJobResponse.getEndTime());
System.out.format("\tUpdate Time: %s\n", batchPredictionJobResponse.getUpdateTime());
System.out.format("\tLabels: %s\n", batchPredictionJobResponse.getLabelsMap());
InputConfig inputConfigResponse = batchPredictionJobResponse.getInputConfig();
System.out.println("\tInput Config");
System.out.format("\t\tInstances Format: %s\n", inputConfigResponse.getInstancesFormat());
GcsSource gcsSourceResponse = inputConfigResponse.getGcsSource();
System.out.println("\t\tGcs Source");
System.out.format("\t\t\tUris %s\n", gcsSourceResponse.getUrisList());
BigQuerySource bigQuerySource = inputConfigResponse.getBigquerySource();
System.out.println("\t\tBigquery Source");
System.out.format("\t\t\tInput_uri: %s\n", bigQuerySource.getInputUri());
OutputConfig outputConfigResponse = batchPredictionJobResponse.getOutputConfig();
System.out.println("\tOutput Config");
System.out.format("\t\tPredictions Format: %s\n", outputConfigResponse.getPredictionsFormat());
GcsDestination gcsDestinationResponse = outputConfigResponse.getGcsDestination();
System.out.println("\t\tGcs Destination");
System.out.format("\t\t\tOutput Uri Prefix: %s\n", gcsDestinationResponse.getOutputUriPrefix());
BigQueryDestination bigQueryDestination = outputConfigResponse.getBigqueryDestination();
System.out.println("\t\tBig Query Destination");
System.out.format("\t\t\tOutput Uri: %s\n", bigQueryDestination.getOutputUri());
BatchDedicatedResources batchDedicatedResources = batchPredictionJobResponse.getDedicatedResources();
System.out.println("\tBatch Dedicated Resources");
System.out.format("\t\tStarting Replica Count: %s\n", batchDedicatedResources.getStartingReplicaCount());
System.out.format("\t\tMax Replica Count: %s\n", batchDedicatedResources.getMaxReplicaCount());
MachineSpec machineSpec = batchDedicatedResources.getMachineSpec();
System.out.println("\t\tMachine Spec");
System.out.format("\t\t\tMachine Type: %s\n", machineSpec.getMachineType());
System.out.format("\t\t\tAccelerator Type: %s\n", machineSpec.getAcceleratorType());
System.out.format("\t\t\tAccelerator Count: %s\n", machineSpec.getAcceleratorCount());
ManualBatchTuningParameters manualBatchTuningParameters = batchPredictionJobResponse.getManualBatchTuningParameters();
System.out.println("\tManual Batch Tuning Parameters");
System.out.format("\t\tBatch Size: %s\n", manualBatchTuningParameters.getBatchSize());
OutputInfo outputInfo = batchPredictionJobResponse.getOutputInfo();
System.out.println("\tOutput Info");
System.out.format("\t\tGcs Output Directory: %s\n", outputInfo.getGcsOutputDirectory());
System.out.format("\t\tBigquery Output Dataset: %s\n", outputInfo.getBigqueryOutputDataset());
Status status = batchPredictionJobResponse.getError();
System.out.println("\tError");
System.out.format("\t\tCode: %s\n", status.getCode());
System.out.format("\t\tMessage: %s\n", status.getMessage());
List<Any> details = status.getDetailsList();
for (Status partialFailure : batchPredictionJobResponse.getPartialFailuresList()) {
System.out.println("\tPartial Failure");
System.out.format("\t\tCode: %s\n", partialFailure.getCode());
System.out.format("\t\tMessage: %s\n", partialFailure.getMessage());
List<Any> partialFailureDetailsList = partialFailure.getDetailsList();
}
ResourcesConsumed resourcesConsumed = batchPredictionJobResponse.getResourcesConsumed();
System.out.println("\tResources Consumed");
System.out.format("\t\tReplica Hours: %s\n", resourcesConsumed.getReplicaHours());
CompletionStats completionStats = batchPredictionJobResponse.getCompletionStats();
System.out.println("\tCompletion Stats");
System.out.format("\t\tSuccessful Count: %s\n", completionStats.getSuccessfulCount());
System.out.format("\t\tFailed Count: %s\n", completionStats.getFailedCount());
System.out.format("\t\tIncomplete Count: %s\n", completionStats.getIncompleteCount());
}
}
use of com.google.cloud.aiplatform.v1.Dataset in project java-aiplatform by googleapis.
the class CreateBatchPredictionJobVideoObjectTrackingSample method batchPredictionJobVideoObjectTracking.
static void batchPredictionJobVideoObjectTracking(String batchPredictionDisplayName, String modelId, String gcsSourceUri, String gcsDestinationOutputUriPrefix, String project) throws IOException {
JobServiceSettings jobServiceSettings = JobServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings)) {
String location = "us-central1";
LocationName locationName = LocationName.of(project, location);
ModelName modelName = ModelName.of(project, location, modelId);
VideoObjectTrackingPredictionParams modelParamsObj = VideoObjectTrackingPredictionParams.newBuilder().setConfidenceThreshold(((float) 0.5)).build();
Value modelParameters = ValueConverter.toValue(modelParamsObj);
GcsSource.Builder gcsSource = GcsSource.newBuilder();
gcsSource.addUris(gcsSourceUri);
InputConfig inputConfig = InputConfig.newBuilder().setInstancesFormat("jsonl").setGcsSource(gcsSource).build();
GcsDestination gcsDestination = GcsDestination.newBuilder().setOutputUriPrefix(gcsDestinationOutputUriPrefix).build();
OutputConfig outputConfig = OutputConfig.newBuilder().setPredictionsFormat("jsonl").setGcsDestination(gcsDestination).build();
BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().setDisplayName(batchPredictionDisplayName).setModel(modelName.toString()).setModelParameters(modelParameters).setInputConfig(inputConfig).setOutputConfig(outputConfig).build();
BatchPredictionJob batchPredictionJobResponse = jobServiceClient.createBatchPredictionJob(locationName, batchPredictionJob);
System.out.println("Create Batch Prediction Job Video Object Tracking Response");
System.out.format("\tName: %s\n", batchPredictionJobResponse.getName());
System.out.format("\tDisplay Name: %s\n", batchPredictionJobResponse.getDisplayName());
System.out.format("\tModel %s\n", batchPredictionJobResponse.getModel());
System.out.format("\tModel Parameters: %s\n", batchPredictionJobResponse.getModelParameters());
System.out.format("\tState: %s\n", batchPredictionJobResponse.getState());
System.out.format("\tCreate Time: %s\n", batchPredictionJobResponse.getCreateTime());
System.out.format("\tStart Time: %s\n", batchPredictionJobResponse.getStartTime());
System.out.format("\tEnd Time: %s\n", batchPredictionJobResponse.getEndTime());
System.out.format("\tUpdate Time: %s\n", batchPredictionJobResponse.getUpdateTime());
System.out.format("\tLabels: %s\n", batchPredictionJobResponse.getLabelsMap());
InputConfig inputConfigResponse = batchPredictionJobResponse.getInputConfig();
System.out.println("\tInput Config");
System.out.format("\t\tInstances Format: %s\n", inputConfigResponse.getInstancesFormat());
GcsSource gcsSourceResponse = inputConfigResponse.getGcsSource();
System.out.println("\t\tGcs Source");
System.out.format("\t\t\tUris %s\n", gcsSourceResponse.getUrisList());
BigQuerySource bigQuerySource = inputConfigResponse.getBigquerySource();
System.out.println("\t\tBigquery Source");
System.out.format("\t\t\tInput_uri: %s\n", bigQuerySource.getInputUri());
OutputConfig outputConfigResponse = batchPredictionJobResponse.getOutputConfig();
System.out.println("\tOutput Config");
System.out.format("\t\tPredictions Format: %s\n", outputConfigResponse.getPredictionsFormat());
GcsDestination gcsDestinationResponse = outputConfigResponse.getGcsDestination();
System.out.println("\t\tGcs Destination");
System.out.format("\t\t\tOutput Uri Prefix: %s\n", gcsDestinationResponse.getOutputUriPrefix());
BigQueryDestination bigQueryDestination = outputConfigResponse.getBigqueryDestination();
System.out.println("\t\tBig Query Destination");
System.out.format("\t\t\tOutput Uri: %s\n", bigQueryDestination.getOutputUri());
BatchDedicatedResources batchDedicatedResources = batchPredictionJobResponse.getDedicatedResources();
System.out.println("\tBatch Dedicated Resources");
System.out.format("\t\tStarting Replica Count: %s\n", batchDedicatedResources.getStartingReplicaCount());
System.out.format("\t\tMax Replica Count: %s\n", batchDedicatedResources.getMaxReplicaCount());
MachineSpec machineSpec = batchDedicatedResources.getMachineSpec();
System.out.println("\t\tMachine Spec");
System.out.format("\t\t\tMachine Type: %s\n", machineSpec.getMachineType());
System.out.format("\t\t\tAccelerator Type: %s\n", machineSpec.getAcceleratorType());
System.out.format("\t\t\tAccelerator Count: %s\n", machineSpec.getAcceleratorCount());
ManualBatchTuningParameters manualBatchTuningParameters = batchPredictionJobResponse.getManualBatchTuningParameters();
System.out.println("\tManual Batch Tuning Parameters");
System.out.format("\t\tBatch Size: %s\n", manualBatchTuningParameters.getBatchSize());
OutputInfo outputInfo = batchPredictionJobResponse.getOutputInfo();
System.out.println("\tOutput Info");
System.out.format("\t\tGcs Output Directory: %s\n", outputInfo.getGcsOutputDirectory());
System.out.format("\t\tBigquery Output Dataset: %s\n", outputInfo.getBigqueryOutputDataset());
Status status = batchPredictionJobResponse.getError();
System.out.println("\tError");
System.out.format("\t\tCode: %s\n", status.getCode());
System.out.format("\t\tMessage: %s\n", status.getMessage());
List<Any> details = status.getDetailsList();
for (Status partialFailure : batchPredictionJobResponse.getPartialFailuresList()) {
System.out.println("\tPartial Failure");
System.out.format("\t\tCode: %s\n", partialFailure.getCode());
System.out.format("\t\tMessage: %s\n", partialFailure.getMessage());
List<Any> partialFailureDetailsList = partialFailure.getDetailsList();
}
ResourcesConsumed resourcesConsumed = batchPredictionJobResponse.getResourcesConsumed();
System.out.println("\tResources Consumed");
System.out.format("\t\tReplica Hours: %s\n", resourcesConsumed.getReplicaHours());
CompletionStats completionStats = batchPredictionJobResponse.getCompletionStats();
System.out.println("\tCompletion Stats");
System.out.format("\t\tSuccessful Count: %s\n", completionStats.getSuccessfulCount());
System.out.format("\t\tFailed Count: %s\n", completionStats.getFailedCount());
System.out.format("\t\tIncomplete Count: %s\n", completionStats.getIncompleteCount());
}
}
use of com.google.cloud.aiplatform.v1.Dataset in project java-aiplatform by googleapis.
the class CreateDataLabelingJobActiveLearningSample method createDataLabelingJobActiveLearningSample.
static void createDataLabelingJobActiveLearningSample(String project, String displayName, String dataset, String instructionUri, String inputsSchemaUri, String annotationSpec) throws IOException {
JobServiceSettings settings = JobServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
String location = "us-central1";
// the "close" method on the client to safely clean up any remaining background resources.
try (JobServiceClient client = JobServiceClient.create(settings)) {
JsonArray jsonAnnotationSpecs = new JsonArray();
jsonAnnotationSpecs.add(annotationSpec);
JsonObject jsonInputs = new JsonObject();
jsonInputs.add("annotation_specs", jsonAnnotationSpecs);
Value.Builder inputsBuilder = Value.newBuilder();
JsonFormat.parser().merge(jsonInputs.toString(), inputsBuilder);
Value inputs = inputsBuilder.build();
ActiveLearningConfig activeLearningConfig = ActiveLearningConfig.newBuilder().setMaxDataItemCount(1).build();
String datasetName = DatasetName.of(project, location, dataset).toString();
DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().setDisplayName(displayName).addDatasets(datasetName).setLabelerCount(1).setInstructionUri(instructionUri).setInputsSchemaUri(inputsSchemaUri).setInputs(inputs).putAnnotationLabels("aiplatform.googleapis.com/annotation_set_name", "data_labeling_job_active_learning").setActiveLearningConfig(activeLearningConfig).build();
LocationName parent = LocationName.of(project, location);
DataLabelingJob response = client.createDataLabelingJob(parent, dataLabelingJob);
System.out.format("response: %s\n", response);
System.out.format("Name: %s\n", response.getName());
}
}
use of com.google.cloud.aiplatform.v1.Dataset in project java-aiplatform by googleapis.
the class CreateDatasetTabularBigquerySample method createDatasetTableBigquery.
static void createDatasetTableBigquery(String project, String bigqueryDisplayName, String bigqueryUri) throws IOException, ExecutionException, InterruptedException, TimeoutException {
DatasetServiceSettings settings = DatasetServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(settings)) {
String location = "us-central1";
String metadataSchemaUri = "gs://google-cloud-aiplatform/schema/dataset/metadata/tables_1.0.0.yaml";
LocationName locationName = LocationName.of(project, location);
String jsonString = "{\"input_config\": {\"bigquery_source\": {\"uri\": \"" + bigqueryUri + "\"}}}";
Value.Builder metaData = Value.newBuilder();
JsonFormat.parser().merge(jsonString, metaData);
Dataset dataset = Dataset.newBuilder().setDisplayName(bigqueryDisplayName).setMetadataSchemaUri(metadataSchemaUri).setMetadata(metaData).build();
OperationFuture<Dataset, CreateDatasetOperationMetadata> datasetFuture = datasetServiceClient.createDatasetAsync(locationName, dataset);
System.out.format("Operation name: %s\n", datasetFuture.getInitialFuture().get().getName());
System.out.println("Waiting for operation to finish...");
Dataset datasetResponse = datasetFuture.get(300, TimeUnit.SECONDS);
System.out.println("Create Dataset Table Bigquery sample");
System.out.format("Name: %s\n", datasetResponse.getName());
System.out.format("Display Name: %s\n", datasetResponse.getDisplayName());
System.out.format("Metadata Schema Uri: %s\n", datasetResponse.getMetadataSchemaUri());
System.out.format("Metadata: %s\n", datasetResponse.getMetadata());
}
}
Aggregations