accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-3089) Create a volume chooser that makes decisions based on table attributes
Date Fri, 26 Sep 2014 04:43:34 GMT

    [ https://issues.apache.org/jira/browse/ACCUMULO-3089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14148752#comment-14148752
] 

ASF GitHub Bot commented on ACCUMULO-3089:
------------------------------------------

Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/16#discussion_r18073577
  
    --- Diff: server/base/src/main/java/org/apache/accumulo/server/fs/RandomVolumeChooser.java
---
    @@ -16,14 +16,65 @@
      */
     package org.apache.accumulo.server.fs;
     
    +import java.util.ArrayList;
    +import java.util.Arrays;
    +import java.util.List;
    +import java.util.Map;
     import java.util.Random;
     
    +import org.apache.accumulo.core.conf.AccumuloConfiguration.AllFilter;
    +import org.apache.accumulo.core.conf.AccumuloConfiguration.PropertyFilter;
    +import org.apache.log4j.Logger;
    +
     public class RandomVolumeChooser implements VolumeChooser {
    +  private static final Logger log = Logger.getLogger(RandomVolumeChooser.class);
       Random random = new Random();
    -  
    +
    +  public RandomVolumeChooser() {}
    +
       @Override
    -  public String choose(String[] options) {
    -    return options[random.nextInt(options.length)];
    +  public String choose(VolumeChooserEnvironment env, String[] options) {
    +    // Get the current table's properties, and find the preferred volumes property
    +    PropertyFilter filter = new AllFilter();
    +    Map<String,String> props = new java.util.HashMap<String,String>();
    +    ArrayList<String> prefVol = new ArrayList<String>();
    +    env.getProperties(props, filter);
    +    String volumes = props.get("table.custom.preferredVolumes");
    --- End diff --
    
    Thinking some more, if this does become its own standalone implementation, the value should
also be changed so that it reflects usage by this implementation. e.g if you named the new
class `FooVolumeChooser` the property could be something like `table.foo.volume.candidates`
or similar (hopefully that's clear)


> Create a volume chooser that makes decisions based on table attributes
> ----------------------------------------------------------------------
>
>                 Key: ACCUMULO-3089
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-3089
>             Project: Accumulo
>          Issue Type: Improvement
>            Reporter: Christopher Tubbs
>            Assignee: Jenna Huston
>
> Use case:
> User provisions multiple volumes, some with tmpfs drives, some with SSDs, some with traditional
magnetic spindle hard drives. A volume chooser could use attribute information on tables (ACCUMULO-2841)
to decide which volume to choose when creating new tablets.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message