[core] don't print dbwrapper err log msg many times (#1481)

Co-authored-by: Sean Busbey <sean.busbey@gmail.com>
This commit is contained in:
Ivan 2020-11-30 00:35:14 +02:00 коммит произвёл GitHub
Родитель bee93f2a8c
Коммит e31b5039d2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -18,11 +18,13 @@
package site.ycsb;
import java.util.Map;
import site.ycsb.measurements.Measurements;
import org.apache.htrace.core.TraceScope;
import org.apache.htrace.core.Tracer;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* Wrapper around a "real" DB that measures latencies and counts return codes.
@ -41,6 +43,8 @@ public class DBWrapper extends DB {
private static final String LATENCY_TRACKED_ERRORS_PROPERTY = "latencytrackederrors";
private static final AtomicBoolean LOG_REPORT_CONFIG = new AtomicBoolean(false);
private final String scopeStringCleanup;
private final String scopeStringDelete;
private final String scopeStringInit;
@ -97,9 +101,11 @@ public class DBWrapper extends DB {
}
}
System.err.println("DBWrapper: report latency for each error is " +
this.reportLatencyForEachError + " and specific error codes to track" +
" for latency are: " + this.latencyTrackedErrors.toString());
if (LOG_REPORT_CONFIG.compareAndSet(false, true)) {
System.err.println("DBWrapper: report latency for each error is " +
this.reportLatencyForEachError + " and specific error codes to track" +
" for latency are: " + this.latencyTrackedErrors.toString());
}
}
}