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