Package org.apache.lucene.store

Examples of org.apache.lucene.store.IndexOutput.writeLong()


            }

            // Write the data offsets into the directory of the compound stream
            for (FileEntry fe : entries) {
                os.seek(fe.directoryOffset);
                os.writeLong(fe.dataOffset);
            }

            assert finalLength == os.length();

            // Close the output stream. Set the os to null before trying to
View Full Code Here


    try {
      IndexOutput genOutput = dir.createOutput(IndexFileNames.SEGMENTS_GEN);
      try {
        genOutput.writeInt(FORMAT_LOCKLESS);
        genOutput.writeLong(generation);
        genOutput.writeLong(generation);
      } finally {
        genOutput.close();
      }
    } catch (Throwable t) {
View Full Code Here

    try {
      IndexOutput genOutput = dir.createOutput(IndexFileNames.SEGMENTS_GEN);
      try {
        genOutput.writeInt(FORMAT_LOCKLESS);
        genOutput.writeLong(generation);
        genOutput.writeLong(generation);
      } finally {
        genOutput.close();
      }
    } catch (Throwable t) {
      // It's OK if we fail to write this file since it's
View Full Code Here

    try {
      IndexOutput genOutput = dir.createOutput(IndexFileNames.SEGMENTS_GEN);
      try {
        genOutput.writeInt(FORMAT_LOCKLESS);
        genOutput.writeLong(generation);
        genOutput.writeLong(generation);
      } finally {
        genOutput.close();
      }
    } catch (Throwable t) {
View Full Code Here

    try {
      IndexOutput genOutput = dir.createOutput(IndexFileNames.SEGMENTS_GEN);
      try {
        genOutput.writeInt(FORMAT_LOCKLESS);
        genOutput.writeLong(generation);
        genOutput.writeLong(generation);
      } finally {
        genOutput.close();
      }
    } catch (Throwable t) {
      // It's OK if we fail to write this file since it's
View Full Code Here

    private void insertData(ByteBufferDirectory dir, int bufferSizeInBytes) throws IOException {
        byte[] test = new byte[]{1, 2, 3, 4, 5, 6, 7, 8};
        IndexOutput indexOutput = dir.createOutput("value1");
        indexOutput.writeBytes(new byte[]{2, 4, 6, 7, 8}, 5);
        indexOutput.writeInt(-1);
        indexOutput.writeLong(10);
        indexOutput.writeInt(0);
        indexOutput.writeInt(0);
        indexOutput.writeBytes(test, 8);
        indexOutput.writeBytes(test, 5);
View Full Code Here

  @Test
  public void testSymlink() throws IOException {
    HdfsDirectory dir1 = new HdfsDirectory(_configuration, new Path(_base, "dir1"));
    IndexOutput output = dir1.createOutput("file1", IOContext.DEFAULT);
    output.writeLong(12345);
    output.close();

    assertTrue(dir1.fileExists("file1"));

    HdfsDirectory dir2 = new HdfsDirectory(_configuration, new Path(_base, "dir2"));
View Full Code Here

      int wordNum = index >> 6; // div 64
      if (currentWordNum > wordNum) {
        throw new IOException("We got a problem here!");
      }
      while (currentWordNum < wordNum) {
        output.writeLong(wordValue);
        currentWordNum++;
        wordValue = 0;
      }
      int bit = index & 0x3f; // mod 64
      long bitmask = 1L << bit;
View Full Code Here

      wordValue |= bitmask;
    }
    if (_numBits > 0) {
      int totalWords = (_numBits / 64) + 1;
      while (currentWordNum < totalWords) {
        output.writeLong(wordValue);
        currentWordNum++;
        wordValue = 0;
      }
    }
    output.close();
View Full Code Here

  }

  @Test
  public void test1() throws IOException {
    IndexOutput output = _cacheDirectory.createOutput("test.file", IOContext.DEFAULT);
    output.writeLong(0);
    output.writeLong(1);
    output.writeLong(2);
    output.close();

    IndexInput input = _cacheDirectory.openInput("test.file", IOContext.DEFAULT);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.