Java Code Examples for org.apache.lucene.store.BufferedChecksum

The following examples show how to use org.apache.lucene.store.BufferedChecksum. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: RedisDirectory   Source File: RedisOutputStream.java    License: Apache License 2.0 5 votes vote down vote up
private RedisOutputStream(String indexFileName, InputOutputStream inputOutputStream, boolean checksum) {
    super(indexFileName);
    this.currentBufferIndex = -1;
    this.currentBuffer = null;
    this.indexFileName = indexFileName;
    this.redisFile = new RedisFile();
    this.inputOutputStream = inputOutputStream;
    if (checksum) {
        crc = new BufferedChecksum(new CRC32());
    } else {
        crc = null;
    }
}
 
Example 2
Source Project: Elasticsearch   Source File: BufferedChecksumStreamInput.java    License: Apache License 2.0 5 votes vote down vote up
public BufferedChecksumStreamInput(StreamInput in, BufferedChecksumStreamInput reuse) {
    this.in = in;
    if (reuse == null ) {
        this.digest = new BufferedChecksum(new CRC32());
    } else {
        this.digest = reuse.digest;
        digest.reset();
        this.skipBuffer = reuse.skipBuffer;
    }
}
 
Example 3
Source Project: RedisDirectory   Source File: RedisOutputStream.java    License: Apache License 2.0 5 votes vote down vote up
private RedisOutputStream(String indexFileName, InputOutputStream inputOutputStream, boolean checksum) {
    super(indexFileName);
    this.currentBufferIndex = -1;
    this.currentBuffer = null;
    this.indexFileName = indexFileName;
    this.redisFile = new RedisFile();
    this.inputOutputStream = inputOutputStream;
    if (checksum) {
        crc = new BufferedChecksum(new CRC32());
    } else {
        crc = null;
    }
}
 
Example 4
Source Project: ignite   Source File: GridLuceneOutputStream.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Constructor.
 *
 * @param f File.
 */
public GridLuceneOutputStream(GridLuceneFile f) {
    super("RAMOutputStream(name=\"noname\")", "noname");

    file = f;

    mem = f.getDirectory().memory();

    // make sure that we switch to the
    // first needed buffer lazily
    currBufIdx = -1;
    currBuf = 0;

    crc = new BufferedChecksum(new CRC32());
}
 
Example 5
Source Project: crate   Source File: BufferedChecksumStreamInput.java    License: Apache License 2.0 5 votes vote down vote up
public BufferedChecksumStreamInput(StreamInput in, String source, BufferedChecksumStreamInput reuse) {
    super(in);
    this.source = source;
    if (reuse == null) {
        this.digest = new BufferedChecksum(new CRC32());
    } else {
        this.digest = reuse.digest;
        digest.reset();
        this.skipBuffer = reuse.skipBuffer;
    }
}
 
Example 6
public BufferedChecksumStreamOutput(StreamOutput out) {
    this.out = out;
    this.digest = new BufferedChecksum(new CRC32());
}
 
Example 7
Source Project: Elasticsearch   Source File: BufferedChecksumStreamInput.java    License: Apache License 2.0 4 votes vote down vote up
public BufferedChecksumStreamInput(StreamInput in) {
    this.in = in;
    this.digest = new BufferedChecksum(new CRC32());
}
 
Example 8
Source Project: crate   Source File: BufferedChecksumStreamOutput.java    License: Apache License 2.0 4 votes vote down vote up
public BufferedChecksumStreamOutput(StreamOutput out) {
    this.out = out;
    this.digest = new BufferedChecksum(new CRC32());
}
 
Example 9
Source Project: crate   Source File: Store.java    License: Apache License 2.0 4 votes vote down vote up
VerifyingIndexInput(IndexInput input) {
    this(input, new BufferedChecksum(new CRC32()));
}