Package org.apache.blur.thrift.generated

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


      BlurClientManager.execute(connectionString, new BlurCommand<Void>() {
        @Override
        public Void call(Client client) throws BlurException, TException {
          tables = client.tableList();
          for (String table : tables) {
            TableDescriptor descriptor = client.describe(table);
            if (descriptor.isEnabled()) {
              schemaMap.put(table, client.schema(table));
            }
          }
          return null;
        }
View Full Code Here


    final String cluster = args[1];
    final String tableName = args[2];
    int shardCount = Integer.parseInt(args[3]);
    String uri = args[4];

    final TableDescriptor tableDescriptor = new TableDescriptor();
    tableDescriptor.cluster = cluster;
    tableDescriptor.name = tableName;
    tableDescriptor.readOnly = false;

    tableDescriptor.shardCount = shardCount;
View Full Code Here

  }

  @Override
  public void checkOutputSpecs(JobContext context) throws IOException, InterruptedException {
    Configuration config = context.getConfiguration();
    TableDescriptor tableDescriptor = getTableDescriptor(config);
    if (tableDescriptor == null) {
      throw new IOException("setTableDescriptor needs to be called first.");
    }
    int shardCount = tableDescriptor.getShardCount();
    FileSystem fileSystem = getOutputPath(config).getFileSystem(config);
    Path tablePath = new Path(tableDescriptor.getTableUri());
    if (fileSystem.exists(tablePath)) {
      BlurUtil.validateShardCount(shardCount, fileSystem, tablePath);
    } else {
      throw new IOException("Table path [ " + tablePath + " ] doesn't exist for table [ " + tableDescriptor.getName()
          + " ].");
    }
    BlurUtil.validateWritableDirectory(fileSystem, tablePath);
    int reducers = context.getNumReduceTasks();
    int reducerMultiplier = getReducerMultiplier(config);
View Full Code Here

      return null;
    }
    ByteArrayInputStream inputStream = new ByteArrayInputStream(tableDesStr.getBytes());
    TIOStreamTransport transport = new TIOStreamTransport(inputStream);
    TJSONProtocol protocol = new TJSONProtocol(transport);
    TableDescriptor descriptor = new TableDescriptor();
    try {
      descriptor.read(protocol);
    } catch (TException e) {
      throw new IOException(e);
    }
    transport.close();
    return descriptor;
View Full Code Here

   * @param multiple
   *          the multiple to use.
   * @throws IOException
   */
  public static void setReducerMultiplier(Job job, int multiple) throws IOException {
    TableDescriptor tableDescriptor = getTableDescriptor(job.getConfiguration());
    if (tableDescriptor == null) {
      throw new IOException("setTableDescriptor needs to be called first.");
    }
    job.setNumReduceTasks(tableDescriptor.getShardCount() * multiple);
    Configuration configuration = job.getConfiguration();
    configuration.setInt(BLUR_OUTPUT_REDUCER_MULTIPLIER, multiple);
  }
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

    public BlurRecordWriter(Configuration configuration, int attemptId, String tmpDirName) throws IOException {

      _indexLocally = BlurOutputFormat.isIndexLocally(configuration);
      _optimizeInFlight = BlurOutputFormat.isOptimizeInFlight(configuration);

      TableDescriptor tableDescriptor = BlurOutputFormat.getTableDescriptor(configuration);
      int shardCount = tableDescriptor.getShardCount();
      int shardId = attemptId % shardCount;

      _maxDocumentBufferSize = BlurOutputFormat.getMaxDocumentBufferSize(configuration);
      Path tableOutput = BlurOutputFormat.getOutputPath(configuration);
      String shardName = BlurUtil.getShardName(BlurConstants.SHARD_PREFIX, shardId);
View Full Code Here

    client.mutate(mutation);
  }

  private static boolean createTable(Iface client, final String cluster, String uri, int shardCount, String tableName) throws BlurException, TException {
    Random random = new Random();
    final TableDescriptor tableDescriptor = new TableDescriptor();
    tableDescriptor.cluster = cluster;

    tableDescriptor.name = tableName;
    tableDescriptor.readOnly = random.nextBoolean();
View Full Code Here

    _shardServerLayout.set(newLayout);
  }

  private List<String> getShardList(String cluster, String table) {
    List<String> shards = new ArrayList<String>();
    TableDescriptor tableDescriptor = _clusterStatus.getTableDescriptor(true, cluster, table);
    for (int i = 0; i < tableDescriptor.shardCount; i++) {
      shards.add(BlurUtil.getShardName(BlurConstants.SHARD_PREFIX, i));
    }
    return shards;
  }
View Full Code Here

      }
    });
  }

  private String getCluster(String table) throws BlurException, TException {
    TableDescriptor describe = describe(table);
    if (describe == null) {
      throw new BException("Table [" + table + "] not found.");
    }
    return describe.cluster;
  }
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.