/** * * @param hcatURI User specified hcatURI. * @param broker A shared resource broker * @return a {@link HiveConf} with specified hcatURI if any. * @throws IOException */ public static <S extends ScopeType<S>> HiveConf get(Optional<String> hcatURI, SharedResourcesBroker<S> broker) throws IOException { try { SharedHiveConfKey confKey = hcatURI.isPresent() && StringUtils.isNotBlank(hcatURI.get()) ? new SharedHiveConfKey(hcatURI.get()) : SharedHiveConfKey.INSTANCE; return broker.getSharedResource(new HiveConfFactory<>(), confKey); } catch (NotConfiguredException nce) { throw new IOException(nce); } }
try { hiveConf = SharedResourcesBrokerFactory .getImplicitBroker().getSharedResource(new HiveConfFactory<>(), SharedHiveConfKey.INSTANCE); deserializer = ReflectionUtils.newInstance(hiveConf.getClassByName(serde).asSubclass(Deserializer.class), hiveConf);
/** * * @param hcatURI User specified hcatURI. * @param broker A shared resource broker * @return a {@link HiveConf} with specified hcatURI if any. * @throws IOException */ public static <S extends ScopeType<S>> HiveConf get(Optional<String> hcatURI, SharedResourcesBroker<S> broker) throws IOException { try { SharedHiveConfKey confKey = hcatURI.isPresent() && StringUtils.isNotBlank(hcatURI.get()) ? new SharedHiveConfKey(hcatURI.get()) : SharedHiveConfKey.INSTANCE; return broker.getSharedResource(new HiveConfFactory<>(), confKey); } catch (NotConfiguredException nce) { throw new IOException(nce); } }
try { hiveConf = SharedResourcesBrokerFactory .getImplicitBroker().getSharedResource(new HiveConfFactory<>(), SharedHiveConfKey.INSTANCE); deserializer = ReflectionUtils.newInstance(hiveConf.getClassByName(serde).asSubclass(Deserializer.class), hiveConf);