HDFS-12501. Ozone: Cleanup javac issues. Contributed by Yiqun Lin.

This commit is contained in:
Anu Engineer 2017-09-27 09:54:16 -07:00 committed by Owen O'Malley
parent 6b10723ec3
commit a44f3a777d
14 changed files with 20 additions and 21 deletions

View File

@ -114,7 +114,7 @@ public void shutdown() {
scmUsedSaved = true;
if (scmUsage instanceof CachingGetSpaceUsed) {
IOUtils.cleanup(null, ((CachingGetSpaceUsed) scmUsage));
IOUtils.cleanupWithLogger(null, ((CachingGetSpaceUsed) scmUsage));
}
}
@ -185,7 +185,7 @@ void saveScmUsed() {
// not critical, log the error and continue.
LOG.warn("Failed to write scmUsed to " + scmUsedFile, ioe);
} finally {
IOUtils.cleanup(null, out);
IOUtils.cleanupWithLogger(null, out);
}
}
}

View File

@ -41,6 +41,6 @@ final class CloseableCleanupListener implements ChannelFutureListener {
@Override
public void operationComplete(ChannelFuture future) {
IOUtils.cleanup(null, closeables);
IOUtils.cleanupWithLogger(null, closeables);
}
}

View File

@ -235,7 +235,7 @@ public void run() {
this.exception = e;
this.latch.countDown();
} finally {
IOUtils.cleanup(null, this.reqIn, this.respOut);
IOUtils.cleanupWithLogger(null, this.reqIn, this.respOut);
StorageHandlerBuilder.removeStorageHandler();
}
LOG.trace("end RequestRunner, nettyReq = {}", this.nettyReq);
@ -281,7 +281,7 @@ public OutputStream writeStatusAndHeaders(long contentLength,
*/
@Override
public void finish() throws IOException {
IOUtils.cleanup(null, this.respOut);
IOUtils.cleanupWithLogger(null, this.respOut);
}
/**

View File

@ -80,7 +80,7 @@ public void channelRead0(ChannelHandlerContext ctx, HttpContent content)
"ctx = {}, content = {}", ctx, content);
content.content().readBytes(this.reqOut, content.content().readableBytes());
if (content instanceof LastHttpContent) {
IOUtils.cleanup(null, this.reqOut);
IOUtils.cleanupWithLogger(null, this.reqOut);
ctx.write(this.nettyResp.get());
ChannelFuture respFuture = ctx.writeAndFlush(new ChunkedStream(
this.respIn));
@ -112,6 +112,6 @@ public void operationComplete(ChannelFuture future) throws Exception {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
super.exceptionCaught(ctx, cause);
IOUtils.cleanup(null, this.reqOut, this.respIn);
IOUtils.cleanupWithLogger(null, this.reqOut, this.respIn);
}
}

View File

@ -97,6 +97,7 @@ public void channelRead0(ChannelHandlerContext ctx, HttpRequest nettyReq)
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
super.exceptionCaught(ctx, cause);
IOUtils.cleanup(null, this.reqIn, this.reqOut, this.respIn, this.respOut);
IOUtils.cleanupWithLogger(null, this.reqIn, this.reqOut, this.respIn,
this.respOut);
}
}

View File

@ -41,9 +41,9 @@
import org.apache.hadoop.ozone.web.exceptions.OzoneException;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import java.io.Closeable;
import java.io.IOException;
@ -512,11 +512,9 @@ private void configureTrace() {
if (enableTrace.isPresent()) {
conf.setBoolean(OzoneConfigKeys.OZONE_TRACE_ENABLED_KEY,
enableTrace.get());
GenericTestUtils.setLogLevel(org.apache.log4j.Logger.getRootLogger(),
Level.ALL);
GenericTestUtils.setRootLogLevel(Level.TRACE);
}
GenericTestUtils.setLogLevel(org.apache.log4j.Logger.getRootLogger(),
Level.INFO);
GenericTestUtils.setRootLogLevel(Level.INFO);
}
private void configureSCMheartbeat() {

View File

@ -152,7 +152,7 @@ private void testRpcPermissionWithConf(
}
}
} finally {
IOUtils.cleanup(null, cluster);
IOUtils.cleanupWithLogger(null, cluster);
}
}

View File

@ -65,7 +65,7 @@ public static void shutdown() throws InterruptedException {
if(cluster != null) {
cluster.shutdown();
}
IOUtils.cleanup(null, storageContainerLocationClient, cluster);
IOUtils.cleanupWithLogger(null, storageContainerLocationClient, cluster);
}
@Test

View File

@ -165,7 +165,7 @@ public void setup() throws Exception {
@After
public void shutdown() throws InterruptedException {
IOUtils.cleanup(null, storageContainerLocationClient, cluster);
IOUtils.cleanupWithLogger(null, storageContainerLocationClient, cluster);
}
@Test

View File

@ -75,7 +75,7 @@ public static void shutdown() throws InterruptedException {
if (cluster != null) {
cluster.shutdown();
}
IOUtils.cleanup(null, storageContainerLocationClient, cluster);
IOUtils.cleanupWithLogger(null, storageContainerLocationClient, cluster);
}
@Test

View File

@ -119,7 +119,7 @@ private int runCommandAndGetOutput(String[] cmd,
@AfterClass
public static void shutdown() throws InterruptedException {
IOUtils.cleanup(null, storageContainerLocationClient, cluster);
IOUtils.cleanupWithLogger(null, storageContainerLocationClient, cluster);
}
@Test

View File

@ -72,7 +72,7 @@ public static void init() throws IOException, TimeoutException,
@AfterClass
public static void shutdown() {
IOUtils.cleanup(null, cluster);
IOUtils.cleanupWithLogger(null, cluster);
}
@Test

View File

@ -66,7 +66,7 @@ public static void init() throws IOException {
@AfterClass
public static void shutdown() {
IOUtils.cleanup(null, cluster, storageContainerLocationClient);
IOUtils.cleanupWithLogger(null, cluster, storageContainerLocationClient);
}
@Test

View File

@ -68,7 +68,7 @@ public static void init() throws Exception {
@AfterClass
public static void shutdown() throws InterruptedException {
IOUtils.cleanup(null, ozoneClient, cluster);
IOUtils.cleanupWithLogger(null, ozoneClient, cluster);
}
@Test