com.amazonaws.services.athena.model.DataCatalog Maven / Gradle / Ivy
Show all versions of aws-java-sdk-athena Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.athena.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains information about a data catalog in an Amazon Web Services account.
*
*
*
* In the Athena console, data catalogs are listed as "data sources" on the Data sources page under the Data
* source name column.
*
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DataCatalog implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a
* maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of
* 256 is reserved for use by Athena.
*
*/
private String name;
/**
*
* An optional description of the data catalog.
*
*/
private String description;
/**
*
* The type of data catalog to create: LAMBDA
for a federated catalog, HIVE
for an
* external hive metastore, or GLUE
for an Glue Data Catalog.
*
*/
private String type;
/**
*
* Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values depend on
* the catalog type.
*
*
* -
*
* For the HIVE
data catalog type, use the following syntax. The metadata-function
* parameter is required. The sdk-version
parameter is optional and defaults to the currently supported
* version.
*
*
* metadata-function=lambda_arn, sdk-version=version_number
*
*
* -
*
* For the LAMBDA
data catalog type, use one of the following sets of required parameters, but not
* both.
*
*
* -
*
* If you have one Lambda function that processes metadata and another for reading the actual data, use the
* following syntax. Both parameters are required.
*
*
* metadata-function=lambda_arn, record-function=lambda_arn
*
*
* -
*
* If you have a composite Lambda function that processes both metadata and data, use the following syntax to
* specify your Lambda function.
*
*
* function=lambda_arn
*
*
*
*
* -
*
* The GLUE
type takes a catalog ID parameter and is required. The catalog_id
is
* the account ID of the Amazon Web Services account to which the Glue catalog belongs.
*
*
* catalog-id=catalog_id
*
*
* -
*
* The GLUE
data catalog type also applies to the default AwsDataCatalog
that already
* exists in your account, of which you can have only one and cannot modify.
*
*
*
*
*
*/
private java.util.Map parameters;
/**
*
* The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a
* maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of
* 256 is reserved for use by Athena.
*
*
* @param name
* The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can
* use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length
* constraint of 256 is reserved for use by Athena.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a
* maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of
* 256 is reserved for use by Athena.
*
*
* @return The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can
* use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length
* constraint of 256 is reserved for use by Athena.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a
* maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of
* 256 is reserved for use by Athena.
*
*
* @param name
* The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can
* use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length
* constraint of 256 is reserved for use by Athena.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DataCatalog withName(String name) {
setName(name);
return this;
}
/**
*
* An optional description of the data catalog.
*
*
* @param description
* An optional description of the data catalog.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* An optional description of the data catalog.
*
*
* @return An optional description of the data catalog.
*/
public String getDescription() {
return this.description;
}
/**
*
* An optional description of the data catalog.
*
*
* @param description
* An optional description of the data catalog.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DataCatalog withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The type of data catalog to create: LAMBDA
for a federated catalog, HIVE
for an
* external hive metastore, or GLUE
for an Glue Data Catalog.
*
*
* @param type
* The type of data catalog to create: LAMBDA
for a federated catalog, HIVE
for an
* external hive metastore, or GLUE
for an Glue Data Catalog.
* @see DataCatalogType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The type of data catalog to create: LAMBDA
for a federated catalog, HIVE
for an
* external hive metastore, or GLUE
for an Glue Data Catalog.
*
*
* @return The type of data catalog to create: LAMBDA
for a federated catalog, HIVE
for an
* external hive metastore, or GLUE
for an Glue Data Catalog.
* @see DataCatalogType
*/
public String getType() {
return this.type;
}
/**
*
* The type of data catalog to create: LAMBDA
for a federated catalog, HIVE
for an
* external hive metastore, or GLUE
for an Glue Data Catalog.
*
*
* @param type
* The type of data catalog to create: LAMBDA
for a federated catalog, HIVE
for an
* external hive metastore, or GLUE
for an Glue Data Catalog.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DataCatalogType
*/
public DataCatalog withType(String type) {
setType(type);
return this;
}
/**
*
* The type of data catalog to create: LAMBDA
for a federated catalog, HIVE
for an
* external hive metastore, or GLUE
for an Glue Data Catalog.
*
*
* @param type
* The type of data catalog to create: LAMBDA
for a federated catalog, HIVE
for an
* external hive metastore, or GLUE
for an Glue Data Catalog.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DataCatalogType
*/
public DataCatalog withType(DataCatalogType type) {
this.type = type.toString();
return this;
}
/**
*
* Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values depend on
* the catalog type.
*
*
* -
*
* For the HIVE
data catalog type, use the following syntax. The metadata-function
* parameter is required. The sdk-version
parameter is optional and defaults to the currently supported
* version.
*
*
* metadata-function=lambda_arn, sdk-version=version_number
*
*
* -
*
* For the LAMBDA
data catalog type, use one of the following sets of required parameters, but not
* both.
*
*
* -
*
* If you have one Lambda function that processes metadata and another for reading the actual data, use the
* following syntax. Both parameters are required.
*
*
* metadata-function=lambda_arn, record-function=lambda_arn
*
*
* -
*
* If you have a composite Lambda function that processes both metadata and data, use the following syntax to
* specify your Lambda function.
*
*
* function=lambda_arn
*
*
*
*
* -
*
* The GLUE
type takes a catalog ID parameter and is required. The catalog_id
is
* the account ID of the Amazon Web Services account to which the Glue catalog belongs.
*
*
* catalog-id=catalog_id
*
*
* -
*
* The GLUE
data catalog type also applies to the default AwsDataCatalog
that already
* exists in your account, of which you can have only one and cannot modify.
*
*
*
*
*
*
* @return Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values
* depend on the catalog type.
*
* -
*
* For the HIVE
data catalog type, use the following syntax. The metadata-function
* parameter is required. The sdk-version
parameter is optional and defaults to the currently
* supported version.
*
*
* metadata-function=lambda_arn, sdk-version=version_number
*
*
* -
*
* For the LAMBDA
data catalog type, use one of the following sets of required parameters, but
* not both.
*
*
* -
*
* If you have one Lambda function that processes metadata and another for reading the actual data, use the
* following syntax. Both parameters are required.
*
*
* metadata-function=lambda_arn, record-function=lambda_arn
*
*
* -
*
* If you have a composite Lambda function that processes both metadata and data, use the following syntax
* to specify your Lambda function.
*
*
* function=lambda_arn
*
*
*
*
* -
*
* The GLUE
type takes a catalog ID parameter and is required. The
* catalog_id
is the account ID of the Amazon Web Services account to which the Glue
* catalog belongs.
*
*
* catalog-id=catalog_id
*
*
* -
*
* The GLUE
data catalog type also applies to the default AwsDataCatalog
that
* already exists in your account, of which you can have only one and cannot modify.
*
*
*
*
*/
public java.util.Map getParameters() {
return parameters;
}
/**
*
* Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values depend on
* the catalog type.
*
*
* -
*
* For the HIVE
data catalog type, use the following syntax. The metadata-function
* parameter is required. The sdk-version
parameter is optional and defaults to the currently supported
* version.
*
*
* metadata-function=lambda_arn, sdk-version=version_number
*
*
* -
*
* For the LAMBDA
data catalog type, use one of the following sets of required parameters, but not
* both.
*
*
* -
*
* If you have one Lambda function that processes metadata and another for reading the actual data, use the
* following syntax. Both parameters are required.
*
*
* metadata-function=lambda_arn, record-function=lambda_arn
*
*
* -
*
* If you have a composite Lambda function that processes both metadata and data, use the following syntax to
* specify your Lambda function.
*
*
* function=lambda_arn
*
*
*
*
* -
*
* The GLUE
type takes a catalog ID parameter and is required. The catalog_id
is
* the account ID of the Amazon Web Services account to which the Glue catalog belongs.
*
*
* catalog-id=catalog_id
*
*
* -
*
* The GLUE
data catalog type also applies to the default AwsDataCatalog
that already
* exists in your account, of which you can have only one and cannot modify.
*
*
*
*
*
*
* @param parameters
* Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values
* depend on the catalog type.
*
* -
*
* For the HIVE
data catalog type, use the following syntax. The metadata-function
* parameter is required. The sdk-version
parameter is optional and defaults to the currently
* supported version.
*
*
* metadata-function=lambda_arn, sdk-version=version_number
*
*
* -
*
* For the LAMBDA
data catalog type, use one of the following sets of required parameters, but
* not both.
*
*
* -
*
* If you have one Lambda function that processes metadata and another for reading the actual data, use the
* following syntax. Both parameters are required.
*
*
* metadata-function=lambda_arn, record-function=lambda_arn
*
*
* -
*
* If you have a composite Lambda function that processes both metadata and data, use the following syntax to
* specify your Lambda function.
*
*
* function=lambda_arn
*
*
*
*
* -
*
* The GLUE
type takes a catalog ID parameter and is required. The
* catalog_id
is the account ID of the Amazon Web Services account to which the Glue
* catalog belongs.
*
*
* catalog-id=catalog_id
*
*
* -
*
* The GLUE
data catalog type also applies to the default AwsDataCatalog
that
* already exists in your account, of which you can have only one and cannot modify.
*
*
*
*
*/
public void setParameters(java.util.Map parameters) {
this.parameters = parameters;
}
/**
*
* Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values depend on
* the catalog type.
*
*
* -
*
* For the HIVE
data catalog type, use the following syntax. The metadata-function
* parameter is required. The sdk-version
parameter is optional and defaults to the currently supported
* version.
*
*
* metadata-function=lambda_arn, sdk-version=version_number
*
*
* -
*
* For the LAMBDA
data catalog type, use one of the following sets of required parameters, but not
* both.
*
*
* -
*
* If you have one Lambda function that processes metadata and another for reading the actual data, use the
* following syntax. Both parameters are required.
*
*
* metadata-function=lambda_arn, record-function=lambda_arn
*
*
* -
*
* If you have a composite Lambda function that processes both metadata and data, use the following syntax to
* specify your Lambda function.
*
*
* function=lambda_arn
*
*
*
*
* -
*
* The GLUE
type takes a catalog ID parameter and is required. The catalog_id
is
* the account ID of the Amazon Web Services account to which the Glue catalog belongs.
*
*
* catalog-id=catalog_id
*
*
* -
*
* The GLUE
data catalog type also applies to the default AwsDataCatalog
that already
* exists in your account, of which you can have only one and cannot modify.
*
*
*
*
*
*
* @param parameters
* Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values
* depend on the catalog type.
*
* -
*
* For the HIVE
data catalog type, use the following syntax. The metadata-function
* parameter is required. The sdk-version
parameter is optional and defaults to the currently
* supported version.
*
*
* metadata-function=lambda_arn, sdk-version=version_number
*
*
* -
*
* For the LAMBDA
data catalog type, use one of the following sets of required parameters, but
* not both.
*
*
* -
*
* If you have one Lambda function that processes metadata and another for reading the actual data, use the
* following syntax. Both parameters are required.
*
*
* metadata-function=lambda_arn, record-function=lambda_arn
*
*
* -
*
* If you have a composite Lambda function that processes both metadata and data, use the following syntax to
* specify your Lambda function.
*
*
* function=lambda_arn
*
*
*
*
* -
*
* The GLUE
type takes a catalog ID parameter and is required. The
* catalog_id
is the account ID of the Amazon Web Services account to which the Glue
* catalog belongs.
*
*
* catalog-id=catalog_id
*
*
* -
*
* The GLUE
data catalog type also applies to the default AwsDataCatalog
that
* already exists in your account, of which you can have only one and cannot modify.
*
*
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DataCatalog withParameters(java.util.Map parameters) {
setParameters(parameters);
return this;
}
/**
* Add a single Parameters entry
*
* @see DataCatalog#withParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public DataCatalog addParametersEntry(String key, String value) {
if (null == this.parameters) {
this.parameters = new java.util.HashMap();
}
if (this.parameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.parameters.put(key, value);
return this;
}
/**
* Removes all the entries added into Parameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DataCatalog clearParametersEntries() {
this.parameters = null;
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getParameters() != null)
sb.append("Parameters: ").append(getParameters());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DataCatalog == false)
return false;
DataCatalog other = (DataCatalog) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getParameters() == null ^ this.getParameters() == null)
return false;
if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode());
return hashCode;
}
@Override
public DataCatalog clone() {
try {
return (DataCatalog) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.athena.model.transform.DataCatalogMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}