Package org.apache.accumulo.core.security.thrift

Examples of org.apache.accumulo.core.security.thrift.AuthInfo


     * I thought I could move files that have no file references in the table. However its possible a clone references a file. Therefore only move files that
     * have no loaded markers.
     */

    // determine which failed files were loaded
    AuthInfo creds = SecurityConstants.getSystemCredentials();
    Connector conn = HdfsZooInstance.getInstance().getConnector(creds.user, creds.password);
    Scanner mscanner = new IsolatedScanner(conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS));
    mscanner.setRange(new KeyExtent(new Text(tableId), null, null).toMetadataRange());
    mscanner.fetchColumnFamily(Constants.METADATA_BULKFILE_COLUMN_FAMILY);
   
View Full Code Here


 
  private static List<KeyExtent> findTablets(boolean selectLocalTablets, String user, String pass, String table, ZooKeeperInstance zki,
      Map<KeyExtent,String> locations) throws Exception {
    SortedSet<KeyExtent> tablets = new TreeSet<KeyExtent>();
   
    MetadataTable.getEntries(zki, new AuthInfo(user, ByteBuffer.wrap(pass.getBytes()), zki.getInstanceID()), table, false, locations, tablets);
   
    InetAddress localaddress = InetAddress.getLocalHost();
   
    List<KeyExtent> candidates = new ArrayList<KeyExtent>();
   
View Full Code Here

 
  private static List<String> getTabletFiles(String user, String pass, ZooKeeperInstance zki, String tableId, KeyExtent ke) {
    List<String> files = new ArrayList<String>();
   
    SortedMap<Key,Value> tkv = new TreeMap<Key,Value>();
    MetadataTable.getTabletAndPrevTabletKeyValues(zki, tkv, ke, null, new AuthInfo(user, ByteBuffer.wrap(pass.getBytes()), zki.getInstanceID()));
   
    Set<Entry<Key,Value>> es = tkv.entrySet();
    for (Entry<Key,Value> entry : es) {
      if (entry.getKey().compareRow(ke.getMetadataEntry()) == 0) {
        if (entry.getKey().compareColumnFamily(Constants.METADATA_DATAFILE_COLUMN_FAMILY) == 0) {
View Full Code Here

    if (!authenticate(credentials))
      throw new AccumuloSecurityException(credentials.user, SecurityErrorCode.BAD_CREDENTIALS);
    if (!credentials.user.equals(user) && !hasSystemPermission(credentials, credentials.user, SystemPermission.SYSTEM))
      throw new AccumuloSecurityException(credentials.user, SecurityErrorCode.PERMISSION_DENIED);
   
    return authenticate(new AuthInfo(user, pass, credentials.instanceId));
  }
View Full Code Here

      long bytesWritten = 0;
     
      BatchWriter bw = null;
      FileSKVWriter writer = null;
     
      rootCredentials = new AuthInfo(username, ByteBuffer.wrap(passwd.getBytes()), instance.getInstanceID());
      if (ingestArgs.outputToMapFile) {
        Configuration conf = CachedConfiguration.getInstance();
        FileSystem fs = FileSystem.get(conf);
        writer = FileOperations.getInstance().openWriter(ingestArgs.outputFile + "." + Constants.MAPFILE_EXTENSION, fs, conf,
            AccumuloConfiguration.getDefaultConfiguration());
View Full Code Here

    MigrationCleanupThread migrationCleanupThread = new MigrationCleanupThread();
    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)};
    watchers.add(new TabletGroupWatcher(stores[2], null));
    watchers.add(new TabletGroupWatcher(stores[1], watchers.get(0)));
    watchers.add(new TabletGroupWatcher(stores[0], watchers.get(1)));
View Full Code Here

          h.getDescPadding(), null, true);
      System.exit(3);
    }
   
    try {
      AuthInfo creds;
      if (args[0].equalsIgnoreCase("stop")) {
        stopTabletServer(args[1], force);
      } else {
        if (!cl.hasOption("u") && !cl.hasOption("p")) {
          creds = SecurityConstants.getSystemCredentials();
        } else {
          if (pass == null) {
            try {
              pass = new ConsoleReader().readLine("Enter current password for '" + user + "': ", '*').getBytes();
            } catch (IOException ioe) {
              log.error("Password not specified and unable to prompt: " + ioe);
              System.exit(4);
            }
          }
          creds = new AuthInfo(user, ByteBuffer.wrap(pass), HdfsZooInstance.getInstance().getInstanceID());
        }
       
        everything = args[0].equalsIgnoreCase("stopAll");
        stopServer(creds, everything);
      }
View Full Code Here

        everythingLooksGood = false;
      }
      if (broke && patch) {
        KeyExtent ke = new KeyExtent(tabke);
        ke.setPrevEndRow(lastEndRow);
        MetadataTable.updateTabletPrevEndRow(ke, new AuthInfo(user, ByteBuffer.wrap(pass), HdfsZooInstance.getInstance().getInstanceID()));
        System.out.println("KE " + tabke + " has been repaired to " + ke);
      }
     
      lastEndRow = tabke.getEndRow();
    }
View Full Code Here

    Scanner scanner;
   
    if (offline) {
      scanner = new OfflineMetadataScanner();
    } else {
      scanner = new ScannerImpl(HdfsZooInstance.getInstance(), new AuthInfo(user, ByteBuffer.wrap(pass), HdfsZooInstance.getInstance().getInstanceID()),
          Constants.METADATA_TABLE_ID, Constants.NO_AUTHS);
    }
   
    scanner.setRange(Constants.METADATA_KEYSPACE);
    ColumnFQ.fetch(scanner, Constants.METADATA_PREV_ROW_COLUMN);
    scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);
   
    Text colf = new Text();
    Text colq = new Text();
    boolean justLoc = false;
   
    int count = 0;
   
    for (Entry<Key,Value> entry : scanner) {
      colf = entry.getKey().getColumnFamily(colf);
      colq = entry.getKey().getColumnQualifier(colq);
     
      count++;
     
      String tableName = (new KeyExtent(entry.getKey().getRow(), (Text) null)).getTableId().toString();
     
      TreeSet<KeyExtent> tablets = tables.get(tableName);
      if (tablets == null) {
        Set<Entry<String,TreeSet<KeyExtent>>> es = tables.entrySet();
       
        for (Entry<String,TreeSet<KeyExtent>> entry2 : es) {
          checkTable(entry2.getKey(), entry2.getValue(), patch);
        }
       
        tables.clear();
       
        tablets = new TreeSet<KeyExtent>();
        tables.put(tableName, tablets);
      }
     
      if (Constants.METADATA_PREV_ROW_COLUMN.equals(colf, colq)) {
        KeyExtent tabletKe = new KeyExtent(entry.getKey().getRow(), entry.getValue());
        tablets.add(tabletKe);
        justLoc = false;
      } else if (colf.equals(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY)) {
        if (justLoc) {
          System.out.println("Problem at key " + entry.getKey());
          sawProblems = true;
          if (patch) {
            Writer t = MetadataTable.getMetadataTable(new AuthInfo(user, ByteBuffer.wrap(pass), HdfsZooInstance.getInstance().getInstanceID()));
            Key k = entry.getKey();
            Mutation m = new Mutation(k.getRow());
            m.putDelete(k.getColumnFamily(), k.getColumnQualifier());
            try {
              t.update(m);
View Full Code Here

      } // user canceled
     
      pass = passw.getBytes();
      this.setTableName("");
      connector = instance.getConnector(user, pass);
      this.credentials = new AuthInfo(user, ByteBuffer.wrap(pass), connector.getInstance().getInstanceID());
     
    } catch (Exception e) {
      printException(e);
      configError = true;
    }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.security.thrift.AuthInfo

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.