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 3C1BC200C72 for ; Fri, 12 May 2017 18:01:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3A912160BB8; Fri, 12 May 2017 16:01:53 +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 81A57160BA3 for ; Fri, 12 May 2017 18:01:52 +0200 (CEST) Received: (qmail 5139 invoked by uid 500); 12 May 2017 16:01:51 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 5127 invoked by uid 99); 12 May 2017 16:01:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2017 16:01:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 49956DFD43; Fri, 12 May 2017 16:01:51 +0000 (UTC) From: mjwall To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request #256: ACCUMULO-4463: Make block cache implementation c... Content-Type: text/plain Message-Id: <20170512160151.49956DFD43@git1-us-west.apache.org> Date: Fri, 12 May 2017 16:01:51 +0000 (UTC) archived-at: Fri, 12 May 2017 16:01:53 -0000 Github user mjwall commented on a diff in the pull request: https://github.com/apache/accumulo/pull/256#discussion_r116265855 --- Diff: core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManager.java --- @@ -0,0 +1,101 @@ +/* + * 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.accumulo.core.file.blockfile.cache; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.accumulo.core.conf.AccumuloConfiguration; +import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public abstract class BlockCacheManager { + + public static final String CACHE_PROPERTY_BASE = Property.GENERAL_ARBITRARY_PROP_PREFIX + "cache.block."; + + private static final Logger LOG = LoggerFactory.getLogger(BlockCacheManager.class); + private static BlockCacheManager factory = null; + + private final Map caches = new HashMap<>(); + + /** + * Initialize the caches for each CacheType based on the configuration + * + * @param conf + * accumulo configuration + */ + public void start(AccumuloConfiguration conf) { + for (CacheType type : CacheType.values()) { + BlockCache cache = this.createCache(conf, type); + this.caches.put(type, cache); + } + } + + /** + * Stop caches and release resources + */ + public void stop() {} --- End diff -- Would it make sense to add something this.caches.clear() to the stop ? --- 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. ---