Package org.apache.blur.thrift.generated

Examples of org.apache.blur.thrift.generated.TableDescriptor


    InvocationHandler handler = new InvocationHandler() {

      @Override
      public Object invoke(Object o, Method method, Object[] args) throws Throwable {
        if (method.getName().equals("describe")) {
          TableDescriptor tableDescriptor = new TableDescriptor();
          tableDescriptor.setName((String) args[0]);
          tableDescriptor.setTableUri(tableUri);
          tableDescriptor.setShardCount(shardCount);
          return tableDescriptor;
        }
        throw new RuntimeException("not implemented.");
      }
    };
View Full Code Here


    try {
      List<String> tableList = client.tableList();
      for (String table : tableList) {
        if (table.startsWith(_tableNamePrefix)) {
          LOG.info("Clearing store table [" + table + "]");
          TableDescriptor describe = client.describe(table);
          LOG.info("Disabling table [" + table + "]");
          client.disableTable(table);
          LOG.info("Removing table [" + table + "]");
          client.removeTable(table, true);
          LOG.info("Creating table [" + table + "]");
View Full Code Here

    List<String> tableList = client.tableList();
    if (tableList.contains(tableName)) {
      return;
    }
    LOG.info("Table [" + tableName + "] missing, creating with default shard count [" + _defaultShardCount + "]");
    TableDescriptor td = new TableDescriptor();
    td.setName(tableName);
    td.setShardCount(_defaultShardCount);
    client.createTable(td);
  }
View Full Code Here

    FileInputFormat.addInputPath(job, new Path(TEST_ROOT_DIR + "/in"));
    String tableUri = new Path(TEST_ROOT_DIR + "/blur/" + tableName).makeQualified(fileSystem.getUri(), fileSystem.getWorkingDirectory())
        .toString();
    CsvBlurMapper.addColumns(job, "cf1", "col");

    TableDescriptor tableDescriptor = new TableDescriptor();
    tableDescriptor.setShardCount(1);
    tableDescriptor.setTableUri(tableUri);
    tableDescriptor.setName(tableName);

    Iface client = getClient();
    client.createTable(tableDescriptor);

    BlurOutputFormat.setupJob(job, tableDescriptor);
View Full Code Here

    shutdownZooKeeper();
    shutdownDfs();
  }

  private void createTable(String test, Iface client) throws BlurException, TException, IOException {
    final TableDescriptor descriptor = new TableDescriptor();
    descriptor.setName(test);
    descriptor.setShardCount(7);
    descriptor.setTableUri(getFileSystemUri() + "/blur/" + test);
    client.createTable(descriptor);
  }
View Full Code Here

  @SuppressWarnings({"unchecked", "rawtypes"})
  @Test
  public void testGetTableSummaries() throws Exception {
    Iface client = BlurClient.getClient(Config.getConnectionString());

    TableDescriptor td = new TableDescriptor();
    td.setShardCount(11);
    td.setTableUri("file://" + TABLE_PATH + "/tableUnitTable");
    td.setCluster("default");
    td.setName("tableUnitTable");
    td.setEnabled(true);
    client.createTable(td);

    Map<String, List> data = TableUtil.getTableSummaries();

    assertEquals(1, data.get("tables").size());
View Full Code Here

  }

  private void makeSureNoEmptyShards(Configuration configuration, Path tableOutput) throws IOException {
    FileSystem fileSystem = tableOutput.getFileSystem(configuration);
    TableDescriptor tableDescriptor = BlurOutputFormat.getTableDescriptor(configuration);
    int shardCount = tableDescriptor.getShardCount();
    for (int i = 0; i < shardCount; i++) {
      String shardName = BlurUtil.getShardName(i);
      fileSystem.mkdirs(new Path(tableOutput, shardName));
    }
  }
View Full Code Here

    file.mkdirs();
  }

  @Test
  public void testLoadingNewTypeWhenNotDefined() throws IOException {
    TableDescriptor tableDescriptor = new TableDescriptor();
    tableDescriptor.setName(name);
    tableDescriptor.setTableUri(file.toURI().toString());
    TableContext context = TableContext.create(tableDescriptor);

    FieldManager fieldManager = context.getFieldManager();
    try {
      boolean result = fieldManager.addColumnDefinition("fam", "col", null, false, "test", false, null);
View Full Code Here

    }
  }

  @Test
  public void testLoadingNewTypeWhenDefinedFromTableDescriptor() throws IOException {
    TableDescriptor tableDescriptor = new TableDescriptor();
    tableDescriptor.setName(name);
    tableDescriptor.setTableUri(file.toURI().toString());
    tableDescriptor.putToTableProperties(BlurConstants.BLUR_FIELDTYPE + "test", TestType.class.getName());

    TableContext context = TableContext.create(tableDescriptor);
    FieldManager fieldManager = context.getFieldManager();

    fieldManager.addColumnDefinition("fam", "col", null, false, "test", false, null);
View Full Code Here

    BlurConfiguration blurConfiguration = new BlurConfiguration();
    blurConfiguration.set(BlurConstants.BLUR_FIELDTYPE + "test", TestType.class.getName());

    TableContext.setSystemBlurConfiguration(blurConfiguration);

    TableDescriptor tableDescriptor = new TableDescriptor();
    tableDescriptor.setName(name);
    tableDescriptor.setTableUri(file.toURI().toString());

    TableContext context = TableContext.create(tableDescriptor);
    FieldManager fieldManager = context.getFieldManager();

    fieldManager.addColumnDefinition("fam", "col", null, false, "test", false, null);
View Full Code Here

TOP

Related Classes of org.apache.blur.thrift.generated.TableDescriptor

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.