Package org.apache.accumulo.server.master

Examples of org.apache.accumulo.server.master.LiveTServerSet$TServerConnection


    Instance instance = opts.getInstance();
    MetaDataTableScanner rootScanner = new MetaDataTableScanner(instance, SecurityConstants.getSystemCredentials(), Constants.METADATA_ROOT_TABLET_KEYSPACE);
    MetaDataTableScanner metaScanner = new MetaDataTableScanner(instance, SecurityConstants.getSystemCredentials(), Constants.NON_ROOT_METADATA_KEYSPACE);
    @SuppressWarnings("unchecked")
    Iterator<TabletLocationState> scanner = (Iterator<TabletLocationState>)new IteratorChain(rootScanner, metaScanner);
    LiveTServerSet tservers = new LiveTServerSet(instance, DefaultConfiguration.getDefaultConfiguration(), new Listener() {
      @Override
      public void update(LiveTServerSet current, Set<TServerInstance> deleted, Set<TServerInstance> added) {
        if (!deleted.isEmpty() && scanning.get())
          log.warn("Tablet servers deleted while scanning: " + deleted);
        if (!added.isEmpty() && scanning.get())
          log.warn("Tablet servers added while scanning: " + added);
      }
    });
    tservers.startListeningForTabletServerChanges();
    scanning.set(true);
    while (scanner.hasNext()) {
      TabletLocationState locationState = scanner.next();
      TabletState state = locationState.getState(tservers.getCurrentServers());
      if (state != null && state != TabletState.HOSTED && TableManager.getInstance().getTableState(locationState.extent.getTableId().toString()) != TableState.OFFLINE)
        if (!locationState.extent.equals(Constants.ROOT_TABLET_EXTENT))
          System.out.println(locationState + " is " + state + "  #walogs:" + locationState.walogs.size());
    }
  }
View Full Code Here


        Constants.ROOT_TABLET_EXTENT.toMetadataRange());
    MetaDataTableScanner metaScanner = new MetaDataTableScanner(zooInst, SecurityConstants.getSystemCredentials(), Constants.NON_ROOT_METADATA_KEYSPACE);
    @SuppressWarnings("unchecked")
    Iterator<TabletLocationState> scanner = (Iterator<TabletLocationState>) new IteratorChain(rootScanner, metaScanner);
    final AtomicBoolean scanning = new AtomicBoolean(false);
    LiveTServerSet tservers = new LiveTServerSet(zooInst, new Listener() {
      @Override
      public void update(LiveTServerSet current, Set<TServerInstance> deleted, Set<TServerInstance> added) {
        if (!deleted.isEmpty() && scanning.get())
          log.warn("Tablet servers deleted while scanning: " + deleted);
        if (!added.isEmpty() && scanning.get())
          log.warn("Tablet servers added while scanning: " + added);
      }
    });
   
    tservers.startListeningForTabletServerChanges();
    scanning.set(true);

    while (scanner.hasNext()) {
      TabletLocationState locationState = scanner.next();
      TabletState state = locationState.getState(tservers.getCurrentServers());
      if (state != null && state != TabletState.HOSTED
          && TableManager.getInstance().getTableState(locationState.extent.getTableId().toString()) != TableState.OFFLINE)
        if (!locationState.extent.equals(Constants.ROOT_TABLET_EXTENT))
          System.out.println(locationState + " is " + state + "  #walogs:" + locationState.walogs.size());
    }
View Full Code Here

    Instance instance = opts.getInstance();
    MetaDataTableScanner rootScanner = new MetaDataTableScanner(instance, SecurityConstants.getSystemCredentials(), Constants.METADATA_ROOT_TABLET_KEYSPACE);
    MetaDataTableScanner metaScanner = new MetaDataTableScanner(instance, SecurityConstants.getSystemCredentials(), Constants.NON_ROOT_METADATA_KEYSPACE);
    @SuppressWarnings("unchecked")
    Iterator<TabletLocationState> scanner = (Iterator<TabletLocationState>)new IteratorChain(rootScanner, metaScanner);
    LiveTServerSet tservers = new LiveTServerSet(instance, DefaultConfiguration.getDefaultConfiguration(), new Listener() {
      @Override
      public void update(LiveTServerSet current, Set<TServerInstance> deleted, Set<TServerInstance> added) {
        if (!deleted.isEmpty() && scanning.get())
          log.warn("Tablet servers deleted while scanning: " + deleted);
        if (!added.isEmpty() && scanning.get())
          log.warn("Tablet servers added while scanning: " + added);
      }
    });
    tservers.startListeningForTabletServerChanges();
    scanning.set(true);
    while (scanner.hasNext()) {
      TabletLocationState locationState = scanner.next();
      TabletState state = locationState.getState(tservers.getCurrentServers());
      if (state != null && state != TabletState.HOSTED && TableManager.getInstance().getTableState(locationState.extent.getTableId().toString()) != TableState.OFFLINE)
        if (!locationState.extent.equals(Constants.ROOT_TABLET_EXTENT))
          System.out.println(locationState + " is " + state + "  #walogs:" + locationState.walogs.size());
    }
  }
View Full Code Here

    log.info("Version " + Constants.VERSION);
    log.info("Instance " + instance.getInstanceID());
    ThriftTransportPool.getInstance().setIdleTime(aconf.getTimeInMillis(Property.GENERAL_RPC_TIMEOUT));
    security = AuditedSecurityOperation.getInstance();
    tserverSet = new LiveTServerSet(instance, config.getConfiguration(), this);
    this.tabletBalancer = aconf.instantiateClassProperty(Property.MASTER_TABLET_BALANCER, TabletBalancer.class, new DefaultLoadBalancer());
    this.tabletBalancer.init(serverConfig);

    try {
      AccumuloVFSClassLoader.getContextManager().setContextConfig(new ContextManager.DefaultContextsConfig(new Iterable<Entry<String,String>>() {
View Full Code Here

    }
    String instance = args[0];
    String keepers = args[1];
    Instance zooInst = new ZooKeeperInstance(instance, keepers);
    MetaDataTableScanner scanner = new MetaDataTableScanner(zooInst, SecurityConstants.getSystemCredentials(), new Range());
    LiveTServerSet tservers = new LiveTServerSet(zooInst, new Listener() {
      @Override
      public void update(LiveTServerSet current, Set<TServerInstance> deleted, Set<TServerInstance> added) {
        if (!deleted.isEmpty())
          log.warn("Tablet servers deleted while scanning: " + deleted);
        if (!added.isEmpty())
          log.warn("Tablet servers added while scanning: " + added);
      }
    });
    while (scanner.hasNext()) {
      TabletLocationState locationState = scanner.next();
      TabletState state = locationState.getState(tservers.getCurrentServers());
      if (state != TabletState.HOSTED && TableManager.getInstance().getTableState(locationState.extent.getTableId().toString()) != TableState.OFFLINE)
        System.out.println(locationState + " is " + state);
    }
  }
View Full Code Here

    log.info("Version " + Constants.VERSION);
    log.info("Instance " + instance.getInstanceID());
    ThriftTransportPool.getInstance().setIdleTime(aconf.getTimeInMillis(Property.GENERAL_RPC_TIMEOUT));
    security = AuditedSecurityOperation.getInstance();
    tserverSet = new LiveTServerSet(instance, config.getConfiguration(), this);
    this.tabletBalancer = aconf.instantiateClassProperty(Property.MASTER_TABLET_BALANCER, TabletBalancer.class, new DefaultLoadBalancer());
    this.tabletBalancer.init(serverConfig);
  }
View Full Code Here

  static int findOffline(Instance instance, Credentials creds, String tableName) throws AccumuloException, TableNotFoundException {

    final AtomicBoolean scanning = new AtomicBoolean(false);

    LiveTServerSet tservers = new LiveTServerSet(instance, DefaultConfiguration.getDefaultConfiguration(), new Listener() {
      @Override
      public void update(LiveTServerSet current, Set<TServerInstance> deleted, Set<TServerInstance> added) {
        if (!deleted.isEmpty() && scanning.get())
          log.warn("Tablet servers deleted while scanning: " + deleted);
        if (!added.isEmpty() && scanning.get())
          log.warn("Tablet servers added while scanning: " + added);
      }
    });
    tservers.startListeningForTabletServerChanges();
    scanning.set(true);

    Iterator<TabletLocationState> zooScanner;
    try {
      zooScanner = new ZooTabletStateStore().iterator();
View Full Code Here

TOP

Related Classes of org.apache.accumulo.server.master.LiveTServerSet$TServerConnection

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.