carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvramana <...@git.apache.org>
Subject [GitHub] carbondata pull request #1152: [CARBONDATA-1288] Secure Dictionary Server Im...
Date Wed, 12 Jul 2017 06:08:07 GMT
Github user gvramana commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1152#discussion_r126870510
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/dictionary/server/DictionaryServer.java
---
    @@ -14,153 +14,28 @@
      * See the License for the specific language governing permissions and
      * limitations under the License.
      */
    -package org.apache.carbondata.core.dictionary.server;
    -
    -import org.apache.carbondata.common.logging.LogService;
    -import org.apache.carbondata.common.logging.LogServiceFactory;
    -import org.apache.carbondata.core.constants.CarbonCommonConstants;
    -import org.apache.carbondata.core.dictionary.generator.key.DictionaryMessage;
    -import org.apache.carbondata.core.dictionary.generator.key.DictionaryMessageType;
    -import org.apache.carbondata.core.util.CarbonProperties;
    -
    -import io.netty.bootstrap.ServerBootstrap;
    -import io.netty.channel.ChannelInitializer;
    -import io.netty.channel.ChannelOption;
    -import io.netty.channel.ChannelPipeline;
    -import io.netty.channel.EventLoopGroup;
    -import io.netty.channel.nio.NioEventLoopGroup;
    -import io.netty.channel.socket.SocketChannel;
    -import io.netty.channel.socket.nio.NioServerSocketChannel;
    -import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
    -
    -/**
    - * Dictionary Server to generate dictionary keys.
    - */
    -public class DictionaryServer {
    -
    -  private static final LogService LOGGER =
    -          LogServiceFactory.getLogService(DictionaryServer.class.getName());
     
    -  private DictionaryServerHandler dictionaryServerHandler;
    -
    -  private EventLoopGroup boss;
    -  private EventLoopGroup worker;
    -  private int port;
    -  private static Object lock = new Object();
    -  private static DictionaryServer INSTANCE = null;
    +package org.apache.carbondata.core.dictionary.server;
     
    -  private DictionaryServer(int port) {
    -    startServer(port);
    -  }
    +import org.apache.spark.SparkConf;
     
    -  public static DictionaryServer getInstance(int port) {
    -    if (INSTANCE == null) {
    -      synchronized (lock) {
    -        if (INSTANCE == null) {
    -          INSTANCE = new DictionaryServer(port);
    -        }
    -      }
    -    }
    -    return INSTANCE;
    -  }
    +public interface DictionaryServer {
     
    -  /**
    -   * start dictionary server
    -   *
    -   * @param port
    -   */
    -  private void startServer(int port) {
    -    dictionaryServerHandler = new DictionaryServerHandler();
    -    String workerThreads = CarbonProperties.getInstance()
    -        .getProperty(CarbonCommonConstants.DICTIONARY_WORKER_THREADS,
    -            CarbonCommonConstants.DICTIONARY_WORKER_THREADS_DEFAULT);
    -    boss = new NioEventLoopGroup(1);
    -    worker = new NioEventLoopGroup(Integer.parseInt(workerThreads));
    -    // Configure the server.
    -    bindToPort(port);
    -  }
    +  public void startServer(SparkConf conf, String host, int port);
    --- End diff --
    
    This interface should not contain SparkConf


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message