Package org.apache.blur.server

Examples of org.apache.blur.server.TableContext


    String tableUri = new Path(path, "tableuri").toUri().toString();

    System.out.println("tableUri=" + tableUri);
    tableDescriptor.setTableUri(tableUri);

    TableContext tableContext = TableContext.create(tableDescriptor);
    ShardContext shardContext = ShardContext.create(tableContext, "shard-1");
    TransactionRecorder transactionRecorder = new TransactionRecorder(shardContext);
    closeThis.add(transactionRecorder);
    transactionRecorder.open();
View Full Code Here


    String uuid = UUID.randomUUID().toString();
   
    tableDescriptor.setTableUri(new Path(base, "table-table").toUri().toString());
    tableDescriptor.setShardCount(2);
   
    TableContext tableContext = TableContext.create(tableDescriptor);
    ShardContext shardContext = ShardContext.create(tableContext, "shard-00000000");
    Path tablePath = new Path(base, "table-table");
    Path shardPath = new Path(tablePath, "shard-00000000");
    String indexDirName = "index_" + uuid;
    path = new Path(shardPath, indexDirName + ".commit");
    fileSystem.mkdirs(path);
    badRowIdsPath = new Path(shardPath, indexDirName + ".bad_rowids");
    Directory commitDirectory = new HdfsDirectory(configuration, path);
    Directory mainDirectory = new HdfsDirectory(configuration, shardPath);
    _fieldManager = tableContext.getFieldManager();
    Analyzer analyzerForIndex = _fieldManager.getAnalyzerForIndex();
    IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, analyzerForIndex);
    commitWriter = new IndexWriter(commitDirectory, conf);
   
    mainWriter = new IndexWriter(mainDirectory, conf);
View Full Code Here

    tableDescriptor.setName("test-table");
    tableDescriptor.setTableUri(tableUri);
    tableDescriptor.putToTableProperties("blur.shard.time.between.refreshs", Long.toString(refresh));
    tableDescriptor.putToTableProperties("blur.shard.time.between.commits", Long.toString(1000));

    TableContext tableContext = TableContext.create(tableDescriptor);
    directory = FSDirectory.open(new File(new URI(tableDescriptor.getTableUri())));

    ShardContext shardContext = ShardContext.create(tableContext, "test-shard");
    refresher = new BlurIndexRefresher();
    indexCloser = new BlurIndexCloser();
View Full Code Here

    }
   
    tableDescriptor.setTableUri(new File(base, "table-store-" + uuid).toURI().toString());
    tableDescriptor.putToTableProperties("blur.shard.time.between.refreshs", Long.toString(refresh));

    TableContext tableContext = TableContext.create(tableDescriptor);
    File path = new File(base, "index_" + uuid);
    path.mkdirs();
    FSDirectory directory = FSDirectory.open(path);
    ShardContext shardContext = ShardContext.create(tableContext, "test-shard-" + uuid);
    writer = new BlurNRTIndex(shardContext, mergeScheduler, closer, directory, gc, service);
View Full Code Here

    Path indexPath = new Path(tableOutput, shardName);
    _newIndex = new Path(indexPath, tmpDirName);
    _finalDir = new ProgressableDirectory(new HdfsDirectory(_configuration, _newIndex), getProgressable());
    _finalDir.setLockFactory(NoLockFactory.getNoLockFactory());

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

    _conf = new IndexWriterConfig(LuceneVersionConstant.LUCENE_VERSION, analyzer);
    _conf.setCodec(new Blur022Codec());
    _conf.setSimilarity(tableContext.getSimilarity());
    TieredMergePolicy mergePolicy = (TieredMergePolicy) _conf.getMergePolicy();
    mergePolicy.setUseCompoundFile(false);

    _overFlowConf = _conf.clone();
View Full Code Here

  public MutationQueueProcessor(BlockingQueue<RowMutation> queue, BlurIndex blurIndex, ShardContext context,
      AtomicInteger writesWaiting) {
    _queue = queue;
    _blurIndex = blurIndex;
    _context = context;
    TableContext tableContext = _context.getTableContext();
    BlurConfiguration blurConfiguration = tableContext.getBlurConfiguration();

    _maxQueueBatch = blurConfiguration.getInt(BLUR_SHARD_QUEUE_MAX_QUEUE_BATCH_SIZE, 100);
    _maxProcessingTime = TimeUnit.MILLISECONDS.toNanos(blurConfiguration.getInt(BLUR_SHARD_QUEUE_MAX_WRITER_LOCK_TIME,
        5000));
    _timeInMsThatQueueWritesPauseWhenEmpty = blurConfiguration
View Full Code Here

    tableProperties.put(BlurConstants.BLUR_SHARD_QUEUE_MAX_QUEUE_BATCH_SIZE, "500");
    tableProperties.put(BlurConstants.BLUR_SHARD_QUEUE_MAX_WRITER_LOCK_TIME, "1000");
    tableProperties.put(BlurConstants.BLUR_SHARD_QUEUE_MAX_INMEMORY_LENGTH, "1000");

    tableDescriptor.setTableProperties(tableProperties);
    TableContext tableContext = TableContext.create(tableDescriptor);
    File path = new File(_base, "index_" + uuid);
    path.mkdirs();
    FSDirectory directory = FSDirectory.open(path);
    ShardContext shardContext = ShardContext.create(tableContext, "test-shard-" + uuid);
    _writer = new BlurIndexSimpleWriter(shardContext, directory, _mergeScheduler, _service, _closer, _indexWarmup);
View Full Code Here

    }
  }

  public void cleanupOldDirs() throws IOException {
    Path hdfsDirPath = _shardContext.getHdfsDirPath();
    TableContext tableContext = _shardContext.getTableContext();
    Configuration configuration = tableContext.getConfiguration();
    FileSystem fileSystem = hdfsDirPath.getFileSystem(configuration);
    FileStatus[] inuseSubDirs = fileSystem.listStatus(hdfsDirPath, new PathFilter() {
      @Override
      public boolean accept(Path path) {
        return path.getName().endsWith(INUSE);
View Full Code Here

    String uuid = UUID.randomUUID().toString();

    tableDescriptor.setTableUri(new Path(_base, "table-table").toUri().toString());
    tableDescriptor.setShardCount(2);

    TableContext tableContext = TableContext.create(tableDescriptor);
    ShardContext shardContext = ShardContext.create(tableContext, "shard-00000000");
    Path tablePath = new Path(_base, "table-table");
    _shardPath = new Path(tablePath, "shard-00000000");
    String indexDirName = "index_" + uuid;
    _path = new Path(_shardPath, indexDirName + ".commit");
    _fileSystem.mkdirs(_path);
    _badRowIdsPath = new Path(_shardPath, indexDirName + ".badrowids");
    _badIndexPath = new Path(_shardPath, indexDirName + ".badindex");
    _inUsePath = new Path(_shardPath, indexDirName + ".inuse");
    Directory commitDirectory = new HdfsDirectory(configuration, _path);
    _mainDirectory = new HdfsDirectory(configuration, _shardPath);
    _fieldManager = tableContext.getFieldManager();
    Analyzer analyzerForIndex = _fieldManager.getAnalyzerForIndex();
    IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, analyzerForIndex);
    // conf.setMergePolicy(NoMergePolicy.NO_COMPOUND_FILES);
    TieredMergePolicy mergePolicy = (TieredMergePolicy) conf.getMergePolicy();
    mergePolicy.setUseCompoundFile(false);
View Full Code Here

    TableContext.clear();
    TableDescriptor tableDescriptor = new TableDescriptor();
    tableDescriptor.setName("test");
    tableDescriptor.setTableUri(file.toURI().toString());
    TableContext tableContext = TableContext.create(tableDescriptor);
    ShardContext shardContext = ShardContext.create(tableContext, "test");
    _action = new MutatableAction(shardContext);
    _conf = new IndexWriterConfig(Version.LUCENE_43, new KeywordAnalyzer());
  }
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.