Returns a list of databases matching an optional pattern. The argument is a serialized TGetDbParams object. The return type is a serialized TGetDbResult object.
(byte[] thriftGetTablesParams)
| 377 | * serialized TGetDbParams object. The return type is a serialized TGetDbResult object. |
| 378 | */ |
| 379 | public byte[] getDbs(byte[] thriftGetTablesParams) throws ImpalaException, TException { |
| 380 | TGetDbsParams params = new TGetDbsParams(); |
| 381 | JniUtil.deserializeThrift(protocolFactory_, params, thriftGetTablesParams); |
| 382 | TGetDbsResult result = new TGetDbsResult(); |
| 383 | String shortDesc = "Getting databases with pattern: " + params.getPattern(); |
| 384 | |
| 385 | return execAndSerialize("getDbs", shortDesc, () -> { |
| 386 | List<Db> dbs = catalog_.getDbs(PatternMatcher.MATCHER_MATCH_ALL); |
| 387 | List<TDatabase> tDbs = Lists.newArrayListWithCapacity(dbs.size()); |
| 388 | for (FeDb db : dbs) { |
| 389 | tDbs.add(db.toThrift()); |
| 390 | } |
| 391 | result.setDbs(tDbs); |
| 392 | return result; |
| 393 | }); |
| 394 | } |
| 395 | |
| 396 | /** |
| 397 | * Returns a list of table names matching an optional pattern. The argument is a |
nothing calls this directly
no test coverage detected