Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 06C29200CA9 for ; Fri, 12 May 2017 00:33:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 057BC160BCE; Thu, 11 May 2017 22:33:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 52919160BCA for ; Fri, 12 May 2017 00:33:09 +0200 (CEST) Received: (qmail 24376 invoked by uid 500); 11 May 2017 22:33:08 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 24320 invoked by uid 99); 11 May 2017 22:33:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 May 2017 22:33:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id DD69E1AFAFC for ; Thu, 11 May 2017 22:33:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 9utDPg3ZLiSv for ; Thu, 11 May 2017 22:33:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 408925FC8A for ; Thu, 11 May 2017 22:33:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id BEBCCE06CC for ; Thu, 11 May 2017 22:33:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4A06321E0A for ; Thu, 11 May 2017 22:33:04 +0000 (UTC) Date: Thu, 11 May 2017 22:33:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5481) Allow Drill to persist profiles in-memory only with a max capacity MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 11 May 2017 22:33:10 -0000 [ https://issues.apache.org/jira/browse/DRILL-5481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16007312#comment-16007312 ] ASF GitHub Bot commented on DRILL-5481: --------------------------------------- Github user sudheeshkatkam commented on a diff in the pull request: https://github.com/apache/drill/pull/827#discussion_r116116935 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/sys/store/InMemoryPersistentStore.java --- @@ -15,28 +15,40 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.drill.exec.testing.store; +package org.apache.drill.exec.store.sys.store; import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ConcurrentSkipListMap; +import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; -import com.google.common.collect.Iterables; -import com.google.common.collect.Maps; import org.apache.drill.common.concurrent.AutoCloseableLock; +import org.apache.drill.exec.exception.StoreException; import org.apache.drill.exec.exception.VersionMismatchException; import org.apache.drill.exec.store.sys.BasePersistentStore; import org.apache.drill.exec.store.sys.PersistentStoreMode; -import org.apache.drill.exec.store.sys.store.DataChangeVersion; -public class NoWriteLocalStore extends BasePersistentStore { +import com.google.common.collect.Iterables; + +public class InMemoryPersistentStore extends BasePersistentStore { + // private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(InMemoryPersistentStore.class); + private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock()); private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock()); - private final ConcurrentMap store = Maps.newConcurrentMap(); + private ConcurrentMap store; private int version = -1; + private int maxCapacity; --- End diff -- final, here and below > Allow Drill to persist profiles in-memory only with a max capacity > ------------------------------------------------------------------ > > Key: DRILL-5481 > URL: https://issues.apache.org/jira/browse/DRILL-5481 > Project: Apache Drill > Issue Type: Improvement > Affects Versions: 1.10.0 > Reporter: Kunal Khatua > Assignee: Kunal Khatua > > To allow for fast persistence of profiles on a temporary basis (i.e. till the life of the Drillbit), an existing test class {{org.apache.drill.exec.testing.store.NoWriteLocalStore.java}} was refactored to {{org.apache.drill.exec.store.sys.store.EphemeralPersistentStore}} and given the ability to maintain a max capacity. > This should allow query profiles to be available for as long as the Drillbit process' lifespan. -- This message was sent by Atlassian JIRA (v6.3.15#6346)