Package org.apache.accumulo.server.master.state

Examples of org.apache.accumulo.server.master.state.TabletLocationState


      // exceptions
      onlineTablets.remove(extent);
     
      try {
        TServerInstance instance = new TServerInstance(clientAddress, getLock().getSessionId());
        TabletLocationState tls = new TabletLocationState(extent, null, instance, null, null, false);
        log.debug("Unassigning " + tls);
        TabletStateStore.unassign(tls);
      } catch (DistributedStoreException ex) {
        log.warn("Unable to update storage", ex);
      } catch (KeeperException e) {
View Full Code Here


    MetaDataTableScanner s = new MetaDataTableScanner(tableRange);
    long randomSessionID = port;
    TServerInstance instance = new TServerInstance(addr, randomSessionID);
    List<Assignment> assignments = new ArrayList<Assignment>();
    while (s.hasNext()) {
      TabletLocationState next = s.next();
      assignments.add(new Assignment(next.extent, instance));
    }
    // point them to this server
    MetaDataStateStore store = new MetaDataStateStore(null);
    store.setLocations(assignments);
View Full Code Here

      assertNull(location.future);
      assertEquals(location.current, server);
      count++;
    }
    assertEquals(count, 1);
    TabletLocationState assigned = new TabletLocationState(root, server, null, null, null);
    tstore.unassign(Collections.singletonList(assigned));
    count = 0;
    for (TabletLocationState location : tstore) {
      assertEquals(location.extent, root);
      assertNull(location.future);
      assertNull(location.current);
      count++;
    }
    assertEquals(count, 1);
   
    KeyExtent notRoot = new KeyExtent(new Text("0"), null, null);
    try {
      tstore.setLocations(Collections.singletonList(new Assignment(notRoot, server)));
      Assert.fail("should not get here");
    } catch (IllegalArgumentException ex) {}
   
    try {
      tstore.setFutureLocations(Collections.singletonList(new Assignment(notRoot, server)));
      Assert.fail("should not get here");
    } catch (IllegalArgumentException ex) {}
   
    TabletLocationState broken = new TabletLocationState(notRoot, server, null, null, null);
    try {
      tstore.unassign(Collections.singletonList(broken));
      Assert.fail("should not get here");
    } catch (IllegalArgumentException ex) {}
  }
View Full Code Here

      // stop serving tablet - client will get not serving tablet exceptions
      onlineTablets.remove(extent);
     
      try {
        TServerInstance instance = new TServerInstance(clientAddress, getLock().getSessionId());
        TabletLocationState tls = new TabletLocationState(extent, null, instance, null, null);
        log.debug("Unassigning " + tls);
        TabletStateStore.unassign(tls);
      } catch (DistributedStoreException ex) {
        log.warn("Unable to update storage", ex);
      } catch (KeeperException e) {
View Full Code Here

      // exceptions
      onlineTablets.remove(extent);
     
      try {
        TServerInstance instance = new TServerInstance(clientAddress, getLock().getSessionId());
        TabletLocationState tls = new TabletLocationState(extent, null, instance, null, null, false);
        log.debug("Unassigning " + tls);
        TabletStateStore.unassign(tls);
      } catch (DistributedStoreException ex) {
        log.warn("Unable to update storage", ex);
      } catch (KeeperException e) {
View Full Code Here

        done = true;
        Range tableRange = new KeyExtent(new Text(tableId), null, null).toMetadataRange();
        MetaDataTableScanner metaDataTableScanner = new MetaDataTableScanner(tableRange, null, null);
        try {
          while (metaDataTableScanner.hasNext()) {
            TabletLocationState locationState = metaDataTableScanner.next();
            TabletState state = locationState.getState(onlineTabletServers());
            if (state.equals(TabletState.ASSIGNED) || state.equals(TabletState.HOSTED)) {
              log.debug("Still waiting for table to be deleted: " + tableId + " locationState: " + locationState);
              done = false;
              break;
            }
View Full Code Here

    MetaDataTableScanner scanner = new MetaDataTableScanner(new Range(KeyExtent.getMetadataEntry(new Text(tableId), new Text()), KeyExtent.getMetadataEntry(
        new Text(tableId), null)));
   
    TreeSet<String> locs = new TreeSet<String>();
    while (scanner.hasNext()) {
      TabletLocationState state = scanner.next();
      if (state.current != null) {
        try {
          locs.add(state.current.hostPort());
        } catch (Exception ex) {
          log.error(ex, ex);
View Full Code Here

    Assert.assertEquals(MergeState.WAITING_FOR_OFFLINE, stats.nextMergeState(connector, state));

    // take it offline
    m = tablet.getPrevRowUpdateMutation();
    Collection<Collection<String>> walogs = Collections.emptyList();
    metaDataStateStore.unassign(Collections.singletonList(new TabletLocationState(tablet, null, state.someTServer, null, walogs, false)));
   
    // now we can split
    stats = scan(state, metaDataStateStore);
    Assert.assertEquals(MergeState.MERGING, stats.nextMergeState(connector, state));
View Full Code Here

TOP

Related Classes of org.apache.accumulo.server.master.state.TabletLocationState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.