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

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


      IndexManager.DEBUG_RUN_SLOW.set(false);
    }
  }

  private void runBackPressureViaQuery(final String tableName) throws InterruptedException {
    final Iface client = getClient();
    final BlurQuery blurQueryRow = new BlurQuery();
    Query queryRow = new Query();
    queryRow.setQuery("test.test:value");
    blurQueryRow.setQuery(queryRow);
    blurQueryRow.setUseCacheIfPresent(false);
    blurQueryRow.setCacheResult(false);
    blurQueryRow.setUuid("1234");

    final AtomicReference<BlurException> error = new AtomicReference<BlurException>();
    final AtomicBoolean fail = new AtomicBoolean();

    System.gc();
    System.gc();
    MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
    MemoryUsage usage = memoryMXBean.getHeapMemoryUsage();
    long max = usage.getMax();
    System.out.println("Max Heap [" + max + "]");
    long used = usage.getUsed();
    System.out.println("Used Heap [" + used + "]");
    long limit = (long) (max * 0.80);
    System.out.println("Limit Heap [" + limit + "]");
    long difference = limit - used;
    int sizeToAllocate = (int) ((int) difference * 0.50);
    System.out.println("Allocating [" + sizeToAllocate + "] Heap [" + getHeapSize() + "] Max [" + getMaxHeapSize()
        + "]");

    byte[] bufferToFillHeap = new byte[sizeToAllocate];
    new Thread(new Runnable() {
      @Override
      public void run() {
        try {
          // This call will take several seconds to execute.
          client.query(tableName, blurQueryRow);
          fail.set(true);
        } catch (BlurException e) {
          System.out.println("-------------------");
          System.out.println("-------------------");
          System.out.println("-------------------");
View Full Code Here


  public void testTestShardFailover() throws BlurException, TException, InterruptedException, IOException,
      KeeperException {
    final String tableName = "testTestShardFailover";
    createTable(tableName);
    loadTable(tableName);
    Iface client = getClient();
    BlurQuery blurQuery = new BlurQuery();
    blurQuery.setUseCacheIfPresent(false);
    Query query = new Query();
    query.setQuery("test.test:value");
    blurQuery.setQuery(query);
    BlurResults results1 = client.query(tableName, blurQuery);
    assertEquals(numberOfDocs, results1.getTotalResults());
    assertRowResults(results1);

    miniCluster.killShardServer(1);

    // make sure the WAL syncs
    Thread.sleep(TimeUnit.SECONDS.toMillis(1));

    // This should block until shards have failed over
    client.shardServerLayout(tableName);

    assertEquals(numberOfDocs, client.query(tableName, blurQuery).getTotalResults());

  }
View Full Code Here

  @Test
  public void testTermsList() throws BlurException, TException, IOException, InterruptedException {
    final String tableName = "testTermsList";
    createTable(tableName);
    loadTable(tableName);
    Iface client = getClient();
    List<String> terms = client.terms(tableName, "test", "test", null, (short) 10);
    List<String> list = new ArrayList<String>();
    list.add("value");
    assertEquals(list, terms);
  }
View Full Code Here

  public void testTrucateRaceCondition() throws BlurException, TException, IOException, InterruptedException {
    String tableName = "testTrucateRaceCondition";
    createTable(tableName);
    loadTable(tableName);
    List<Connection> connections = BlurClientManager.getConnections(miniCluster.getControllerConnectionStr());
    Iface client1 = BlurClient.getClient(connections.get(0));
    Iface client2 = BlurClient.getClient(connections.get(1));
    TableDescriptor describe = client1.describe(tableName);
    client1.disableTable(tableName);
    client1.removeTable(tableName, true);
    client1.createTable(describe);

    String rowId = UUID.randomUUID().toString();
    RecordMutation mutation = BlurThriftHelper.newRecordMutation("test", rowId,
        BlurThriftHelper.newColumn("test", "value"), BlurThriftHelper.newColumn("facetFixed", "test"));
    RowMutation rowMutation = BlurThriftHelper.newRowMutation(tableName, rowId, mutation);
    client2.mutate(rowMutation);
  }
View Full Code Here

    }
  }

  @Test
  public void testCreateDisableAndRemoveTable() throws IOException, BlurException, TException {
    Iface client = getClient();
    String tableName = UUID.randomUUID().toString();
    TableDescriptor tableDescriptor = new TableDescriptor();
    tableDescriptor.setName(tableName);
    tableDescriptor.setShardCount(5);
    tableDescriptor.setTableUri(miniCluster.getFileSystemUri().toString() + "/blur/" + tableName);

    for (int i = 0; i < 3; i++) {
      client.createTable(tableDescriptor);
      client.disableTable(tableName);
      client.removeTable(tableName, true);
    }

    assertFalse(client.tableList().contains(tableName));

  }
View Full Code Here

    final int numberOfFamilies = 3;
    final int numberOfWords = 30;
    int batch = 1;
    String connectionString = args[0];
    String table = args[1];
    Iface client = BlurClient.getClient(connectionString);
    runLoad(client, false, table, numberRows, numberRecordsPerRow, numberOfFamilies, numberOfColumns, numberOfWords,
        batch, new PrintWriter(System.out));
  }
View Full Code Here

  public static void main(String[] args) throws BlurException, TException {
    String connectionStr = args[0];
    final String cluster = args[1];
    String uri = args[2];
    int shardCount = 1;
    Iface client = BlurClient.getClient(connectionStr);
    while (true) {
      String tableName = UUID.randomUUID().toString();
      System.out.println("Creating [" + tableName + "]");
      boolean readOnly = createTable(client, cluster, uri, shardCount, tableName);
      if (!readOnly) {
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 = Job.getInstance(configuration, "Blur indexer [" + tableName + "]");
    job.setJarByClass(CsvBlurDriver.class);
    job.setMapperClass(CsvBlurMapper.class);
View Full Code Here

          break;
        }
        continue;
      }

      Iface blurConnection = BlurClient.getClient(resolvedConnection);

      /* Retrieve the clusters and their info */
      for (Map<String, Object> cluster : this.database.getClusters(zookeeperId)) {
        String clusterName = (String) cluster.get("NAME");
        Integer clusterId = (Integer) cluster.get("ID");

        List<String> tables;
        try {
          tables = blurConnection.tableListByCluster(clusterName);
        } catch (Exception e) {
          log.error("An error occured while trying to retrieve the table list for cluster[" + clusterName + "], skipping cluster", e);
          continue;
        }

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.