sc.setStatsTmpDir(conf.getTmpStatsDir()); sc.setContextSuffix(getOperatorId()); if (!statsPublisher.connect(sc)) {
if (!statsPublisher.connect(sc)) {
StatsCollectionContext sc = new StatsCollectionContext(jc); sc.setStatsTmpDir(conf.getTmpStatsDir()); if (!statsPublisher.connect(sc)) {
private void publishRunTimeStats() throws HiveException { StatsPublisher statsPublisher = new FSStatsPublisher(); StatsCollectionContext sContext = new StatsCollectionContext(hconf); sContext.setIndexForTezUnion(indexForTezUnion); sContext.setStatsTmpDir(conf.getRuntimeStatsTmpDir()); if (!statsPublisher.connect(sContext)) { LOG.error("StatsPublishing error: cannot connect to database"); throw new HiveException(ErrorMsg.STATSPUBLISHER_CONNECTION_ERROR.getErrorCodedMsg()); } String prefix = ""; Map<String, String> statsToPublish = new HashMap<String, String>(); statsToPublish.put(StatsSetupConst.RUN_TIME_ROW_COUNT, Long.toString(runTimeNumRows)); if (!statsPublisher.publishStat(prefix, statsToPublish)) { // The original exception is lost. // Not changing the interface to maintain backward compatibility throw new HiveException(ErrorMsg.STATSPUBLISHER_PUBLISHING_ERROR.getErrorCodedMsg()); } if (!statsPublisher.closeConnection(sContext)) { // The original exception is lost. // Not changing the interface to maintain backward compatibility throw new HiveException(ErrorMsg.STATSPUBLISHER_CLOSING_ERROR.getErrorCodedMsg()); } }
private void publishRunTimeStats() throws HiveException { StatsPublisher statsPublisher = new FSStatsPublisher(); StatsCollectionContext sContext = new StatsCollectionContext(hconf); sContext.setStatsTmpDir(conf.getRuntimeStatsTmpDir()); sContext.setContextSuffix(getOperatorId()); if (!statsPublisher.connect(sContext)) { LOG.error("StatsPublishing error: cannot connect to database"); throw new HiveException(ErrorMsg.STATSPUBLISHER_CONNECTION_ERROR.getErrorCodedMsg()); } String prefix = ""; Map<String, String> statsToPublish = new HashMap<String, String>(); statsToPublish.put(StatsSetupConst.RUN_TIME_ROW_COUNT, Long.toString(runTimeNumRows)); if (!statsPublisher.publishStat(prefix, statsToPublish)) { // The original exception is lost. // Not changing the interface to maintain backward compatibility throw new HiveException(ErrorMsg.STATSPUBLISHER_PUBLISHING_ERROR.getErrorCodedMsg()); } if (!statsPublisher.closeConnection(sContext)) { // The original exception is lost. // Not changing the interface to maintain backward compatibility throw new HiveException(ErrorMsg.STATSPUBLISHER_CLOSING_ERROR.getErrorCodedMsg()); } }
if (!statsPublisher.connect(sContext)) {
if (!statsPublisher.connect(sContext)) {
private void publishStats() { // Initializing a stats publisher StatsPublisher statsPublisher = Utilities.getStatsPublisher(jc); if (!statsPublisher.connect(jc)) { // just return, stats gathering should not block the main query. LOG.info("StatsPublishing error: cannot connect to database."); return; } String key; String taskID = Utilities.getTaskIdFromFilename(Utilities.getTaskId(hconf)); if (partitionSpecs.isEmpty()) { // In case of a non-partitioned table, the key for temp storage is just // "tableName + taskID" key = conf.getStatsAggPrefix() + taskID; } else { // In case of a partition, the key for temp storage is // "tableName + partitionSpecs + taskID" key = conf.getStatsAggPrefix() + partitionSpecs + Path.SEPARATOR + taskID; } statsPublisher.publishStat(key, StatsSetupConst.ROW_COUNT, Long.toString(stat.getNumRows())); statsPublisher.closeConnection(); } }
return; if (!statsPublisher.connect(hconf)) {
if (!statsPublisher.connect(jc)) {
if (!statsPublisher.connect(jc)) {
if (!statsPublisher.connect(hconf)) {