Search in sources :

Example 11 with MasterServices

use of org.apache.hadoop.hbase.master.MasterServices in project hbase by apache.

the class TestRSGroupBasedLoadBalancer method getMockedMaster.

private static MasterServices getMockedMaster() throws IOException {
    TableDescriptors tds = Mockito.mock(TableDescriptors.class);
    Mockito.when(tds.get(tables[0])).thenReturn(tableDescs.get(0));
    Mockito.when(tds.get(tables[1])).thenReturn(tableDescs.get(1));
    Mockito.when(tds.get(tables[2])).thenReturn(tableDescs.get(2));
    Mockito.when(tds.get(tables[3])).thenReturn(tableDescs.get(3));
    MasterServices services = Mockito.mock(HMaster.class);
    Mockito.when(services.getTableDescriptors()).thenReturn(tds);
    AssignmentManager am = Mockito.mock(AssignmentManager.class);
    Mockito.when(services.getAssignmentManager()).thenReturn(am);
    return services;
}
Also used : TableDescriptors(org.apache.hadoop.hbase.TableDescriptors) AssignmentManager(org.apache.hadoop.hbase.master.AssignmentManager) MasterServices(org.apache.hadoop.hbase.master.MasterServices)

Aggregations

MasterServices (org.apache.hadoop.hbase.master.MasterServices)11 IOException (java.io.IOException)4 Configuration (org.apache.hadoop.conf.Configuration)4 HRegionInfo (org.apache.hadoop.hbase.HRegionInfo)4 HBaseConfiguration (org.apache.hadoop.hbase.HBaseConfiguration)3 ServerName (org.apache.hadoop.hbase.ServerName)3 InterruptedIOException (java.io.InterruptedIOException)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 AssignmentManager (org.apache.hadoop.hbase.master.AssignmentManager)2 ServerManager (org.apache.hadoop.hbase.master.ServerManager)2 PathMatcher (java.nio.file.PathMatcher)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Matcher (java.util.regex.Matcher)1 Path (org.apache.hadoop.fs.Path)1 HColumnDescriptor (org.apache.hadoop.hbase.HColumnDescriptor)1 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)1 RegionLoad (org.apache.hadoop.hbase.RegionLoad)1 TableDescriptors (org.apache.hadoop.hbase.TableDescriptors)1