Created
September 25, 2019 19:50
-
-
Save samueleresca/fbaa26cb5f7aa8d68361e8bacf86dde7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Licensed to the .NET Foundation under one or more agreements. | |
* The .NET Foundation licenses this file to you under the MIT license. | |
* See the LICENSE file in the project root for more information. | |
*/ | |
package org.apache.spark.api.dotnet | |
import java.io.DataOutputStream | |
import java.net.{InetSocketAddress, Socket} | |
import java.util.concurrent.{BlockingQueue, LinkedBlockingQueue, TimeUnit} | |
import io.netty.bootstrap.ServerBootstrap | |
import io.netty.channel.nio.NioEventLoopGroup | |
import io.netty.channel.socket.SocketChannel | |
import io.netty.channel.socket.nio.NioServerSocketChannel | |
import io.netty.channel.{ChannelFuture, ChannelInitializer, EventLoopGroup} | |
import io.netty.handler.codec.LengthFieldBasedFrameDecoder | |
import io.netty.handler.codec.bytes.{ByteArrayDecoder, ByteArrayEncoder} | |
import org.apache.spark.internal.Logging | |
/** | |
* Netty server that invokes JVM calls based upon receiving messages from .NET. | |
* The implementation mirrors the RBackend. | |
* | |
*/ | |
class DotnetBackend extends Logging { | |
self => // for accessing the this reference in inner class(ChannelInitializer) | |
private[this] var channelFuture: ChannelFuture = _ | |
private[this] var bootstrap: ServerBootstrap = _ | |
private[this] var bossGroup: EventLoopGroup = _ | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment