accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ctubbsii commented on a change in pull request #524: Tiered Volume Chooser, including Regex and Default strategies.
Date Thu, 07 Jun 2018 21:16:35 GMT
ctubbsii commented on a change in pull request #524: Tiered Volume Chooser, including Regex
and Default strategies.
URL: https://github.com/apache/accumulo/pull/524#discussion_r193888629
 
 

 ##########
 File path: server/base/src/test/java/org/apache/accumulo/server/fs/TieredStorageVolumeChooserTest.java
 ##########
 @@ -0,0 +1,189 @@
+/*
+ * 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.server.fs;
+
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.junit.Assert.assertArrayEquals;
+
+import java.util.Arrays;
+
+import org.apache.accumulo.core.client.impl.Table;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.server.conf.ServerConfigurationFactory;
+import org.apache.hadoop.io.Text;
+import org.junit.Before;
+import org.junit.Test;
+
+public class TieredStorageVolumeChooserTest extends PreferredVolumeChooserTest {
+
+  private TieredStorageVolumeChooser chooser;
+
+  @Before
+  public void before() throws Exception {
+
+    super.before();
+
+    chooser = new TieredStorageVolumeChooser() {
+      @Override
+      ServerConfigurationFactory loadConfFactory() {
+        return confFactory;
+      }
+    };
+  }
+
+  @Test
+  public void testNoStrategySet() {
+    expect(tableConf.get(TieredStorageVolumeChooser.TABLE_TIERING_STRATEGY)).andReturn("");
+    expect(tableConf.get(Property.TABLE_CLASSPATH)).andReturn("");
+    expect(tableConf.get(PreferredVolumeChooser.TABLE_PREFERRED_VOLUMES)).andReturn("2,1");
+    replay(confFactory, tableConf, systemConf);
+    String[] volumes = chooseForTable(chooser);
+    Arrays.sort(volumes);
+    assertArrayEquals(new String[] {"1", "2"}, volumes);
+  }
+
+  @Test
+  public void testDefaultStrategyPreferredVolumesNotSet() {
+    expect(tableConf.get(TieredStorageVolumeChooser.TABLE_TIERING_STRATEGY))
+        .andReturn("org.apache.accumulo.server.fs.DefaultTieredStorageStrategy");
 
 Review comment:
   Could make this refactor-safe by using `ClassName.class.getName()` instead of a String
literal.

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

Mime
View raw message