Package org.apache.accumulo.core.client

Examples of org.apache.accumulo.core.client.Instance


    // reserve the table name in zookeeper or fail
   
    Utils.tableNameLock.lock();
    try {
      // write tableName & tableId to zookeeper
      Instance instance = HdfsZooInstance.getInstance();
     
      Utils.checkTableDoesNotExist(instance, tableInfo.tableName, tableInfo.tableId, TableOperation.CREATE);
     
      TableManager.getInstance().addTable(tableInfo.tableId, tableInfo.tableName, NodeExistsPolicy.OVERWRITE);
     
View Full Code Here


    return new CreateImportDir(tableInfo);
  }
 
  @Override
  public void undo(long tid, Master env) throws Exception {
    Instance instance = HdfsZooInstance.getInstance();
    TableManager.getInstance().removeTable(tableInfo.tableId);
    Utils.unreserveTable(tableInfo.tableId, tid, true);
    Tables.clearCache(instance);
  }
View Full Code Here

   
    // assuming only the master process is creating tables
   
    Utils.idLock.lock();
    try {
      Instance instance = HdfsZooInstance.getInstance();
      tableInfo.tableId = Utils.getNextTableId(tableInfo.tableName, instance);
      return new ImportSetupPermissions(tableInfo);
    } finally {
      Utils.idLock.unlock();
    }
View Full Code Here

        break;
    }
   
    long scanTime = System.currentTimeMillis() - t1;
   
    Instance instance = master.getInstance();
    Tables.clearCache(instance);
    if (tabletCount == 0 && !Tables.exists(instance, tableId))
      throw new ThriftTableOperationException(tableId, null, TableOperation.COMPACT, TableOperationExceptionType.NOTFOUND, null);
   
    if (serversToFlush.size() == 0 && Tables.getTableState(instance, tableId) == TableState.OFFLINE)
View Full Code Here

  }
 
  @Override
  public void visit(State state, Properties props) throws Exception {
   
    Instance instance = state.getInstance();
   
    List<TServerInstance> currentServers = new ArrayList<TServerInstance>(getTServers(instance));
    Collections.shuffle(currentServers);
    Runtime runtime = Runtime.getRuntime();
    if (currentServers.size() > 1) {
View Full Code Here

  private static GCStatus fetchGcStatus() {
    GCStatus result = null;
    InetSocketAddress address = null;
    try {
      // Read the gc location from its lock
      Instance instance = HdfsZooInstance.getInstance();
      String zooKeepers = instance.getZooKeepers();
      log.debug("connecting to zookeepers " + zooKeepers);
      ZooKeeper zk = new ZooKeeper(zooKeepers, (int) config.getConfiguration().getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT), new Watcher() {
        @Override
        public void process(WatchedEvent event) {}
      });
View Full Code Here

      columnsTmp = opts.columns.split(",");
    final String columns[] = columnsTmp;
   
    final FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());

    Instance instance = opts.getInstance();
    final ServerConfiguration sconf = new ServerConfiguration(instance);
   
    String tableId = Tables.getNameToIdMap(instance).get(opts.tableName);
    if (tableId == null) {
      log.error("Unable to find table named " + opts.tableName);
View Full Code Here

      sb.append(String.format("<deadLogger id='%s' lastChange='%d' status='%s'/>\n", dead.server, dead.lastStatus, dead.status));
    }
    sb.append("\n</deadLoggers>\n");
   
    sb.append("\n<tables>\n");
    Instance instance = HdfsZooInstance.getInstance();
    for (Entry<String,TableInfo> entry : tableStats.entrySet()) {
      TableInfo tableInfo = entry.getValue();
     
      sb.append("\n<table>\n");
      String tableId = entry.getKey();
View Full Code Here

  Map<String,Map<KeyExtent,List<Range>>> binOfflineTable(JobConf job, String tableName, List<Range> ranges) throws TableNotFoundException, AccumuloException,
      AccumuloSecurityException {
   
    Map<String,Map<KeyExtent,List<Range>>> binnedRanges = new HashMap<String,Map<KeyExtent,List<Range>>>();
   
    Instance instance = getInstance(job);
    Connector conn = instance.getConnector(getPrincipal(job), CredentialHelper.extractToken(getTokenClass(job), getToken(job)));
    String tableId = Tables.getTableId(instance, tableName);
   
    if (Tables.getTableState(instance, tableId) != TableState.OFFLINE) {
      Tables.clearCache(instance);
      if (Tables.getTableState(instance, tableId) != TableState.OFFLINE) {
View Full Code Here

          // Some tablets were still online, try again
          UtilWaitThread.sleep(100 + (int) (Math.random() * 100)); // sleep randomly between 100 and 200 ms
          binnedRanges = binOfflineTable(job, tableName, ranges);
        }
      } else {
        Instance instance = getInstance(job);
        String tableId = null;
        tl = getTabletLocator(job);
        // its possible that the cache could contain complete, but old information about a tables tablets... so clear it
        tl.invalidateCache();
        while (!tl.binRanges(ranges, binnedRanges,
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.Instance

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.