use of org.apache.accumulo.core.metadata.TabletLocationState in project accumulo by apache.
the class TabletLocationStateTest method testGetServer_Current.
@Test
public void testGetServer_Current() throws Exception {
tls = new TabletLocationState(keyExtent, null, current, last, null, walogs, true);
assertSame(current, tls.getLocation());
}
use of org.apache.accumulo.core.metadata.TabletLocationState in project accumulo by apache.
the class TabletLocationStateTest method testGetState_Dead1.
@Test
public void testGetState_Dead1() throws Exception {
Set<TServerInstance> liveServers = new java.util.HashSet<>();
liveServers.add(current);
tls = new TabletLocationState(keyExtent, future, null, last, null, walogs, true);
assertEquals(TabletState.ASSIGNED_TO_DEAD_SERVER, tls.getState(liveServers));
}
use of org.apache.accumulo.core.metadata.TabletLocationState in project accumulo by apache.
the class TabletLocationStateTest method testConstruction_NoFuture.
@Test
public void testConstruction_NoFuture() throws Exception {
tls = new TabletLocationState(keyExtent, null, current, last, null, walogs, true);
assertSame(keyExtent, tls.extent);
assertNull(tls.future);
assertSame(current, tls.current);
assertSame(last, tls.last);
assertSame(walogs, tls.walogs);
assertTrue(tls.chopped);
}
use of org.apache.accumulo.core.metadata.TabletLocationState in project accumulo by apache.
the class CleanUp method isReady.
@Override
public long isReady(long tid, Manager manager) throws Exception {
if (!manager.hasCycled(creationTime)) {
return 50;
}
boolean done = true;
Range tableRange = new KeyExtent(tableId, null, null).toMetaRange();
Scanner scanner = manager.getContext().createScanner(MetadataTable.NAME, Authorizations.EMPTY);
MetaDataTableScanner.configureScanner(scanner, manager);
scanner.setRange(tableRange);
for (Entry<Key, Value> entry : scanner) {
TabletLocationState locationState = MetaDataTableScanner.createTabletLocationState(entry.getKey(), entry.getValue());
TabletState state = locationState.getState(manager.onlineTabletServers());
if (!state.equals(TabletState.UNASSIGNED)) {
// This code will even wait on tablets that are assigned to dead tablets servers. This is
// intentional because the manager may make metadata writes for these tablets. See #587
log.debug("Still waiting for table({}) to be deleted; Target tablet state: UNASSIGNED, " + "Current tablet state: {}, locationState: {}", tableId, state, locationState);
done = false;
break;
}
}
if (!done)
return 50;
return 0;
}
use of org.apache.accumulo.core.metadata.TabletLocationState in project accumulo by apache.
the class MergeStateIT method scan.
private MergeStats scan(MockCurrentState state, TabletStateStore metaDataStateStore) {
MergeStats stats = new MergeStats(state.mergeInfo);
stats.getMergeInfo().setState(MergeState.WAITING_FOR_OFFLINE);
for (TabletLocationState tss : metaDataStateStore) {
stats.update(tss.extent, tss.getState(state.onlineTabletServers()), tss.chopped, false);
}
return stats;
}
Aggregations