You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by sounakr <gi...@git.apache.org> on 2017/12/14 20:01:35 UTC

[GitHub] carbondata pull request #1662: [CARBONDATA-1288][DictionarySecureServer] Dic...

GitHub user sounakr opened a pull request:

    https://github.com/apache/carbondata/pull/1662

    [CARBONDATA-1288][DictionarySecureServer] Dictionary Secure Server Implementation

    Be sure to do all of the following checklist to help us incorporate 
    your contribution quickly and easily:
    
     - [X] Any interfaces changed?
     Yes
     - [X] Any backward compatibility impacted?
     No
     - [X] Document update required?
    Yes
     - [X] Testing done
            Please provide details on 
            - Whether new unit test cases have been added or why no new tests are required?
            - How it is tested? Please attach test report.
            - Is it a performance related change? Please attach the performance test report.
            - Any additional information to help reviewers in testing this change.
           
     - [X] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. 
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sounakr/incubator-carbondata secure-dict

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/carbondata/pull/1662.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1662
    
----
commit f5d15f6c966629447272abb3938c86b3d198a857
Author: sounak <so...@huawei.com>
Date:   2017-07-06T15:18:54Z

    Dictionary Secure Server Implementation

----


---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Success with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/846/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/770/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2072/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Retest this please


---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2301/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2002/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1981/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/751/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Retest this please


---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Retest this please


---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2307/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Retest this please.


---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1996/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by gvramana <gi...@git.apache.org>.
Github user gvramana commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    LGTM


---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2073/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Success with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/816/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/804/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Success with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/766/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Retest this please


---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/845/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Success with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/847/



---

[GitHub] carbondata pull request #1662: [CARBONDATA-1288][DictionarySecureServer] Dic...

Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1662#discussion_r157335368
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/dictionary/server/NonSecureDictionaryServer.java ---
    @@ -0,0 +1,180 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.carbondata.core.dictionary.server;
    +
    +import java.net.InetSocketAddress;
    +
    +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.dictionary.service.AbstractDictionaryServer;
    +import org.apache.carbondata.core.metadata.schema.table.CarbonTable;
    +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 NonSecureDictionaryServer extends AbstractDictionaryServer
    +    implements DictionaryServer {
    +
    +  private static final LogService LOGGER =
    +      LogServiceFactory.getLogService(NonSecureDictionaryServer.class.getName());
    +
    +  private NonSecureDictionaryServerHandler nonSecureDictionaryServerHandler;
    +
    +  private EventLoopGroup boss;
    +  private EventLoopGroup worker;
    +  private int port;
    +  private String host;
    +  private static Object lock = new Object();
    +  private static NonSecureDictionaryServer INSTANCE = null;
    +
    +  private NonSecureDictionaryServer(int port) {
    +    this.port = port;
    +    startServer();
    +  }
    +
    +  public static synchronized DictionaryServer getInstance(int port, CarbonTable carbonTable)
    +      throws Exception {
    +    if (INSTANCE == null) {
    +      INSTANCE = new NonSecureDictionaryServer(port);
    +    }
    +    INSTANCE.initializeDictionaryGenerator(carbonTable);
    --- End diff --
    
    Yes, Initially the code was like 
       if (INSTANCE == null) {
           synchronized(lock) {
              if (INSTANCE == null) 
                ...
                ... 
    There was a dual check of INSTANCE for concurrency. The dual check will cause a find bug error. In order to void this the method is turned into synchronized method. Also initializeDictionaryGenerator will finally invoke method like initializeGeneratorForTable which is also synchronized. So even though we remove the method as synchronized the execution will never be concurrent. 


---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2035/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Retest this please.


---

[GitHub] carbondata pull request #1662: [CARBONDATA-1288][DictionarySecureServer] Dic...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/carbondata/pull/1662


---

[GitHub] carbondata pull request #1662: [CARBONDATA-1288][DictionarySecureServer] Dic...

Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1662#discussion_r157336992
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/dictionary/service/NonSecureDictionaryServiceProvider.java ---
    @@ -0,0 +1,37 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.carbondata.core.dictionary.service;
    +
    +import org.apache.carbondata.core.dictionary.client.DictionaryClient;
    +import org.apache.carbondata.core.dictionary.client.NonSecureDictionaryClient;
    +
    +public class NonSecureDictionaryServiceProvider implements DictionaryServiceProvider {
    +  private int port = 0;
    --- End diff --
    
    Done.


---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2310/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Retest this please


---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/763/



---

[GitHub] carbondata pull request #1662: [CARBONDATA-1288][DictionarySecureServer] Dic...

Posted by ManoharVanam <gi...@git.apache.org>.
Github user ManoharVanam commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1662#discussion_r157161157
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/dictionary/service/NonSecureDictionaryServiceProvider.java ---
    @@ -0,0 +1,37 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.carbondata.core.dictionary.service;
    +
    +import org.apache.carbondata.core.dictionary.client.DictionaryClient;
    +import org.apache.carbondata.core.dictionary.client.NonSecureDictionaryClient;
    +
    +public class NonSecureDictionaryServiceProvider implements DictionaryServiceProvider {
    +  private int port = 0;
    --- End diff --
    
    pls provide serialVersionUID


---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2374/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2373/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2345/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2070/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1992/



---

[GitHub] carbondata issue #1662: [CARBONDATA-1288][DictionarySecureServer] Dictionary...

Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on the issue:

    https://github.com/apache/carbondata/pull/1662
  
    Retest this please.


---

[GitHub] carbondata pull request #1662: [CARBONDATA-1288][DictionarySecureServer] Dic...

Posted by ManoharVanam <gi...@git.apache.org>.
Github user ManoharVanam commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1662#discussion_r157157194
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/dictionary/server/NonSecureDictionaryServer.java ---
    @@ -0,0 +1,180 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.carbondata.core.dictionary.server;
    +
    +import java.net.InetSocketAddress;
    +
    +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.dictionary.service.AbstractDictionaryServer;
    +import org.apache.carbondata.core.metadata.schema.table.CarbonTable;
    +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 NonSecureDictionaryServer extends AbstractDictionaryServer
    +    implements DictionaryServer {
    +
    +  private static final LogService LOGGER =
    +      LogServiceFactory.getLogService(NonSecureDictionaryServer.class.getName());
    +
    +  private NonSecureDictionaryServerHandler nonSecureDictionaryServerHandler;
    +
    +  private EventLoopGroup boss;
    +  private EventLoopGroup worker;
    +  private int port;
    +  private String host;
    +  private static Object lock = new Object();
    +  private static NonSecureDictionaryServer INSTANCE = null;
    +
    +  private NonSecureDictionaryServer(int port) {
    +    this.port = port;
    +    startServer();
    +  }
    +
    +  public static synchronized DictionaryServer getInstance(int port, CarbonTable carbonTable)
    +      throws Exception {
    +    if (INSTANCE == null) {
    +      INSTANCE = new NonSecureDictionaryServer(port);
    +    }
    +    INSTANCE.initializeDictionaryGenerator(carbonTable);
    --- End diff --
    
    INSTANCE.initializeDictionaryGenerator(carbonTable); is this statement required to be in synchronized method?


---