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

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


  }

  public ResultSet getResultSet() throws SQLException {
    try {
      System.out.println(sql);
      Iface client = BlurClient.getClient(connection.getConnectionString());
      Parser parser = new Parser();
      parser.parse(sql);
      if (isSuperQuery(parser, client)) {
        System.out.println("super");
        return new BlurResultSetRows(client, parser);
View Full Code Here


    shardServer.setQueryChecker(queryChecker);
    shardServer.setConfiguration(configuration);
    shardServer.setMaxRecordsPerRowFetchRequest(configuration.getInt(BLUR_MAX_RECORDS_PER_ROW_FETCH_REQUEST, 1000));
    shardServer.init();

    Iface iface = BlurUtil.recordMethodCallsAndAverageTimes(shardServer, Iface.class, false);
    if (httpServer != null) {
      WebAppContext context = httpServer.getContext();
      context.addServlet(new ServletHolder(new TServlet(new Blur.Processor<Blur.Iface>(iface),
          new TJSONProtocol.Factory())), "/blur");
      context.addServlet(new ServletHolder(new JSONReporterServlet()), "/livemetrics");
View Full Code Here

      loadWords(args[8]);
    } else {
      loadWords(null);
    }

    final Iface client = BlurClient.getClient(args[0]);
    final String table = args[1];
    final boolean wal = Boolean.parseBoolean(args[2]);
    final int numberOfColumns = Integer.parseInt(args[3]);
    final int numberRecordsPerRow = Integer.parseInt(args[4]);
    final int numberOfFamilies = Integer.parseInt(args[5]);
    final int numberOfWords = Integer.parseInt(args[6]);
    final long timeBetweenReporting = TimeUnit.SECONDS.toMillis(Integer.parseInt(args[7]));
    final long start = System.currentTimeMillis();

    long s = start;
    long recordCountTotal = 0;
    long rowCount = 0;

    int batchSize = 100;

    List<RowMutation> batch = new ArrayList<RowMutation>();

    long recordCount = 0;
    long totalTime = 0;
    long calls = 0;
    while (true) {
      long now = System.currentTimeMillis();
      if (s + timeBetweenReporting < now) {
        double avgSeconds = (now - start) / 1000.0;
        double seconds = (now - s) / 1000.0;
        double avgRate = recordCountTotal / avgSeconds;
        double rate = recordCount / seconds;
        double latency = (totalTime / 1000000.0) / calls;
        System.out.println(System.currentTimeMillis() + "," + recordCountTotal + "," + rowCount + "," + latency + "," + rate + "," + avgRate);
        s = now;
        recordCount = 0;
        totalTime = 0;
        calls = 0;
      }

      RowMutation mutation = new RowMutation();
      mutation.setTable(table);
      String rowId = getRowId();
      mutation.setRowId(rowId);
      mutation.setWal(wal);
      mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
      for (int j = 0; j < numberRecordsPerRow; j++) {
        mutation.addToRecordMutations(getRecordMutation(numberOfColumns, numberOfFamilies, numberOfWords));
      }
      batch.add(mutation);
      if (batch.size() >= batchSize) {
        long sm = System.nanoTime();
        client.mutateBatch(batch);
        long em = System.nanoTime();
        calls++;
        totalTime += (em - sm);
        batch.clear();
      }
View Full Code Here

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

    Iface client = BlurClient.getClient(connectionStr);
    TableStats tableStats = client.tableStats(tableName);
    System.out.println(tableStats);
  }
View Full Code Here

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

    Iface client = BlurClient.getClient(connectionStr);
    client.enableTable(tableName);
  }
View Full Code Here

public class ListTables {

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

    Iface client = BlurClient.getClient(connectionStr);
    System.out.println(client.tableList());
  }
View Full Code Here

public class QueryMetrics {

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

    Iface client = BlurClient.getClient(connectionStr);
    Map<String, Metric> metrics = new TreeMap<String, Metric>(client.metrics(null));
    for (Metric m : metrics.values()) {
      System.out.println(m.getName());
      System.out.println("\t" + m.getDoubleMap());
      System.out.println("\t" + m.getLongMap());
      System.out.println("\t" + m.getStrMap());
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);

    final BlurQuery blurQuery = new BlurQuery();
    Query query = new Query();
    blurQuery.setQuery(query);
    query.setQuery(queryStr);
    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

      final BlurQuery blurQuery = new BlurQuery();
      blurQuery.query = new Query();
      blurQuery.query.query = query;
      long start = System.nanoTime();

      Iface client = BlurClient.getClient(connectionStr);
      BlurResults results = client.query(tableName, blurQuery);
      long end = System.nanoTime();
      System.out.println((end - start) / 1000000.0 + " ms " + results.totalResults);
    }
  }
View Full Code Here

    return sampleOfTerms;
  }

  private static Set<String> getRandomSampleOfTerms(String connectionStr, final String tableName, final String field, final int numberOfTerms) throws BlurException, TException,
      IOException {
    Iface client = BlurClient.getClient(connectionStr);
    String[] split = field.split("\\.");
    String columnFamily = split[0];
    String columnName = split[1];
    List<String> terms = client.terms(tableName, columnFamily, columnName, "", (short) numberOfTerms);
    return new HashSet<String>(terms);
  }
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.