Package org.apache.accumulo.core.util

Examples of org.apache.accumulo.core.util.ByteArraySet


    if (expectedCount != 0)
      throw new Exception(" expected count !=0 " + expectedCount);
  }
 
  private void verify(Set<String> auths, Set<String> expectedValues) throws Exception {
    ByteArraySet bas = nbas(auths);
   
    try {
      verify(bas, expectedValues.toArray(new String[0]));
    } catch (Exception e) {
      throw new Exception("Verification failed auths=" + auths + " exp=" + expectedValues, e);
View Full Code Here


      throw new Exception("Verification failed auths=" + auths + " exp=" + expectedValues, e);
    }
  }
 
  private ByteArraySet nbas(Set<String> auths) {
    ByteArraySet bas = new ByteArraySet();
    for (String auth : auths) {
      bas.add(auth.getBytes(Constants.UTF8));
    }
    return bas;
  }
View Full Code Here

    for (TablePermission s : TablePermission.values())
      assertTrue(s.equals(TablePermission.getPermissionById(s.getId())));
  }
 
  public void testAuthorizationConversion() {
    ByteArraySet auths = new ByteArraySet();
    for (int i = 0; i < 300; i += 3)
      auths.add(Integer.toString(i).getBytes());
   
    Authorizations converted = new Authorizations(auths);
    byte[] test = ZKSecurityTool.convertAuthorizations(converted);
    Authorizations test2 = ZKSecurityTool.convertAuthorizations(test);
    assertTrue(auths.size() == test2.size());
    for (byte[] s : auths) {
      assertTrue(test2.contains(s));
    }
  }
View Full Code Here

        throws ThriftSecurityException, ThriftTableOperationException, TException {
      verify(c, check(c, SystemPermission.CREATE_TABLE));
      checkNotMetadataTable(tableName, TableOperation.CREATE);
      checkTableName(tableName, TableOperation.CREATE);
     
      final ByteArraySet uniq = new ByteArraySet(splitPoints);
      splitPoints = uniq.toList();
     
      int newly_created_tablets = 0;
     
      // Don't create new tables until we have read the entire metadata table
      while (stillMaster() && !cycledOnce()) {
View Full Code Here

    if (expectedCount != 0)
      throw new Exception(" expected count !=0 " + expectedCount);
  }
 
  private void verify(Set<String> auths, Set<String> expectedValues) throws Exception {
    ByteArraySet bas = nbas(auths);
   
    try {
      verify(bas, expectedValues.toArray(new String[0]));
    } catch (Exception e) {
      throw new Exception("Verification failed auths=" + auths + " exp=" + expectedValues, e);
View Full Code Here

      throw new Exception("Verification failed auths=" + auths + " exp=" + expectedValues, e);
    }
  }
 
  private ByteArraySet nbas(Set<String> auths) {
    ByteArraySet bas = new ByteArraySet();
    for (String auth : auths) {
      bas.add(auth.getBytes());
    }
    return bas;
  }
View Full Code Here

    for (TablePermission s : TablePermission.values())
      assertTrue(s.equals(TablePermission.getPermissionById(s.getId())));
  }
 
  public void testAuthorizationConversion() {
    ByteArraySet auths = new ByteArraySet();
    for (int i = 0; i < 300; i += 3)
      auths.add(Integer.toString(i).getBytes());
   
    Authorizations converted = new Authorizations(auths);
    byte[] test = ZKAuthenticator.Tool.convertAuthorizations(converted);
    Authorizations test2 = ZKAuthenticator.Tool.convertAuthorizations(test);
    assertTrue(auths.size() == test2.size());
    for (byte[] s : auths) {
      assertTrue(test2.contains(s));
    }
  }
View Full Code Here

    if (expectedCount != 0)
      throw new Exception(" expected count !=0 " + expectedCount);
  }
 
  private void verify(Set<String> auths, Set<String> expectedValues) throws Exception {
    ByteArraySet bas = nbas(auths);
   
    try {
      verify(bas, expectedValues.toArray(new String[0]));
    } catch (Exception e) {
      throw new Exception("Verification failed auths=" + auths + " exp=" + expectedValues, e);
View Full Code Here

      throw new Exception("Verification failed auths=" + auths + " exp=" + expectedValues, e);
    }
  }
 
  private ByteArraySet nbas(Set<String> auths) {
    ByteArraySet bas = new ByteArraySet();
    for (String auth : auths) {
      bas.add(auth.getBytes());
    }
    return bas;
  }
View Full Code Here

  private void execute(Opts opts, ScannerOpts scanOpts) throws Exception {
    conn = opts.getConnector();
   
    // add the authorizations to the user
    Authorizations userAuthorizations = conn.securityOperations().getUserAuthorizations(opts.principal);
    ByteArraySet auths = new ByteArraySet(userAuthorizations.getAuthorizations());
    auths.addAll(opts.auths.getAuthorizations());
    if (!auths.isEmpty())
      conn.securityOperations().changeUserAuthorizations(opts.principal, new Authorizations(auths));
   
    // create table
    if (opts.createtable) {
      SortedSet<Text> partitionKeys = new TreeSet<Text>();
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.util.ByteArraySet

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.