Search in sources :

Example 26 with TabletLocationState

use of org.apache.accumulo.core.metadata.TabletLocationState in project accumulo by apache.

the class TabletLocationStateTest method testConstruction_NoFuture_NoWalogs.

@Test
public void testConstruction_NoFuture_NoWalogs() throws Exception {
    tls = new TabletLocationState(keyExtent, null, current, last, null, null, true);
    assertNotNull(tls.walogs);
    assertEquals(0, tls.walogs.size());
}
Also used : TabletLocationState(org.apache.accumulo.core.metadata.TabletLocationState) Test(org.junit.Test)

Example 27 with TabletLocationState

use of org.apache.accumulo.core.metadata.TabletLocationState in project accumulo by apache.

the class TabletLocationStateTest method testGetServer_Last.

@Test
public void testGetServer_Last() throws Exception {
    tls = new TabletLocationState(keyExtent, null, null, last, null, walogs, true);
    assertSame(last, tls.getLocation());
}
Also used : TabletLocationState(org.apache.accumulo.core.metadata.TabletLocationState) Test(org.junit.Test)

Example 28 with TabletLocationState

use of org.apache.accumulo.core.metadata.TabletLocationState in project accumulo by apache.

the class TabletLocationStateTest method testGetServer_Future.

@Test
public void testGetServer_Future() throws Exception {
    tls = new TabletLocationState(keyExtent, future, null, last, null, walogs, true);
    assertSame(future, tls.getLocation());
}
Also used : TabletLocationState(org.apache.accumulo.core.metadata.TabletLocationState) Test(org.junit.Test)

Example 29 with TabletLocationState

use of org.apache.accumulo.core.metadata.TabletLocationState in project accumulo by apache.

the class TabletLocationStateTest method testGetState_Dead2.

@Test
public void testGetState_Dead2() throws Exception {
    Set<TServerInstance> liveServers = new java.util.HashSet<>();
    liveServers.add(future);
    tls = new TabletLocationState(keyExtent, null, current, last, null, walogs, true);
    assertEquals(TabletState.ASSIGNED_TO_DEAD_SERVER, tls.getState(liveServers));
}
Also used : TabletLocationState(org.apache.accumulo.core.metadata.TabletLocationState) TServerInstance(org.apache.accumulo.core.metadata.TServerInstance) Test(org.junit.Test)

Example 30 with TabletLocationState

use of org.apache.accumulo.core.metadata.TabletLocationState in project accumulo by apache.

the class TabletLocationStateTest method testGetState_Unassigned1.

@Test
public void testGetState_Unassigned1() throws Exception {
    tls = new TabletLocationState(keyExtent, null, null, null, null, walogs, true);
    assertEquals(TabletState.UNASSIGNED, tls.getState(null));
}
Also used : TabletLocationState(org.apache.accumulo.core.metadata.TabletLocationState) Test(org.junit.Test)

Aggregations

TabletLocationState (org.apache.accumulo.core.metadata.TabletLocationState)35 Test (org.junit.Test)19 TServerInstance (org.apache.accumulo.core.metadata.TServerInstance)15 KeyExtent (org.apache.accumulo.core.dataImpl.KeyExtent)8 TableId (org.apache.accumulo.core.data.TableId)7 Range (org.apache.accumulo.core.data.Range)6 BadLocationStateException (org.apache.accumulo.core.metadata.TabletLocationState.BadLocationStateException)6 Text (org.apache.hadoop.io.Text)6 ArrayList (java.util.ArrayList)5 Value (org.apache.accumulo.core.data.Value)5 MetaDataTableScanner (org.apache.accumulo.server.manager.state.MetaDataTableScanner)5 Key (org.apache.accumulo.core.data.Key)4 Collection (java.util.Collection)3 HashSet (java.util.HashSet)3 AccumuloClient (org.apache.accumulo.core.client.AccumuloClient)3 TabletMutator (org.apache.accumulo.core.metadata.schema.Ample.TabletMutator)3 MergeStats (org.apache.accumulo.manager.state.MergeStats)3 ServerContext (org.apache.accumulo.server.ServerContext)3 Assignment (org.apache.accumulo.server.manager.state.Assignment)3 TabletStateStore (org.apache.accumulo.server.manager.state.TabletStateStore)3