accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshelser <...@git.apache.org>
Subject [GitHub] accumulo pull request: ACCUMULO-3913 Added per table sampling
Date Tue, 15 Sep 2015 02:50:36 GMT
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/46#discussion_r39469879
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/sample/Sampler.java ---
    @@ -0,0 +1,45 @@
    +/*
    + * 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.sample;
    +
    +import org.apache.accumulo.core.client.admin.SamplerConfiguration;
    +import org.apache.accumulo.core.data.Key;
    +
    +/**
    + * A function that decides which key values are stored in a tables sample. As Accumuo
compacts data and creates rfiles it uses a Sampler to decided what to
    + * store in the rfiles sample section. The class name of the Sampler and the Samplers
configuration are stored in each rfile. A scan of a tables sample will
    + * only succeed if all rfiles were created with the same sampler and sampler configuration.
    + *
    + * <p>
    + * Since the decisions that Sampler makes are persisted, the behavior of a Sampler for
a given configuration should always be the same. One way to offer a new
    + * behavior is to offer new options, while still supporting old behavior with a Samplers
existing options.
    + *
    + * <p>
    + * Ideally a sampler that selects a Key k1 would also select updates for k1. For example
if a Sampler selects :
    + * {@code row='000989' family='name' qualifier='last' visibility='ADMIN' time=9 value='Doe'},
it would be nice if it also selected :
    + * {@code row='000989' family='name' qualifier='last' visibility='ADMIN' time=20 value='Dough'}.
Using hash and modulo on the key fields is a good way to
    + * accomplish this and {@link AbstractHashSampler} provides a good basis for implementation.
    + *
    + * @since 1.8.0
    + */
    +
    +public interface Sampler {
    +  void init(SamplerConfiguration config);
    +
    +  boolean accept(Key k);
    --- End diff --
    
    Javadoc on the methods of the interface would be good. If it's intended that users can
implement their own Sampler, it would be good to explain what each method should do.


---
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.
---

Mime
View raw message