Esempio n. 1
0
  /** Additional initialization steps */
  protected void finishInit(final Configuration conf) {
    if (fsBlockWriter != null) throw new IllegalStateException("finishInit called twice");

    fsBlockWriter = new HFileBlock.Writer(blockEncoder, hFileContext);

    // Data block index writer
    boolean cacheIndexesOnWrite = cacheConf.shouldCacheIndexesOnWrite();
    dataBlockIndexWriter =
        new HFileBlockIndex.BlockIndexWriter(
            fsBlockWriter,
            cacheIndexesOnWrite ? cacheConf.getBlockCache() : null,
            cacheIndexesOnWrite ? name : null);
    dataBlockIndexWriter.setMaxChunkSize(HFileBlockIndex.getMaxChunkSize(conf));
    inlineBlockWriters.add(dataBlockIndexWriter);

    // Meta data block index writer
    metaBlockIndexWriter = new HFileBlockIndex.BlockIndexWriter();
    if (LOG.isTraceEnabled()) LOG.trace("Initialized with " + cacheConf);
  }
Esempio n. 2
0
  /** Additional initialization steps */
  private void finishInit(final Configuration conf) {
    if (fsBlockWriter != null) throw new IllegalStateException("finishInit called twice");

    // HFile filesystem-level (non-caching) block writer
    fsBlockWriter =
        new HFileBlock.Writer(
            compressAlgo, blockEncoder, includeMemstoreTS, checksumType, bytesPerChecksum);

    // Data block index writer
    boolean cacheIndexesOnWrite = cacheConf.shouldCacheIndexesOnWrite();
    dataBlockIndexWriter =
        new HFileBlockIndex.BlockIndexWriter(
            fsBlockWriter,
            cacheIndexesOnWrite ? cacheConf.getBlockCache() : null,
            cacheIndexesOnWrite ? name : null);
    dataBlockIndexWriter.setMaxChunkSize(HFileBlockIndex.getMaxChunkSize(conf));
    inlineBlockWriters.add(dataBlockIndexWriter);

    // Meta data block index writer
    metaBlockIndexWriter = new HFileBlockIndex.BlockIndexWriter();
    if (LOG.isTraceEnabled()) LOG.trace("Initialized with " + cacheConf);
  }