Package org.apache.accumulo.core.client.security.tokens

Examples of org.apache.accumulo.core.client.security.tokens.PasswordToken


  @Test
  public void testCorrectRangeInputSplits() throws Exception {
    Job job = new Job(new Configuration(), this.getClass().getSimpleName() + "_" + System.currentTimeMillis());

    String username = "user", table = "table", instance = "mapreduce_testCorrectRangeInputSplits";
    PasswordToken password = new PasswordToken("password");
    Authorizations auths = new Authorizations("foo");
    Collection<Pair<Text,Text>> fetchColumns = Collections.singleton(new Pair<Text,Text>(new Text("foo"), new Text("bar")));
    boolean isolated = true, localIters = true;
    Level level = Level.WARN;
View Full Code Here


  }

  @Test
  public void testPartialInputSplitDelegationToConfiguration() throws Exception {
    String user = "testPartialInputSplitUser";
    PasswordToken password = new PasswordToken("");

    MockInstance mockInstance = new MockInstance("testPartialInputSplitDelegationToConfiguration");
    Connector c = mockInstance.getConnector(user, password);
    c.tableOperations().create("testtable");
    BatchWriter bw = c.createBatchWriter("testtable", new BatchWriterConfig());
View Full Code Here

  }

  @Test
  public void testPartialFailedInputSplitDelegationToConfiguration() throws Exception {
    String user = "testPartialFailedInputSplit";
    PasswordToken password = new PasswordToken("");

    MockInstance mockInstance = new MockInstance("testPartialFailedInputSplitDelegationToConfiguration");
    Connector c = mockInstance.getConnector(user, password);
    c.tableOperations().create("testtable");
    BatchWriter bw = c.createBatchWriter("testtable", new BatchWriterConfig());
View Full Code Here

        String principal = conf.get(Property.TRACE_USER);
        AuthenticationToken at;
        Map<String,String> loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX);
        if (loginMap.isEmpty()) {
          Property p = Property.TRACE_PASSWORD;
          at = new PasswordToken(conf.get(p).getBytes(Constants.UTF8));
        } else {
          Properties props = new Properties();
          AuthenticationToken token = AccumuloClassLoader.getClassLoader().loadClass(conf.get(Property.TRACE_TOKEN_TYPE)).asSubclass(AuthenticationToken.class)
              .newInstance();
View Full Code Here

    @Parameter(names = "--opt", required = true, description = "the options for test")
    String opt = null;
  }
 
  public static void main(String[] args) throws Exception {
    CredentialHelper.create("", new PasswordToken(new byte[0]), "");
    Opts opts = new Opts();
    opts.parseArgs(FunctionalTest.class.getName(), args);
   
    Class<? extends FunctionalTest> testClass = AccumuloVFSClassLoader.loadClass(opts.classname, FunctionalTest.class);
    FunctionalTest fTest = testClass.newInstance();
View Full Code Here

  }
 
  @Test(timeout = 120000)
  public void testMetaSplit() throws Exception {
    Instance instance = new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers());
    Connector connector = instance.getConnector("root", new PasswordToken(secret));
    TableOperations opts = connector.tableOperations();
    for (int i = 1; i <= 10; i++) {
      opts.create("" + i);
    }
    opts.merge(Constants.METADATA_TABLE_NAME, new Text("01"), new Text("02"));
View Full Code Here

  }

  @Test
  public void test() throws Exception {
    ZooKeeperInstance inst = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers(), 60 * 1000);
    Connector conn = inst.getConnector("root", new PasswordToken(secret));

    String table = "foo";
    conn.tableOperations().create(table);

    final DefaultConfiguration defaultConf = AccumuloConfiguration.getDefaultConfiguration();
View Full Code Here

  private MiniAccumuloCluster accumulo;
  private String secret = "secret";
 
  Connector getConnector() throws AccumuloException, AccumuloSecurityException {
    ZooKeeperInstance zki = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers());
    return zki.getConnector("root", new PasswordToken(secret));
  }
View Full Code Here

    }
  }
 
  @Test
  public void test() throws Exception {
    Connector c = instance.getConnector("user", new PasswordToken("pass"));
    TableOperations tops = c.tableOperations();
    tops.create("t1");
    tops.create("t2");
    tops.create("t3");
    String t1Id = tops.tableIdMap().get("t1"), t2Id = tops.tableIdMap().get("t2"), t3Id = tops.tableIdMap().get("t3");
View Full Code Here

   
    // need to use our mock instance
    @Override
    protected TableOperations getTableOperations() {
      try {
        return instance.getConnector("user", new PasswordToken("pass")).tableOperations();
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.security.tokens.PasswordToken

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.