Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2402#discussion_r197817666
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/localdictionary/dictionaryholder/MapBasedDictionaryStore.java
 ---
    @@ -0,0 +1,135 @@
    +/*
    + * 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.localdictionary.dictionaryholder;
    +
    +import java.util.Map;
    +import java.util.concurrent.ConcurrentHashMap;
    +
    +import 
org.apache.carbondata.core.cache.dictionary.DictionaryByteArrayWrapper;
    +import 
org.apache.carbondata.core.localdictionary.exception.DictionaryThresholdReachedException;
    +
    +/**
    + * Map based dictionary holder class, it will use map to hold
    + * the dictionary key and its value
    + */
    +public class MapBasedDictionaryStore implements DictionaryStore {
    +
    +  /**
    +   * use to assign dictionary value to new key
    +   */
    +  private int lastAssignValue;
    +
    +  /**
    +   * to maintain dictionary key value
    +   */
    +  private final Map<DictionaryByteArrayWrapper, Integer> dictionary;
    +
    +  /**
    +   * maintaining array for reverse lookup
    +   * otherwise iterating everytime in map for reverse lookup will be 
slowdown the performance
    +   * It will only maintain the reference
    +   */
    +  private byte[][] referenceDictionaryArray;
    --- End diff --
    
    Better directly use `DictionaryByteArrayWrapper` array here


---

Reply via email to