Package org.apache.blur.server

Examples of org.apache.blur.server.TableContext


      if (searcher == null) {
        searcher = index.getIndexReader();
        usedCache = false;
      }

      TableContext tableContext = getTableContext(table);
      FieldManager fieldManager = tableContext.getFieldManager();

      Query highlightQuery = getHighlightQuery(selector, table, fieldManager);

      fetchRow(searcher.getIndexReader(), table, shard, selector, fetchResult, highlightQuery, fieldManager,
          _maxHeapPerRowFetch);
View Full Code Here


    org.apache.blur.thrift.generated.Query query = highlightOptions.getQuery();
    if (query == null) {
      return null;
    }

    TableContext context = getTableContext(table);
    Filter preFilter = QueryParserUtil.parseFilter(table, query.recordFilter, false, fieldManager, _filterCache,
        context);
    Filter postFilter = QueryParserUtil.parseFilter(table, query.rowFilter, true, fieldManager, _filterCache, context);
    return QueryParserUtil.parseQuery(query.query, query.rowQuery, fieldManager, postFilter, preFilter,
        getScoreType(query.scoreType), context);
View Full Code Here

        LOG.error("Unknown error while trying to fetch index readers.", e);
        throw new BException(e.getMessage(), e);
      }
      ShardServerContext shardServerContext = ShardServerContext.getShardServerContext();
      ParallelCall<Entry<String, BlurIndex>, BlurResultIterable> call;
      TableContext context = getTableContext(table);
      FieldManager fieldManager = context.getFieldManager();
      org.apache.blur.thrift.generated.Query simpleQuery = blurQuery.query;
      Filter preFilter = QueryParserUtil.parseFilter(table, simpleQuery.recordFilter, false, fieldManager,
          _filterCache, context);
      Filter postFilter = QueryParserUtil.parseFilter(table, simpleQuery.rowFilter, true, fieldManager, _filterCache,
          context);
View Full Code Here

    }
  }

  public String parseQuery(String table, org.apache.blur.thrift.generated.Query simpleQuery) throws ParseException,
      BlurException {
    TableContext context = getTableContext(table);
    FieldManager fieldManager = context.getFieldManager();
    Filter preFilter = QueryParserUtil.parseFilter(table, simpleQuery.recordFilter, false, fieldManager, _filterCache,
        context);
    Filter postFilter = QueryParserUtil.parseFilter(table, simpleQuery.rowFilter, true, fieldManager, _filterCache,
        context);
    Query userQuery = QueryParserUtil.parseQuery(simpleQuery.query, simpleQuery.rowQuery, fieldManager, postFilter,
View Full Code Here

    }
    return new Term(columnFamily + "." + columnName, value);
  }

  public Schema schema(String table) throws IOException {
    TableContext tableContext = getTableContext(table);
    FieldManager fieldManager = tableContext.getFieldManager();
    Schema schema = new Schema().setTable(table);
    schema.setFamilies(new HashMap<String, Map<String, ColumnDefinition>>());
    Set<String> fieldNames = fieldManager.getFieldNames();
    INNER: for (String fieldName : fieldNames) {
      FieldTypeDefinition fieldTypeDefinition = fieldManager.getFieldTypeDefinition(fieldName);
View Full Code Here

    Directory directory = new HdfsDirectory(_configuration, hdfsDirPath);
    directory.setLockFactory(lockFactory);

    TableDescriptor descriptor = _clusterStatus.getTableDescriptor(true, _cluster, table);
    TableContext tableContext = TableContext.create(descriptor);
    ShardContext shardContext = ShardContext.create(tableContext, shard);

    Directory dir;
    boolean blockCacheEnabled = _clusterStatus.isBlockCacheEnabled(_cluster, table);
    if (blockCacheEnabled) {
View Full Code Here

  private final String _table;
  private final String _shard;
  private final FieldManager _fieldManager;

  public TransactionRecorder(ShardContext shardContext) throws IOException {
    TableContext tableContext = shardContext.getTableContext();
    _configuration = tableContext.getConfiguration();
    _fieldManager = tableContext.getFieldManager();
    _walPath = shardContext.getWalShardPath();
    _fileSystem = _walPath.getFileSystem(_configuration);
    _timeBetweenSyncsNanos = tableContext.getTimeBetweenWALSyncsNanos();
    _timer = new Timer("wal-sync-[" + tableContext.getTable() + "/" + shardContext.getShard() + "]", true);
    _timer.schedule(this, TimeUnit.NANOSECONDS.toMillis(_timeBetweenSyncsNanos),
        TimeUnit.NANOSECONDS.toMillis(_timeBetweenSyncsNanos));
    _table = tableContext.getTable();
    _shard = shardContext.getShard();
  }
View Full Code Here

    }
    if (columnDefinition == null) {
      throw new BException("ColumnDefinition cannot be null.");
    }
    TableDescriptor tableDescriptor = describe(table);
    TableContext context = TableContext.create(tableDescriptor);
    FieldManager fieldManager = context.getFieldManager();
    String family = columnDefinition.getFamily();
    if (family == null) {
      throw new BException("Family in ColumnDefinition [{0}] cannot be null.", columnDefinition);
    }
    String columnName = columnDefinition.getColumnName();
View Full Code Here

      _newIndex = new Path(indexPath, tmpDirName);
      _finalDir = new ProgressableDirectory(new HdfsDirectory(configuration, _newIndex),
          BlurOutputFormat.getProgressable());
      _finalDir.setLockFactory(NoLockFactory.getNoLockFactory());

      TableContext tableContext = TableContext.create(tableDescriptor);
      _fieldManager = tableContext.getFieldManager();
      Analyzer analyzer = _fieldManager.getAnalyzerForIndex();

      _conf = new IndexWriterConfig(LuceneVersionConstant.LUCENE_VERSION, analyzer);
      TieredMergePolicy mergePolicy = (TieredMergePolicy) _conf.getMergePolicy();
      mergePolicy.setUseCompoundFile(false);
View Full Code Here

    mergePolicy.setUseCompoundFile(false);
    _writer = new IndexWriter(_directory, config);
  }

  protected void setupAnalyzer(Context context) {
    TableContext tableContext = TableContext.create(_blurTask.getTableDescriptor());
    _fieldManager = tableContext.getFieldManager();
    _analyzer = _fieldManager.getAnalyzerForIndex();
  }
View Full Code Here

TOP

Related Classes of org.apache.blur.server.TableContext

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.