lcspinter commented on a change in pull request #2916:
URL: https://github.com/apache/hive/pull/2916#discussion_r788944777
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/metrics/DeltaFilesMetricReporter.java
##########
@@ -310,81 +143,6 @@ private static String getDeltaCountKey(String dbName,
String tableName, String p
return key.toString();
}
- private static void logDeltaDirMetrics(AcidDirectory dir, Configuration
conf, int numObsoleteDeltas, int numDeltas,
- int numSmallDeltas) {
- long loggerFrequency = HiveConf
- .getTimeVar(conf,
HiveConf.ConfVars.HIVE_COMPACTOR_ACID_METRICS_LOGGER_FREQUENCY,
TimeUnit.MILLISECONDS);
- if (loggerFrequency <= 0) {
- return;
- }
- long currentTime = System.currentTimeMillis();
- if (lastSuccessfulLoggingTime == 0 || currentTime >=
lastSuccessfulLoggingTime + loggerFrequency) {
- lastSuccessfulLoggingTime = currentTime;
- if (numDeltas >= HiveConf.getIntVar(conf,
HiveConf.ConfVars.HIVE_COMPACTOR_ACTIVE_DELTA_DIR_THRESHOLD)) {
- LOG.warn("Directory " + dir.getPath() + " contains " + numDeltas + "
active delta directories. This can " +
- "cause performance degradation.");
- }
-
- if (numObsoleteDeltas >=
- HiveConf.getIntVar(conf,
HiveConf.ConfVars.HIVE_COMPACTOR_OBSOLETE_DELTA_DIR_THRESHOLD)) {
- LOG.warn("Directory " + dir.getPath() + " contains " + numDeltas + "
obsolete delta directories. This can " +
- "indicate compaction cleaner issues.");
- }
-
- if (numSmallDeltas >= HiveConf.getIntVar(conf,
HiveConf.ConfVars.HIVE_COMPACTOR_SMALL_DELTA_DIR_THRESHOLD)) {
- LOG.warn("Directory " + dir.getPath() + " contains " + numDeltas + "
small delta directories. This can " +
- "indicate performance degradation and there might be a problem
with your streaming setup.");
- }
- }
- }
-
- private static int getNumObsoleteDeltas(AcidDirectory dir, long
checkThresholdInSec) throws IOException {
- int numObsoleteDeltas = 0;
- for (Path obsolete : dir.getObsolete()) {
- FileStatus stat = dir.getFs().getFileStatus(obsolete);
- if (System.currentTimeMillis() - stat.getModificationTime() >=
checkThresholdInSec * 1000) {
- numObsoleteDeltas++;
- }
- }
- return numObsoleteDeltas;
- }
-
- public static void createCountersForAcidMetrics(TezCounters tezCounters,
JobConf jobConf) {
- if (HiveConf.getBoolVar(jobConf,
HiveConf.ConfVars.HIVE_SERVER2_METRICS_ENABLED) &&
- MetastoreConf.getBoolVar(jobConf,
MetastoreConf.ConfVars.METASTORE_ACIDMETRICS_EXT_ON)) {
-
- Arrays.stream(DeltaFilesMetricType.values())
- .filter(type -> jobConf.get(type.name()) != null)
- .forEach(type ->
-
Splitter.on(ENTRY_SEPARATOR).withKeyValueSeparator(KEY_VALUE_SEPARATOR).split(jobConf.get(type.name())).forEach(
- (path, cnt) -> tezCounters.findCounter(type.value,
path).setValue(Long.parseLong(cnt))
- )
- );
- }
- }
-
- public static void addAcidMetricsToConfObj(EnumMap<DeltaFilesMetricType,
- Queue<Pair<String, Integer>>> deltaFilesStats, Configuration conf) {
- try {
- deltaFilesStats.forEach((type, value) -> conf
- .set(type.name(),
Joiner.on(ENTRY_SEPARATOR).withKeyValueSeparator(KEY_VALUE_SEPARATOR).join(value)));
-
- } catch (Exception e) {
- LOG.warn("Couldn't add Delta metrics to conf object", e);
- }
- }
-
- public static void backPropagateAcidMetrics(JobConf jobConf, Configuration
conf) {
- if (HiveConf.getBoolVar(jobConf,
HiveConf.ConfVars.HIVE_SERVER2_METRICS_ENABLED) &&
- MetastoreConf.getBoolVar(jobConf,
MetastoreConf.ConfVars.METASTORE_ACIDMETRICS_EXT_ON)) {
- try {
- Arrays.stream(DeltaFilesMetricType.values()).filter(type ->
conf.get(type.name()) != null)
- .forEach(type -> jobConf.set(type.name(), conf.get(type.name())));
- } catch (Exception e) {
- LOG.warn("Couldn't back propagate Delta metrics to jobConf object", e);
- }
- }
- }
private static long getBaseSize(AcidDirectory dir) throws IOException {
long baseSize = 0;
Review comment:
removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]