protected static TabletStateStore getStoreForTablet(KeyExtent extent, ServerContext context) { if (extent.isRootTablet()) { return new ZooTabletStateStore(context); } else if (extent.isMeta()) { return new RootTabletStateStore(context); } else { return new MetaDataStateStore(context); } } }
scanning.set(true); Iterator<TabletLocationState> zooScanner = new ZooTabletStateStore(context).iterator();
private static Pair<Text,KeyExtent> verifyRootTablet(ServerContext context, TServerInstance instance) throws AccumuloException { ZooTabletStateStore store = new ZooTabletStateStore(context); 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) { throw new AccumuloException("Root tablet already has a location set"); } try { return new Pair<>(new Text(MetadataTableUtil.getRootTabletDir(context)), null); } catch (IOException e) { throw new AccumuloException(e); } }
watchers.add(new TabletGroupWatcher(this, new ZooTabletStateStore(new ZooStore(context)), watchers.get(1)) { @Override
public static void unassign(TabletLocationState tls) throws DistributedStoreException { TabletStateStore store; if (tls.extent.isRootTablet()) { store = new ZooTabletStateStore(); } else { store = new MetaDataStateStore(); } store.unassign(Collections.singletonList(tls)); }
public static void setLocation(Assignment assignment) throws DistributedStoreException { TabletStateStore store; if (assignment.tablet.isRootTablet()) { store = new ZooTabletStateStore(); } else { store = new MetaDataStateStore(); } store.setLocations(Collections.singletonList(assignment)); }
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) { throw new AccumuloException("Root tablet already has a location set"); } return new Pair<Text,KeyExtent>(new Text(Constants.ZROOT_TABLET), null); }
protected static TabletStateStore getStoreForTablet(KeyExtent extent, AccumuloServerContext context) throws DistributedStoreException { if (extent.isRootTablet()) { return new ZooTabletStateStore(); } else if (extent.isMeta()) { return new RootTabletStateStore(context); } else { return new MetaDataStateStore(context); } } }
zooScanner = new ZooTabletStateStore().iterator(); } catch (DistributedStoreException e) { throw new AccumuloException(e);
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) { throw new AccumuloException("Root tablet already has a location set"); } try { return new Pair<>(new Text(MetadataTableUtil.getRootTabletDir()), null); } catch (IOException e) { throw new AccumuloException(e); } }
final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)),
watchers.add(new TabletGroupWatcher(this, new ZooTabletStateStore(new ZooStore(zroot)), watchers.get(1)) { @Override