From notifications-return-41727-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Wed Jan 24 18:41:40 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 691C7180630 for ; Wed, 24 Jan 2018 18:41:40 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5A0FB160C3C; Wed, 24 Jan 2018 17:41:40 +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 9F767160C39 for ; Wed, 24 Jan 2018 18:41:39 +0100 (CET) Received: (qmail 12382 invoked by uid 500); 24 Jan 2018 17:41:38 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 12371 invoked by uid 99); 24 Jan 2018 17:41:38 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jan 2018 17:41:38 +0000 From: GitBox To: notifications@accumulo.apache.org Subject: [GitHub] milleruntime commented on a change in pull request #364: ACCUMULO-4778 Initial feedback for table name to id mapping cache Message-ID: <151681569816.12547.5088251813329976841.gitbox@gitbox.apache.org> milleruntime commented on a change in pull request #364: ACCUMULO-4778 Initial feedback for table name to id mapping cache URL: https://github.com/apache/accumulo/pull/364#discussion_r163623382 ########## File path: core/src/main/java/org/apache/accumulo/core/client/impl/TableMap.java ########## @@ -0,0 +1,97 @@ +/* + * 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.client.impl; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.apache.accumulo.core.client.impl.Tables.getZooCache; +import static org.apache.accumulo.core.client.impl.Tables.qualified; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.accumulo.core.Constants; +import org.apache.accumulo.core.client.Instance; +import org.apache.accumulo.core.client.NamespaceNotFoundException; +import org.apache.accumulo.core.zookeeper.ZooUtil; +import org.apache.accumulo.fate.zookeeper.ZooCache; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.collect.ImmutableMap; + +/** + * Used for thread safe caching of table ID maps + */ +public class TableMap { + private static final Logger log = LoggerFactory.getLogger(TableMap.class); + + private Map tableNameToIdMap; + private Map tableIdtoNameMap; + + public TableMap(Instance instance) { + generateMaps(instance); Review comment: Good call. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services