PageRenderTime 37ms CodeModel.GetById 11ms 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
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  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. package org.apache.hadoop.hive.ql.plan;
  19. import java.io.Serializable;
  20. import java.util.Map;
  21. /**
  22. * CreateDatabaseDesc.
  23. *
  24. */
  25. @Explain(displayName = "Create Database")
  26. public class CreateDatabaseDesc extends DDLDesc implements Serializable {
  27. private static final long serialVersionUID = 1L;
  28. String databaseName;
  29. String locationUri;
  30. String comment;
  31. boolean ifNotExists;
  32. Map<String, String> dbProperties;
  33. /**
  34. * For serialization only.
  35. */
  36. public CreateDatabaseDesc() {
  37. }
  38. public CreateDatabaseDesc(String databaseName, String comment,
  39. String locationUri, boolean ifNotExists) {
  40. super();
  41. this.databaseName = databaseName;
  42. this.comment = comment;
  43. this.locationUri = locationUri;
  44. this.ifNotExists = ifNotExists;
  45. this.dbProperties = null;
  46. }
  47. public CreateDatabaseDesc(String databaseName, boolean ifNotExists) {
  48. this(databaseName, null, null, ifNotExists);
  49. }
  50. @Explain(displayName="if not exists")
  51. public boolean getIfNotExists() {
  52. return ifNotExists;
  53. }
  54. public void setIfNotExists(boolean ifNotExists) {
  55. this.ifNotExists = ifNotExists;
  56. }
  57. public Map<String, String> getDatabaseProperties() {
  58. return dbProperties;
  59. }
  60. public void setDatabaseProperties(Map<String, String> dbProps) {
  61. this.dbProperties = dbProps;
  62. }
  63. @Explain(displayName="name")
  64. public String getName() {
  65. return databaseName;
  66. }
  67. public void setName(String databaseName) {
  68. this.databaseName = databaseName;
  69. }
  70. @Explain(displayName="comment")
  71. public String getComment() {
  72. return comment;
  73. }
  74. public void setComment(String comment) {
  75. this.comment = comment;
  76. }
  77. @Explain(displayName="locationUri")
  78. public String getLocationUri() {
  79. return locationUri;
  80. }
  81. public void setLocationUri(String locationUri) {
  82. this.locationUri = locationUri;
  83. }
  84. }