carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvramana <...@git.apache.org>
Subject [GitHub] incubator-carbondata pull request #656: [CARBONDATA-773] Fixed multiple Dict...
Date Mon, 10 Apr 2017 12:03:52 GMT
Github user gvramana commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/656#discussion_r106593403
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/dictionary/server/DictionaryServer.java
---
    @@ -43,42 +43,71 @@
     
       private EventLoopGroup boss;
       private EventLoopGroup worker;
    +  private int port;
    +  private static DictionaryServer INSTANCE = null;
    +
    +  private DictionaryServer(int port) {
    +    startServer(port);
    +  }
    +
    +  public static DictionaryServer getInstance(int port) {
    +    if (INSTANCE == null) {
    --- End diff --
    
    Dictionary server creation should be thread safe, use double check lock .
    if(INSTANCE == null){
      aquirelock
    if(INSTANCE==null){
    createinstance
    }
    releaselock
    }
    return instance


---
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