/** * @return synchronized metastore client * @throws MetaException */ @LimitedPrivate(value = {"Hive"}) @Unstable public synchronized SynchronizedMetaStoreClient getSynchronizedMSC() throws MetaException { if (syncMetaStoreClient == null) { syncMetaStoreClient = new SynchronizedMetaStoreClient(getMSC(true, false)); } return syncMetaStoreClient; }
LOG.debug(debugMsg.toString()); getSynchronizedMSC().add_partitions(partitions.stream().map(Partition::getTPartition) .collect(Collectors.toList())); } catch(AlreadyExistsException aee) {
private void setStatsPropAndAlterPartitions(boolean resetStatistics, Table tbl, List<Partition> partitions, long writeId) throws TException { if (partitions.isEmpty()) { return; } EnvironmentContext ec = new EnvironmentContext(); if (!resetStatistics) { ec.putToProperties(StatsSetupConst.DO_NOT_UPDATE_STATS, StatsSetupConst.TRUE); } if (LOG.isDebugEnabled()) { StringBuilder sb = new StringBuilder("Altering existing partitions "); partitions.forEach(p -> sb.append(p.getSpec())); LOG.debug(sb.toString()); } getSynchronizedMSC().alter_partitions(tbl.getCatName(), tbl.getDbName(), tbl.getTableName(), partitions.stream().map(Partition::getTPartition).collect(Collectors.toList()), ec, null, writeId); }
private static boolean isCompatible(Hive db, HiveConf c, boolean isFastCheck) { if (isFastCheck) { return (db.metaStoreClient == null || db.metaStoreClient.isSameConfObj(c)) && (db.syncMetaStoreClient == null || db.syncMetaStoreClient.isSameConfObj(c)); } else { return (db.metaStoreClient == null || db.metaStoreClient.isCompatibleWith(c)) && (db.syncMetaStoreClient == null || db.syncMetaStoreClient.isCompatibleWith(c)); } }
private void setStatsPropAndAlterPartition(boolean hasFollowingStatsTask, Table tbl, Partition newTPart) throws MetaException, TException { EnvironmentContext environmentContext = null; if (hasFollowingStatsTask) { environmentContext = new EnvironmentContext(); environmentContext.putToProperties(StatsSetupConst.DO_NOT_UPDATE_STATS, StatsSetupConst.TRUE); } LOG.debug("Altering existing partition " + newTPart.getSpec()); getSychronizedMSC().alter_partition(tbl.getDbName(), tbl.getTableName(), newTPart.getTPartition(), environmentContext); }
try { LOG.debug("Adding new partition " + newTPart.getSpec()); getSynchronizedMSC().add_partition(newTPart.getTPartition()); } catch (AlreadyExistsException aee) {
tpart = getSynchronizedMSC().getPartitionWithAuthInfo(tbl.getDbName(), tbl.getTableName(), pvals, getUserName(), getGroupNames()); } catch (NoSuchObjectException nsoe) { + " with partition spec : " + partSpec); try { tpart = getSynchronizedMSC().appendPartition(tbl.getDbName(), tbl.getTableName(), pvals); } catch (AlreadyExistsException aee) { LOG.debug("Caught already exists exception, trying to alter partition instead"); tpart = getSynchronizedMSC().getPartitionWithAuthInfo(tbl.getDbName(), tbl.getTableName(), pvals, getUserName(), getGroupNames()); alterPartitionSpec(tbl, partSpec, tpart, inheritTableSpecs, partPath); tpart = getSynchronizedMSC().getPartitionWithAuthInfo(tbl.getDbName(), tbl.getTableName(), pvals, getUserName(), getGroupNames()); if (tpart == null) {
getSynchronizedMSC().fireListenerEvent(rqst); } catch (IOException | TException e) { throw new HiveException(e);
getSynchronizedMSC().addWriteNotificationLog(rqst); } catch (IOException | TException e) { throw new HiveException(e);
private void setStatsPropAndAlterPartition(boolean resetStatistics, Table tbl, Partition newTPart, TableSnapshot tableSnapshot) throws TException { EnvironmentContext ec = new EnvironmentContext(); if (!resetStatistics) { ec.putToProperties(StatsSetupConst.DO_NOT_UPDATE_STATS, StatsSetupConst.TRUE); } LOG.debug("Altering existing partition " + newTPart.getSpec()); getSynchronizedMSC().alter_partition(tbl.getCatName(), tbl.getDbName(), tbl.getTableName(), newTPart.getTPartition(), new EnvironmentContext(), tableSnapshot == null ? null : tableSnapshot.getValidWriteIdList()); }
try { LOG.debug("Adding new partition " + newTPart.getSpec()); getSychronizedMSC().add_partition(newTPart.getTPartition()); } catch (AlreadyExistsException aee) {
getSynchronizedMSC().alter_partition(catName, dbName, tblName, newPart.getTPartition(), environmentContext, tableSnapshot == null ? null : tableSnapshot.getValidWriteIdList());
/** * @return synchronized metastore client * @throws MetaException */ @LimitedPrivate(value = {"Hive"}) @Unstable public synchronized SynchronizedMetaStoreClient getSychronizedMSC() throws MetaException { if (syncMetaStoreClient == null) { syncMetaStoreClient = new SynchronizedMetaStoreClient(getMSC(true, false)); } return syncMetaStoreClient; }