Skip to content

Commit

Permalink
fix some checkstyle issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackson-Wang-7 committed Jul 12, 2023
1 parent 2c605a0 commit 10f6aeb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.compression.CompressionOptions;
import io.netty.handler.codec.http.HttpContentCompressor;
import io.netty.handler.codec.http.HttpObjectAggregator;
import io.netty.handler.codec.http.HttpServerCodec;
import io.netty.handler.codec.http.HttpServerExpectContinueHandler;
Expand Down Expand Up @@ -58,7 +56,6 @@ public S3HttpPipelineHandler(FileSystem fileSystem, DoraWorker doraWorker) {
protected void initChannel(SocketChannel channel) throws Exception {
ChannelPipeline pipeline = channel.pipeline();
pipeline.addLast(new HttpServerCodec());
pipeline.addLast(new HttpContentCompressor((CompressionOptions[]) null));
pipeline.addLast(new HttpObjectAggregator(512 * 1024));
pipeline.addLast(new HttpServerExpectContinueHandler());
pipeline.addLast(new S3HttpHandler(mFileSystem, mDoraWorker, mAsyncAuditLogWriter));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import alluxio.s3.S3ErrorCode;
import alluxio.s3.S3Exception;

import javax.ws.rs.core.Response;
import com.google.common.net.InetAddresses;
import io.netty.handler.codec.http.HttpResponse;
import io.netty.handler.codec.http.HttpResponseStatus;
Expand Down Expand Up @@ -242,6 +241,7 @@ public HttpResponse continueTask() {
});
}
} // end of ListObjectsTask

private static class CreateBucketTask extends S3NettyBucketTask {
protected CreateBucketTask(S3NettyHandler handler, OpType opType) {
super(handler, opType);
Expand Down Expand Up @@ -282,7 +282,7 @@ public HttpResponse continueTask() {
// - S3 clients may prepend PutObject requests with CreateBucket calls instead of
// calling HeadBucket to ensure that the bucket exists
mHandler.BUCKET_PATH_CACHE.put(bucketPath, true);
return Response.Status.OK;
return HttpResponseStatus.OK;
}
// Otherwise, this bucket is owned by a different user
throw new S3Exception(S3ErrorCode.BUCKET_ALREADY_EXISTS);
Expand Down Expand Up @@ -316,7 +316,7 @@ public HttpResponse continueTask() {
throw NettyRestUtils.toBucketS3Exception(e, bucketPath, auditContext);
}
mHandler.BUCKET_PATH_CACHE.put(bucketPath, true);
return Response.Status.OK;
return HttpResponseStatus.OK;
}
});
}
Expand All @@ -342,6 +342,7 @@ public HttpResponse continueTask() {
});
}
} // end of HeadBucketTask

private static class DeleteBucketTask extends S3NettyBucketTask {

protected DeleteBucketTask(S3NettyHandler handler, OpType opType) {
Expand Down Expand Up @@ -369,7 +370,7 @@ public HttpResponse continueTask() {
} catch (Exception e) {
throw NettyRestUtils.toBucketS3Exception(e, bucketPath, auditContext);
}
return Response.Status.NO_CONTENT;
return HttpResponseStatus.NO_CONTENT;
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
import java.security.MessageDigest;
import java.util.Date;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
* S3 Netty Tasks to handle object level request.
Expand Down Expand Up @@ -361,7 +360,8 @@ public HttpResponse continueTask() {
// Populate the xattr Map with the metadata tags if provided
// Map<String, ByteString> xattrMap = new HashMap<>();
// final String taggingHeader = mHandler.getHeader(S3Constants.S3_TAGGING_HEADER);
// NettyRestUtils.populateTaggingInXAttr(xattrMap, taggingHeader, auditContext, objectPath);
// NettyRestUtils.populateTaggingInXAttr(xattrMap, taggingHeader, auditContext,
// objectPath);

// populate the xAttr map with the "Content-Type" header
// final String contentTypeHeader = mHandler.getHeader(S3Constants.S3_CONTENT_TYPE_HEADER);
Expand Down Expand Up @@ -399,7 +399,8 @@ public HttpResponse continueTask() {
// copyFilePOptionsBuilder.putXattr(S3Constants.CONTENT_TYPE_XATTR_KEY,
// ByteString.copyFrom(status.getFileInfo().getXAttr().getOrDefault(
// S3Constants.CONTENT_TYPE_XATTR_KEY,
// MediaType.APPLICATION_OCTET_STREAM.getBytes(S3Constants.HEADER_CHARSET))));
// MediaType.APPLICATION_OCTET_STREAM.getBytes(
// S3Constants.HEADER_CHARSET))));
// }
// } catch (Exception e) {
// throw NettyRestUtils.toObjectS3Exception(e, objectPath, auditContext);
Expand Down

0 comments on commit 10f6aeb

Please sign in to comment.