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(Connector c, String tableName, Set<String> auths, Set<String> expectedValues) throws Exception {
    ByteArraySet bas = nbas(auths);

    try {
      verify(c, tableName, 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 = 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

    }
  }
 
  public Authorizations(Collection<byte[]> authorizations) {
    ArgumentChecker.notNull(authorizations);
    auths = new ByteArraySet(authorizations);
    checkAuths();
  }
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

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.