Package org.apache.accumulo.core.client

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


       
        TabletLocation tl = tabLocator.locateTablet(split, false, false);
       
        if (tl == null) {
          if (!Tables.exists(instance, tableId))
            throw new TableNotFoundException(tableId, tableName, null);
          else if (Tables.getTableState(instance, tableId) == TableState.OFFLINE)
            throw new TableOfflineException(instance, tableId);
          continue;
        }
       
        try {
          TabletClientService.Iface client = ThriftUtil.getTServerClient(tl.tablet_location, instance.getConfiguration());
          try {
            OpTimer opTimer = null;
            if (log.isTraceEnabled())
              opTimer = new OpTimer(log, Level.TRACE).start("Splitting tablet " + tl.tablet_extent + " on " + tl.tablet_location + " at " + split);
           
            client.splitTablet(null, credentials, tl.tablet_extent.toThrift(), TextUtil.getByteBuffer(split));
           
            // just split it, might as well invalidate it in the cache
            tabLocator.invalidateCache(tl.tablet_extent);
           
            if (opTimer != null)
              opTimer.stop("Split tablet in %DURATION%");
          } finally {
            ThriftUtil.returnClient((TServiceClient) client);
          }
         
        } catch (TApplicationException tae) {
          throw new AccumuloServerException(tl.tablet_location, tae);
        } catch (TTransportException e) {
          tabLocator.invalidateCache(tl.tablet_location);
          continue;
        } catch (ThriftSecurityException e) {
          Tables.clearCache(instance);
          if (!Tables.exists(instance, tableId))
            throw new TableNotFoundException(tableId, tableName, null);
          throw new AccumuloSecurityException(e.user, e.code, e);
        } catch (NotServingTabletException e) {
          tabLocator.invalidateCache(tl.tablet_extent);
          continue;
        } catch (TException e) {
View Full Code Here


  public Collection<Text> getSplits(String tableName) throws TableNotFoundException {
   
    ArgumentChecker.notNull(tableName);
   
    if (!exists(tableName)) {
      throw new TableNotFoundException(null, tableName, "Unknown table for getSplits");
    }
   
    SortedSet<KeyExtent> tablets = new TreeSet<KeyExtent>();
    Map<KeyExtent,String> locations = new TreeMap<KeyExtent,String>();
   
View Full Code Here

      log.debug("flush security exception on table id " + tableId);
      throw new AccumuloSecurityException(e.user, e.code, e);
    } catch (ThriftTableOperationException e) {
      switch (e.getType()) {
        case NOTFOUND:
          throw new TableNotFoundException(e);
        case OTHER:
        default:
          throw new AccumuloException(e.description, e);
      }
    } catch (Exception e) {
View Full Code Here

        }
      }).entrySet();
    } catch (ThriftTableOperationException e) {
      switch (e.getType()) {
        case NOTFOUND:
          throw new TableNotFoundException(e);
        case OTHER:
        default:
          throw new AccumuloException(e.description, e);
      }
    } catch (AccumuloException e) {
View Full Code Here

    } catch (ThriftSecurityException e) {
      throw new AccumuloSecurityException(e.user, e.code, e);
    } catch (ThriftTableOperationException e) {
      switch (e.getType()) {
        case EXISTS:
          throw new TableNotFoundException(e);
        case OTHER:
        default:
          throw new AccumuloException(e.getMessage(), e);
      }
    } catch (Exception e) {
View Full Code Here

   * @throws TableNotFoundException
   *           If the table does not exist
   */
  static Scanner createScanner(Connector connector, String table, Authorizations auths) throws TableNotFoundException {
    if (!connector.tableOperations().exists(table)) {
      throw new TableNotFoundException(null, table, "Consult the README and create the table before starting test processes.");
    }
    return connector.createScanner(table, auths);
  }
View Full Code Here

    String localhost = InetAddress.getLocalHost().getHostName();
    String path = ZooUtil.getRoot(instance) + Constants.ZTRACERS;
    Tracer.getInstance().addReceiver(new ZooSpanClient(zooKeepers, path, localhost, "cingest", 1000));
   
    if (!conn.tableOperations().exists(table)) {
      throw new TableNotFoundException(null, table, "Consult the README and create the table before starting ingest.");
    }

    BatchWriter bw = conn.createBatchWriter(table, maxMemory, maxLatency, maxWriteThreads);
    bw = Trace.wrapAll(bw, new CountSampler(1024));
   
View Full Code Here

          log.warn("No tables found that match your criteria");

        // flush the tables
        for (String tableName : tablesToFlush) {
          if (!shellState.getConnector().tableOperations().exists(tableName))
            throw new TableNotFoundException(null, tableName, null);
          doTableOp(shellState, tableName);
        }
      }

      finally {
View Full Code Here

        file.close();
      }
    } else if (cl.hasOption(createTableOptCopySplits.getOpt())) {
      String oldTable = cl.getOptionValue(createTableOptCopySplits.getOpt());
      if (!shellState.getConnector().tableOperations().exists(oldTable))
        throw new TableNotFoundException(null, oldTable, null);
      partitions.addAll(shellState.getConnector().tableOperations().getSplits(oldTable));
    }
   
    if (cl.hasOption(createTableOptCopyConfig.getOpt())) {
      String oldTable = cl.getOptionValue(createTableOptCopyConfig.getOpt());
      if (!shellState.getConnector().tableOperations().exists(oldTable))
        throw new TableNotFoundException(null, oldTable, null);
    }
   
    TimeType timeType = TimeType.MILLIS;
    if (cl.hasOption(createTableOptTimeLogical.getOpt()))
      timeType = TimeType.LOGICAL;
View Full Code Here

    Shell.log.warn("selectrow is deprecated, use 'scan -r <row>'");
   
    if (cl.hasOption(tableOpt.getOpt())) {
      tableName = cl.getOptionValue(tableOpt.getOpt());
      if (!shellState.getConnector().tableOperations().exists(tableName))
        throw new TableNotFoundException(null, tableName, null);
    }
   
    else {
      shellState.checkTableState();
      tableName = shellState.getTableName();
View Full Code Here

TOP

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

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.