Skip to content

Commit

Permalink
Update to Netty 4.1.21 and test read-only memory mapped file (Azure#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkiGibson authored Feb 7, 2018
1 parent c59c3a1 commit 3a2ebdb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import io.netty.channel.pool.ChannelPoolHandler;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
import io.netty.util.AttributeKey;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
Expand Down Expand Up @@ -80,8 +79,7 @@ protected void initChannel(Channel ch) throws Exception {
this.available = new ConcurrentMultiHashMap<>();
this.leased = new ConcurrentMultiHashMap<>();
try {
sslContext = SslContextBuilder.forClient()
.trustManager(InsecureTrustManagerFactory.INSTANCE).build();
sslContext = SslContextBuilder.forClient().build();
} catch (SSLException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,8 @@ public byte[] apply(Integer integer) throws Exception {
.zipWith(md5s, new BiFunction<Integer, byte[], Completable>() {
@Override
public Completable apply(Integer id, final byte[] md5) throws Exception {
// Must memory map in read/write mode for native transports until Netty 4.1.21.Final release.
final FileChannel fileStream = FileChannel.open(TEMP_FOLDER_PATH.resolve("100m-" + id + ".dat"), StandardOpenOption.READ, StandardOpenOption.WRITE);
Flowable<ByteBuffer> stream = FlowableUtil.split(fileStream.map(FileChannel.MapMode.READ_WRITE, 0, fileStream.size()), CHUNK_SIZE);
final FileChannel fileStream = FileChannel.open(TEMP_FOLDER_PATH.resolve("100m-" + id + ".dat"), StandardOpenOption.READ);
Flowable<ByteBuffer> stream = FlowableUtil.split(fileStream.map(FileChannel.MapMode.READ_ONLY, 0, fileStream.size()), CHUNK_SIZE);
return service.upload100MB(String.valueOf(id), sas, "BlockBlob", stream, FILE_SIZE).flatMapCompletable(new Function<RestResponse<Void, Void>, CompletableSource>() {
@Override
public CompletableSource apply(RestResponse<Void, Void> response) throws Exception {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</scm>

<properties>
<netty.version>4.1.20.Final</netty.version>
<netty.version>4.1.21.Final</netty.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
</properties>
Expand Down

0 comments on commit 3a2ebdb

Please sign in to comment.