• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

HotelsDotCom / waggle-dance / #489

25 Jun 2026 01:07AM UTC coverage: 69.255% (-0.01%) from 69.269%
#489

push

web-flow
Merge e9de2a718 into bbd99ea37

7 of 10 new or added lines in 5 files covered. (70.0%)

2631 of 3799 relevant lines covered (69.26%)

0.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/waggle-dance-core/src/main/java/com/hotels/bdp/waggledance/mapping/model/MetaStoreMapping.java
1
/**
2
 * Copyright (C) 2016-2026 Expedia, Inc.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package com.hotels.bdp.waggledance.mapping.model;
17

18
import java.io.Closeable;
19
import java.util.List;
20

21
import org.apache.hadoop.hive.metastore.MetaStoreFilterHook;
22
import org.apache.hadoop.hive.metastore.api.AlreadyExistsException;
23
import org.apache.hadoop.hive.metastore.api.Database;
24
import org.apache.hadoop.hive.metastore.api.InvalidObjectException;
25
import org.apache.hadoop.hive.metastore.api.MetaException;
26
import org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore;
27
import org.apache.thrift.TException;
28

29
import com.hotels.bdp.waggledance.server.security.NotAllowedException;
30

31
public interface MetaStoreMapping extends Closeable {
32

33
  /**
34
   * Outbound means parameter coming from the Hive Metastore and return result will be sent to user client.
35
   *
36
   * @param databaseName, (return the first matching in case of multiple names). To get the full list please use
37
   *          {@link #transformOutboundDatabaseNameMultiple(String)}
38
   * @return
39
   */
40
  String transformOutboundDatabaseName(String databaseName);
41

42
  /**
43
   * Outbound means parameter coming from the Hive Metastore and return result will be sent to user client.
44
   *
45
   * @param databaseName
46
   * @return List of databaseNames. This method potentially returns multiple database names if configuration is set up to
47
   *    *          map to multiple.
48
   */
49
  List<String> transformOutboundDatabaseNameMultiple(String databaseName);
50

51
  Database transformOutboundDatabase(Database database);
52

53
  /**
54
   * Inbound means parameter coming from the user client and return result will be sent to Hive Metastore.
55
   *
56
   * @param databaseName
57
   * @return
58
   */
59
  String transformInboundDatabaseName(String databaseName);
60

61
  ThriftHiveMetastore.Iface getClient();
62

63
   MetaStoreFilterHook getMetastoreFilter();
64

65
  String getDatabasePrefix();
66

67
  String getMetastoreMappingName();
68

69
  boolean isAvailable();
70

71
  /**
72
   * @param databaseName (assumed to be the database name used in this mapped metastore so any waggle dance related
73
   *          prefix must have been stripped already)
74
   * @return this, throws {@link NotAllowedException} when the Metastore mapped by this class does not have write
75
   *         permissions for the database
76
   */
77
  MetaStoreMapping checkWritePermissions(String databaseName);
78

79
  /**
80
   * @param database (assumed to be the database used in this mapped metastore so any waggle dance related prefix must
81
   *          have been stripped already)
82
   * @throws NotAllowedException when the metastore mapped by this class does not have the correct permission otherwise
83
   *           calls getClient().create_database(database)
84
   * @throws TException if a Thrift error occurs
85
   * @throws MetaException if a problem occurs interacting with the Hive MetaStore
86
   * @throws InvalidObjectException if Hive considers the database invalid
87
   * @throws AlreadyExistsException if the database already exists
88
   */
89
  void createDatabase(Database database)
90
    throws AlreadyExistsException, InvalidObjectException, MetaException, TException;
91

92
  long getLatency();
93

94
  default boolean isGlueBackend() {
NEW
95
    return false;
×
96
  }
97
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc