Package org.apache.blur.user

Examples of org.apache.blur.user.User


      Map<String, String> attributes = new HashMap<String, String>();
      for (int i = 2; i < args.length; i++) {
        String[] parts = args[i].split("\\=");
        attributes.put(parts[0], parts[1]);
      }
      UserContext.setUser(new User(username, attributes));
      out.println("User set [" + UserContext.getUser() + "]");
    }
View Full Code Here


  public BlurResultIterable query(final String table, final BlurQuery blurQuery, AtomicLongArray facetedCounts)
      throws Exception {
    boolean runSlow = DEBUG_RUN_SLOW.get();
    final AtomicBoolean running = new AtomicBoolean(true);
    User user = UserContext.getUser();
    final QueryStatus status = _statusManager.newQueryStatus(table, blurQuery, _threadCount, running,
        UserConverter.toThriftUser(user));
    _queriesExternalMeter.mark();
    try {
      Map<String, BlurIndex> blurIndexes;
View Full Code Here

    Iface client = BlurClient.getClient(connectionStr);

    String uuid = UUID.randomUUID().toString();
    Trace.setupTrace(uuid);
    UserContext.setUser(new User("me", null));
    final BlurQuery blurQuery = new BlurQuery();
    Query query = new Query();
    blurQuery.setQuery(query);
    query.setQuery(queryStr);
    blurQuery.setSelector(new Selector());
View Full Code Here

        String name = method.getName();
        boolean error = false;
        LoggerArgsState loggerArgsState = null;
        Tracer trace = Trace.trace("thrift recv", Trace.param("method", method.getName()),
            Trace.param("connection", tracingConnectionString));
        User user = UserContext.getUser();
        boolean notSetUserMethod = isNotSetUserMethod(name);
        try {
          if (REQUEST_LOG.isInfoEnabled() && notSetUserMethod) {
            if (argsStr == null) {
              loggerArgsState = _loggerArgsState.get();
View Full Code Here

  public static Iface getClient(String username, String securityUser) throws IOException {
    Iface client = BlurClient.getClient(getConnectionString());

    if (globalUserProperties != null && globalUserProperties.get(securityUser) != null) {
      UserContext.setUser(new User(username, globalUserProperties.get(securityUser)));
    }

    return client;
  }
View Full Code Here

    blurQueryRow.setQuery(queryRow);
    blurQueryRow.setUseCacheIfPresent(false);
    blurQueryRow.setCacheResult(false);
    String uuid = "5678";
    blurQueryRow.setUuid(uuid);
    final User user = new User("testuser", new HashMap<String, String>());
   
    try {
      IndexManager.DEBUG_RUN_SLOW.set(true);
      new Thread(new Runnable() {
        @Override
        public void run() {
          try {
            UserContext.setUser(user);
            // This call will take several seconds to execute.
            client.query(tableName, blurQueryRow);
          } catch (BlurException e) {
//            e.printStackTrace();
          } catch (TException e) {
            e.printStackTrace();
          }
        }
      }).start();
      Thread.sleep(500);
      BlurQueryStatus queryStatusById = client.queryStatusById(tableName, uuid);
      assertEquals(user.getUsername(), queryStatusById.getUser().getUsername());
      assertEquals(queryStatusById.getState(), QueryState.RUNNING);
      client.cancelQuery(tableName, uuid);
    } finally {
      IndexManager.DEBUG_RUN_SLOW.set(false);
    }
View Full Code Here

TOP

Related Classes of org.apache.blur.user.User

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.