PageRenderTime 32ms CodeModel.GetById 12ms app.highlight 15ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.1-rc2/hive/external/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateDatabaseDesc.java

#
Java | 104 lines | 60 code | 20 blank | 24 comment | 0 complexity | 49b0639ed9f9c442d248e437c1b92b72 MD5 | raw file
  1/**
  2 * Licensed to the Apache Software Foundation (ASF) under one
  3 * or more contributor license agreements.  See the NOTICE file
  4 * distributed with this work for additional information
  5 * regarding copyright ownership.  The ASF licenses this file
  6 * to you under the Apache License, Version 2.0 (the
  7 * "License"); you may not use this file except in compliance
  8 * with the License.  You may obtain a copy of the License at
  9 *
 10 *     http://www.apache.org/licenses/LICENSE-2.0
 11 *
 12 * Unless required by applicable law or agreed to in writing, software
 13 * distributed under the License is distributed on an "AS IS" BASIS,
 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15 * See the License for the specific language governing permissions and
 16 * limitations under the License.
 17 */
 18
 19package org.apache.hadoop.hive.ql.plan;
 20
 21import java.io.Serializable;
 22import java.util.Map;
 23
 24/**
 25 * CreateDatabaseDesc.
 26 *
 27 */
 28@Explain(displayName = "Create Database")
 29public class CreateDatabaseDesc extends DDLDesc implements Serializable {
 30
 31  private static final long serialVersionUID = 1L;
 32
 33  String databaseName;
 34  String locationUri;
 35  String comment;
 36  boolean ifNotExists;
 37  Map<String, String> dbProperties;
 38
 39  /**
 40   * For serialization only.
 41   */
 42  public CreateDatabaseDesc() {
 43  }
 44
 45  public CreateDatabaseDesc(String databaseName, String comment,
 46      String locationUri, boolean ifNotExists) {
 47    super();
 48    this.databaseName = databaseName;
 49    this.comment = comment;
 50    this.locationUri = locationUri;
 51    this.ifNotExists = ifNotExists;
 52    this.dbProperties = null;
 53  }
 54
 55  public CreateDatabaseDesc(String databaseName, boolean ifNotExists) {
 56    this(databaseName, null, null, ifNotExists);
 57  }
 58
 59
 60
 61  @Explain(displayName="if not exists")
 62  public boolean getIfNotExists() {
 63    return ifNotExists;
 64  }
 65
 66  public void setIfNotExists(boolean ifNotExists) {
 67    this.ifNotExists = ifNotExists;
 68  }
 69
 70  public Map<String, String> getDatabaseProperties() {
 71    return dbProperties;
 72  }
 73
 74  public void setDatabaseProperties(Map<String, String> dbProps) {
 75    this.dbProperties = dbProps;
 76  }
 77
 78  @Explain(displayName="name")
 79  public String getName() {
 80    return databaseName;
 81  }
 82
 83  public void setName(String databaseName) {
 84    this.databaseName = databaseName;
 85  }
 86
 87  @Explain(displayName="comment")
 88  public String getComment() {
 89    return comment;
 90  }
 91
 92  public void setComment(String comment) {
 93    this.comment = comment;
 94  }
 95
 96  @Explain(displayName="locationUri")
 97  public String getLocationUri() {
 98    return locationUri;
 99  }
100
101  public void setLocationUri(String locationUri) {
102    this.locationUri = locationUri;
103  }
104}