[GitHub] incubator-carbondata pull request #454: [CARBONDATA-484] Implement LRU cache...

classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #454: [CARBONDATA-484] Implement LRU cache for B-...

qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/454
 
    Build Success with Spark 1.5.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/419/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #454: [CARBONDATA-484] Implement LRU cache for B-...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/454
 
    Build Success with Spark 1.5.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/420/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #454: [CARBONDATA-484] Implement LRU cache for B-...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/454
 
    Build Success with Spark 1.5.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/421/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #454: [CARBONDATA-484] Implement LRU cache for B-...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/454
 
    Build Success with Spark 1.5.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/422/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #454: [CARBONDATA-484] Implement LRU cache for B-...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/454
 
    Build Success with Spark 1.5.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/423/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #454: [CARBONDATA-484] Implement LRU cache for B-...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/454
 
    Build Success with Spark 1.5.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/424/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata pull request #454: [CARBONDATA-484] Implement LRU cache...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user gvramana commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/454#discussion_r94444608
 
    --- Diff: hadoop/src/main/java/org/apache/carbondata/hadoop/CacheClient.java ---
    @@ -0,0 +1,96 @@
    +/*
    + * 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.hadoop;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import org.apache.carbondata.core.cache.CacheProvider;
    +import org.apache.carbondata.core.cache.CacheType;
    +import org.apache.carbondata.core.carbon.AbsoluteTableIdentifier;
    +import org.apache.carbondata.core.carbon.datastore.SegmentTaskIndexStore;
    +import org.apache.carbondata.core.carbon.datastore.TableSegmentUniqueIdentifier;
    +import org.apache.carbondata.core.carbon.datastore.block.SegmentTaskIndexWrapper;
    +import org.apache.carbondata.core.constants.CarbonCommonConstants;
    +import org.apache.carbondata.core.util.CarbonUtilException;
    +
    +/**
    + * CacheClient : Class used to request the segments cache
    + */
    +public class CacheClient {
    --- End diff --
   
    Add a class CacheAccessClient which can work across Caches
    CacheClient should be a composite class holding all the CacheAccessClients.
    Life of CacheClient defines life of Cacheable  entries access.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata pull request #454: [CARBONDATA-484] Implement LRU cache...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user gvramana commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/454#discussion_r94445207
 
    --- Diff: hadoop/src/main/java/org/apache/carbondata/hadoop/CacheClient.java ---
    @@ -0,0 +1,96 @@
    +/*
    + * 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.hadoop;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import org.apache.carbondata.core.cache.CacheProvider;
    +import org.apache.carbondata.core.cache.CacheType;
    +import org.apache.carbondata.core.carbon.AbsoluteTableIdentifier;
    +import org.apache.carbondata.core.carbon.datastore.SegmentTaskIndexStore;
    +import org.apache.carbondata.core.carbon.datastore.TableSegmentUniqueIdentifier;
    +import org.apache.carbondata.core.carbon.datastore.block.SegmentTaskIndexWrapper;
    +import org.apache.carbondata.core.constants.CarbonCommonConstants;
    +import org.apache.carbondata.core.util.CarbonUtilException;
    +
    +/**
    + * CacheClient : Class used to request the segments cache
    + */
    +public class CacheClient {
    +  /**
    +   * List of segments
    +   */
    +  private List<TableSegmentUniqueIdentifier> segmentList =
    +      new ArrayList<>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
    +
    +  /**
    +   * absolute table identifier
    +   */
    +  private AbsoluteTableIdentifier absoluteTableIdentifier;
    +
    +  private SegmentTaskIndexStore segmentCache;
    +
    +  /**
    +   * @param absoluteTableIdentifier
    +   */
    +  public CacheClient(AbsoluteTableIdentifier absoluteTableIdentifier) {
    +    this.absoluteTableIdentifier = absoluteTableIdentifier;
    +    segmentCache = (SegmentTaskIndexStore) CacheProvider.getInstance()
    +        .createCache(CacheType.DRIVER_BTREE, absoluteTableIdentifier.getStorePath());
    +  }
    +
    +  /**
    +   * The method returns the SegmentTaskIndexWrapper from the segments cache
    +   *
    +   * @param tableSegmentUniqueIdentifier
    +   * @return
    +   * @throws CarbonUtilException
    +   */
    +  public SegmentTaskIndexWrapper getSegmentTaskIndexWrapper(
    +      TableSegmentUniqueIdentifier tableSegmentUniqueIdentifier) throws CarbonUtilException {
    +    SegmentTaskIndexWrapper segmentTaskIndexWrapper;
    +    if (null == tableSegmentUniqueIdentifier.getSegmentToTableBlocksInfos()) {
    +      segmentTaskIndexWrapper = segmentCache.getIfPresent(tableSegmentUniqueIdentifier);
    +    } else {
    +      segmentTaskIndexWrapper = segmentCache.get(tableSegmentUniqueIdentifier);
    +    }
    +    if (null != segmentTaskIndexWrapper) {
    +      segmentList.add(tableSegmentUniqueIdentifier);
    +    }
    +    return segmentTaskIndexWrapper;
    +  }
    +
    +  /**
    +   * the method is used to clear access count of the unused segments cacheable object
    +   */
    +  public void close() {
    +    segmentCache.clear(segmentList);
    +    segmentCache =null;
    +  }
    +
    +  /**
    +   * The method removes invalid segments from the segment level cache
    +   *
    +   * @param invalidSegments
    +   */
    +  public void removeInvalidSegments(List<String> invalidSegments) {
    --- End diff --
   
    support ClearAll  function


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata pull request #454: [CARBONDATA-484] Implement LRU cache...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user gvramana commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/454#discussion_r94445029
 
    --- Diff: hadoop/src/main/java/org/apache/carbondata/hadoop/CacheClient.java ---
    @@ -0,0 +1,96 @@
    +/*
    + * 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.hadoop;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import org.apache.carbondata.core.cache.CacheProvider;
    +import org.apache.carbondata.core.cache.CacheType;
    +import org.apache.carbondata.core.carbon.AbsoluteTableIdentifier;
    +import org.apache.carbondata.core.carbon.datastore.SegmentTaskIndexStore;
    +import org.apache.carbondata.core.carbon.datastore.TableSegmentUniqueIdentifier;
    +import org.apache.carbondata.core.carbon.datastore.block.SegmentTaskIndexWrapper;
    +import org.apache.carbondata.core.constants.CarbonCommonConstants;
    +import org.apache.carbondata.core.util.CarbonUtilException;
    +
    +/**
    + * CacheClient : Class used to request the segments cache
    + */
    +public class CacheClient {
    +  /**
    +   * List of segments
    +   */
    +  private List<TableSegmentUniqueIdentifier> segmentList =
    +      new ArrayList<>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
    +
    +  /**
    +   * absolute table identifier
    +   */
    +  private AbsoluteTableIdentifier absoluteTableIdentifier;
    +
    +  private SegmentTaskIndexStore segmentCache;
    +
    +  /**
    +   * @param absoluteTableIdentifier
    +   */
    +  public CacheClient(AbsoluteTableIdentifier absoluteTableIdentifier) {
    +    this.absoluteTableIdentifier = absoluteTableIdentifier;
    +    segmentCache = (SegmentTaskIndexStore) CacheProvider.getInstance()
    +        .createCache(CacheType.DRIVER_BTREE, absoluteTableIdentifier.getStorePath());
    +  }
    +
    +  /**
    +   * The method returns the SegmentTaskIndexWrapper from the segments cache
    +   *
    +   * @param tableSegmentUniqueIdentifier
    +   * @return
    +   * @throws CarbonUtilException
    +   */
    +  public SegmentTaskIndexWrapper getSegmentTaskIndexWrapper(
    --- End diff --
   
    CacheClient should have specific logic , it should just be responsible for bookkeeping of objects being accessed.
    Move this logic back to CarbonInputFormat and add getIfPresent and get methods to CacheClient


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #454: [CARBONDATA-484] Implement LRU cache for B-...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/454
 
    Build Success with Spark 1.5.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/425/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata pull request #454: [CARBONDATA-484] Implement LRU cache...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-carbondata/pull/454


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #454: [CARBONDATA-484] Implement LRU cache for B-...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user gvramana commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/454
 
    LGTM


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
12