HBASE-17033 LogRoller makes a lot of allocations unnecessarily

This commit is contained in:
Enis Soztutar 2016-11-07 14:18:00 -08:00
parent 2182ca34ac
commit 59d7b47e60
1 changed files with 4 additions and 1 deletions

View File

@ -288,6 +288,7 @@ public class FSHLog extends AbstractFSWAL<Writer> {
* methods like rollWriter().
* @return Writer instance
*/
@Override
protected Writer createWriterInstance(final Path path) throws IOException {
Writer writer = FSHLogProvider.createWriter(conf, fs, path, false);
if (writer instanceof ProtobufLogWriter) {
@ -598,6 +599,7 @@ public class FSHLog extends AbstractFSWAL<Writer> {
&& takeSyncFuture == null;
}
@Override
public void run() {
long currentSequence;
while (!isInterrupted()) {
@ -771,6 +773,7 @@ public class FSHLog extends AbstractFSWAL<Writer> {
* Therefore, if this function returns 0, it means you are not properly running with the HDFS-826
* patch.
*/
@Override
@VisibleForTesting
int getLogReplication() {
try {
@ -882,7 +885,7 @@ public class FSHLog extends AbstractFSWAL<Writer> {
SyncFuture waitSafePoint(final SyncFuture syncFuture) throws InterruptedException,
FailedSyncBeforeLogCloseException {
while (true) {
if (this.safePointAttainedLatch.await(1, TimeUnit.NANOSECONDS)) {
if (this.safePointAttainedLatch.await(1, TimeUnit.MILLISECONDS)) {
break;
}
if (syncFuture.isThrowable()) {