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 9B63D200D7F for ; Wed, 13 Dec 2017 02:03:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9A08E160C23; Wed, 13 Dec 2017 01:03:26 +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 E1095160C10 for ; Wed, 13 Dec 2017 02:03:25 +0100 (CET) Received: (qmail 66474 invoked by uid 500); 13 Dec 2017 01:03:25 -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 66374 invoked by uid 99); 13 Dec 2017 01:03:24 -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, 13 Dec 2017 01:03:24 +0000 From: GitBox To: notifications@accumulo.apache.org Subject: [GitHub] keith-turner commented on a change in pull request #337: ACCUMULO-4732 No APIs to configure iterators or locality groups for new tables Message-ID: <151312700438.14875.7630615077566732349.gitbox@gitbox.apache.org> archived-at: Wed, 13 Dec 2017 01:03:26 -0000 keith-turner commented on a change in pull request #337: ACCUMULO-4732 No APIs to configure iterators or locality groups for new tables URL: https://github.com/apache/accumulo/pull/337#discussion_r156534661 ########## File path: core/src/main/java/org/apache/accumulo/core/client/admin/NewTableConfiguration.java ########## @@ -146,4 +163,116 @@ public NewTableConfiguration enableSummarization(SummarizerConfiguration... conf summarizerProps = tmp; return this; } + + /** + * Configures a table's locality groups prior to initial table creation. + * + * Allows locality groups to be set prior to table creation. Additional calls to this method prior to table creation will overwrite previous locality group + * mappings. + * + * @param groups + * mapping of locality group names to column families in the locality group + * + * @since 2.0.0 + */ + public void setLocalityGroups(Map> groups) { + // ensure locality groups do not overlap + LocalityGroupUtil.ensureNonOverlappingGroups(groups); + localityProps = new HashMap<>(); + for (Entry> entry : groups.entrySet()) { + Set colFams = entry.getValue(); + String value = LocalityGroupUtil.encodeColumnFamilies(colFams); + localityProps.put(Property.TABLE_LOCALITY_GROUP_PREFIX + entry.getKey(), value); + } + // localityProps.put(Property.TABLE_LOCALITY_GROUPS.getKey(), Joiner.on(",").join(groups.keySet())); + localityProps.put(Property.TABLE_LOCALITY_GROUPS.getKey(), groups.keySet().stream().collect(Collectors.joining(","))); + // localityProps.put(Property.TABLE_LOCALITY_GROUPS.getKey(), Stream.of(groups.keySet().collect(Collectors.joining(",")); + // Stream.of(groups.keySet()).collect(joining(",")); + } + + /** + * Configure iterator settings for a table prior to its creation. + * + * Additional calls to this method before table creation will overwrite previous iterator settings. + * + * @param setting + * object specifying the properties of the iterator + * @throws AccumuloSecurityException + * thrown if the user does not have the ability to set properties on the table + * @throws AccumuloException + * if a general error occurs + * @throws TableNotFoundException + * if the table does not exist + * + * @since 2.0.0 + */ + public void attachIterator(IteratorSetting setting) throws AccumuloException, TableNotFoundException { + attachIterator(setting, EnumSet.allOf(IteratorScope.class)); + } + + /** + * Configure iterator settings for a table prior to its creation. + * + * @param setting + * object specifying the properties of the iterator + * @param scopes + * enumerated set of iterator scopes + * @throws AccumuloException + * if a general error occurs + * @throws AccumuloSecurityException Review comment: This exception is not thrown. ---------------------------------------------------------------- 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