Examples of ZooTabletStateStore


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

  }

  private long totalMinorCompactions;

  private static Pair<Text,KeyExtent> verifyRootTablet(KeyExtent extent, TServerInstance instance) throws DistributedStoreException, AccumuloException {
    ZooTabletStateStore store = new ZooTabletStateStore();
    if (!store.iterator().hasNext()) {
      throw new AccumuloException("Illegal state: location is not set in zookeeper");
    }
    TabletLocationState next = store.iterator().next();
    if (!instance.equals(next.future)) {
      throw new AccumuloException("Future location is not to this server for the root tablet");
    }

    if (next.current != null) {
View Full Code Here

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

    tservers.startListeningForTabletServerChanges();
    scanning.set(true);

    Iterator<TabletLocationState> zooScanner;
    try {
      zooScanner = new ZooTabletStateStore().iterator();
    } catch (DistributedStoreException e) {
      throw new AccumuloException(e);
    }

    int offline = 0;
View Full Code Here

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

    migrationCleanupThread.start();
   
    tserverSet.startListeningForTabletServerChanges();
   
    AuthInfo systemAuths = SecurityConstants.getSystemCredentials();
    final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)), new RootTabletStateStore(instance, systemAuths, this),
        new MetaDataStateStore(instance, systemAuths, this)};
    for (int i = 0; i < stores.length; i++) {
      watchers.add(new TabletGroupWatcher(stores[i]));
    }
    for (TabletGroupWatcher watcher : watchers) {
View Full Code Here

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

    // TODO move this code to isReady() and drop while loop?
    // Make sure nobody is still using logs hosted on that node
    Listener listener = m.getEventCoordinator().getListener();
    while (m.stillMaster()) {
      boolean flushed = false;
      ZooTabletStateStore zooTabletStateStore = null;
      try {
        zooTabletStateStore = new ZooTabletStateStore();
      } catch (DistributedStoreException e) {
        log.warn("Unable to open ZooTabletStateStore, will retry", e);
      }
      MetaDataStateStore theRest = new MetaDataStateStore();
      for (TabletStateStore store : new TabletStateStore[] {zooTabletStateStore, theRest}) {
View Full Code Here

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

    assertEquals(new HashSet<String>(children), new HashSet<String>(Arrays.asList("b")));
  }
 
  @Test
  public void testRootTabletStateStore() throws DistributedStoreException {
    ZooTabletStateStore tstore = new ZooTabletStateStore(new FakeZooStore());
    KeyExtent root = Constants.ROOT_TABLET_EXTENT;
    String sessionId = "this is my unique session data";
    TServerInstance server = new TServerInstance(AddressUtil.parseAddress("127.0.0.1", 10000), sessionId);
    List<Assignment> assignments = Collections.singletonList(new Assignment(root, server));
    tstore.setFutureLocations(assignments);
    int count = 0;
    for (TabletLocationState location : tstore) {
      assertEquals(location.extent, root);
      assertEquals(location.future, server);
      assertNull(location.current);
      count++;
    }
    assertEquals(count, 1);
    tstore.setLocations(assignments);
    count = 0;
    for (TabletLocationState location : tstore) {
      assertEquals(location.extent, root);
      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

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

    migrationCleanupThread.start();
   
    tserverSet.startListeningForTabletServerChanges();
   
    AuthInfo systemAuths = SecurityConstants.getSystemCredentials();
    final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)), new RootTabletStateStore(instance, systemAuths, this),
        new MetaDataStateStore(instance, systemAuths, this)};
    for (int i = 0; i < stores.length; i++) {
      watchers.add(new TabletGroupWatcher(stores[i]));
    }
    for (TabletGroupWatcher watcher : watchers) {
View Full Code Here

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

    log.info("Starting with " + count + " tablet servers");
   
    recoverServersToShutdownFromZooKeeper();
    SimpleTimer.getInstance().schedule(new ShutdownTabletServers(), 1000, 1000);
   
    final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)), new RootTabletStateStore(this), new MetaDataStateStore(this)};
    for (int i = 0; i < stores.length; i++) {
      watchers.add(new TabletGroupWatcher(stores[i]));
    }
    for (TabletGroupWatcher watcher : watchers) {
      watcher.start();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.