Package org.apache.blur.thrift.generated.Blur

Examples of org.apache.blur.thrift.generated.Blur.Iface


    }
  }

  @Test
  public void testGetCurrentQueryCount() throws BlurException, IOException, TException {
    Iface client = BlurClient.getClient(Config.getConnectionString());
    BlurQuery query = new BlurQuery(
        new Query("fam0.col0:*", true, ScoreType.SUPER, null, null),
        null,
        null, //new Selector(false, null, null, null, null, null, 0, 10, null),
        false, 0, 10, 1, 2000, UUID.randomUUID().toString(), "testUser", false, System.currentTimeMillis(), null, null);
    client.query("queryUnitTable", query);

    assertEquals(1, QueryUtil.getCurrentQueryCount());
  }
View Full Code Here


  }

  @SuppressWarnings("unchecked")
  @Test
  public void testGetQueries() throws IOException, BlurException, TException {
    Iface client = BlurClient.getClient(Config.getConnectionString());
    BlurQuery query = new BlurQuery(
        new Query("fam0.col0:*", true, ScoreType.SUPER, null, null),
        null,
        null, //new Selector(false, null, null, null, null, null, 0, 10, null),
        false, 0, 10, 1, 2000, UUID.randomUUID().toString(), "testUser", false, System.currentTimeMillis(), null, null);
    client.query("queryUnitTable", query);

    Map<String, Object> queries = QueryUtil.getQueries();

    assertEquals(0, queries.get("slowQueries"));
    assertEquals(2, ((List<Map<String, Object>>) queries.get("queries")).size());
View Full Code Here

  public static void main(String[] args) throws BlurException, TException, IOException {
    String connectionStr = args[0];
    String tableName = args[1];
    String queryStr = args[2];

    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());
    BlurResults results = client.query(tableName, blurQuery);
    System.out.println("Total Results: " + results.totalResults);

    for (BlurResult result : results.getResults()) {
      System.out.println(result);
    }
View Full Code Here

import java.util.Map;

public class QueryUtil {

  public static int getCurrentQueryCount() throws IOException, TException {
    Iface client = BlurClient.getClient(Config.getConnectionString());

    int count = 0;
    List<String> tableList = client.tableList();
    for (String table : tableList) {
      List<String> queries = client.queryStatusIdList(table);
      count += queries.size();
    }

    return count;
  }
View Full Code Here

    int slow = 0;

    List<Map<String, Object>> queries = new ArrayList<Map<String, Object>>();

    Iface client = BlurClient.getClient(Config.getConnectionString());
    List<String> tableList = client.tableList();

    for (String table : tableList) {
      List<String> queriesForTable = client.queryStatusIdList(table);
      for (String id : queriesForTable) {
        BlurQueryStatus status = client.queryStatusById(table, id);

        if (Status.FOUND.equals(status.getStatus())) {
          Map<String, Object> info = new HashMap<String, Object>();
          info.put("uuid", id);
          info.put("user", status.getQuery().getUserContext());
View Full Code Here

    return queriesInfo;
  }

  public static void cancelQuery(String table, String uuid) throws IOException, TException {
    Iface client = BlurClient.getClient(Config.getConnectionString());

    client.cancelQuery(table, uuid);
  }
View Full Code Here

    }

    final String controllerConnectionStr = cmd.getOptionValue("c");
    final String tableName = cmd.getOptionValue("t");

    final Iface client = controllerPool.getClient(controllerConnectionStr);
    TableDescriptor tableDescriptor = client.describe(tableName);

    Job job = new Job(configuration, "Blur indexer [" + tableName + "]");
    job.setJarByClass(CsvBlurDriver.class);
    job.setMapperClass(CsvBlurMapper.class);
View Full Code Here

      cluster = null;
    }
  }

  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)));
    }
View Full Code Here

    }
  }

  private void preconnectClients(String shardServer) {
    try {
      Iface client = org.apache.blur.thrift.BlurClient.getClient(shardServer);
      client.ping();
      LOG.debug("Pinging shard server [{0}]", shardServer);
    } catch (Exception e) {
      LOG.error("Error while trying to ping shard server [{0}]", shardServer);
    }
  }
View Full Code Here

    tableDescriptor.readOnly = false;

    tableDescriptor.shardCount = shardCount;
    tableDescriptor.tableUri = uri;

    Iface client = BlurClient.getClient(connectionStr);
    client.createTable(tableDescriptor);
    ColumnDefinition columnDefinition = new ColumnDefinition();
    columnDefinition.setColumnName("col1");
    columnDefinition.setFamily("fam1");
    columnDefinition.setFieldLessIndexed(false);
    columnDefinition.setSortable(true);
    columnDefinition.setFieldType("string");
    client.addColumnDefinition(tableName, columnDefinition);
  }
View Full Code Here

TOP

Related Classes of org.apache.blur.thrift.generated.Blur.Iface

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.