当前位置: 首页>>代码示例>>Java>>正文


Java DataOutput.writeLong方法代码示例

本文整理汇总了Java中org.apache.lucene.store.DataOutput.writeLong方法的典型用法代码示例。如果您正苦于以下问题:Java DataOutput.writeLong方法的具体用法?Java DataOutput.writeLong怎么用?Java DataOutput.writeLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.lucene.store.DataOutput的用法示例。


在下文中一共展示了DataOutput.writeLong方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeRecursively

import org.apache.lucene.store.DataOutput; //导入方法依赖的package包/类
private void writeRecursively(DataOutput out, TSTNode node) throws IOException {
  if (node == null) {
    return;
  }
  out.writeString(new String(new char[] {node.splitchar}, 0, 1));
  byte mask = 0;
  if (node.relatives[TSTNode.LOKID] != null) mask |= LO_KID;
  if (node.relatives[TSTNode.EQKID] != null) mask |= EQ_KID;
  if (node.relatives[TSTNode.HIKID] != null) mask |= HI_KID;
  if (node.data != null) mask |= HAS_VALUE;
  out.writeByte(mask);
  if (node.data != null) {
    out.writeLong(((Number)node.data).longValue());
  }
  writeRecursively(out, node.relatives[TSTNode.LOKID]);
  writeRecursively(out, node.relatives[TSTNode.EQKID]);
  writeRecursively(out, node.relatives[TSTNode.HIKID]);
}
 
开发者ID:europeana,项目名称:search,代码行数:19,代码来源:JaspellLookup.java

示例2: writeRecursively

import org.apache.lucene.store.DataOutput; //导入方法依赖的package包/类
private void writeRecursively(DataOutput out, TernaryTreeNode node) throws IOException {
  // write out the current node
  out.writeString(new String(new char[] {node.splitchar}, 0, 1));
  // prepare a mask of kids
  byte mask = 0;
  if (node.eqKid != null) mask |= EQ_KID;
  if (node.loKid != null) mask |= LO_KID;
  if (node.hiKid != null) mask |= HI_KID;
  if (node.token != null) mask |= HAS_TOKEN;
  if (node.val != null) mask |= HAS_VALUE;
  out.writeByte(mask);
  if (node.token != null) out.writeString(node.token);
  if (node.val != null) out.writeLong(((Number)node.val).longValue());
  // recurse and write kids
  if (node.loKid != null) {
    writeRecursively(out, node.loKid);
  }
  if (node.eqKid != null) {
    writeRecursively(out, node.eqKid);
  }
  if (node.hiKid != null) {
    writeRecursively(out, node.hiKid);
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:25,代码来源:TSTLookup.java

示例3: write

import org.apache.lucene.store.DataOutput; //导入方法依赖的package包/类
private void write(DataOutput out) throws IOException {
    out.writeLong(offset);
    out.writeInt(numOps);
    out.writeLong(generation);
    out.writeLong(minSeqNo);
    out.writeLong(maxSeqNo);
    out.writeLong(globalCheckpoint);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:Checkpoint.java

示例4: serilaize

import org.apache.lucene.store.DataOutput; //导入方法依赖的package包/类
public static void serilaize(BloomFilter filter, DataOutput out) throws IOException {
    out.writeInt(0); // version
    BitArray bits = filter.bits;
    out.writeInt(bits.data.length);
    for (long l : bits.data) {
        out.writeLong(l);
    }
    out.writeInt(filter.numHashFunctions);
    out.writeInt(filter.hashing.type()); // hashType
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:BloomFilter.java

示例5: write

import org.apache.lucene.store.DataOutput; //导入方法依赖的package包/类
private void write(DataOutput out) throws IOException {
    out.writeLong(offset);
    out.writeInt(numOps);
    out.writeLong(generation);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:6,代码来源:Checkpoint.java

示例6: serialize

import org.apache.lucene.store.DataOutput; //导入方法依赖的package包/类
/**
 * Serializes the data set to file using the following format:
 * <ul>
 *  <li>FuzzySet --&gt;FuzzySetVersion,HashFunctionName,BloomSize,
 * NumBitSetWords,BitSetWord<sup>NumBitSetWords</sup></li> 
 * <li>HashFunctionName --&gt; {@link DataOutput#writeString(String) String} The
 * name of a ServiceProvider registered {@link HashFunction}</li>
 * <li>FuzzySetVersion --&gt; {@link DataOutput#writeInt Uint32} The version number of the {@link FuzzySet} class</li>
 * <li>BloomSize --&gt; {@link DataOutput#writeInt Uint32} The modulo value used
 * to project hashes into the field's Bitset</li>
 * <li>NumBitSetWords --&gt; {@link DataOutput#writeInt Uint32} The number of
 * longs (as returned from {@link FixedBitSet#getBits})</li>
 * <li>BitSetWord --&gt; {@link DataOutput#writeLong Long} A long from the array
 * returned by {@link FixedBitSet#getBits}</li>
 * </ul>
 * @param out Data output stream
 * @throws IOException If there is a low-level I/O error
 */
public void serialize(DataOutput out) throws IOException
{
    out.writeInt(VERSION_CURRENT);
    out.writeInt(bloomSize);
    long[] bits = filter.getBits();
    out.writeInt(bits.length);
    for (int i = 0; i < bits.length; i++) {
      // Can't used VLong encoding because cant cope with negative numbers
      // output by FixedBitSet
      out.writeLong(bits[i]);
    }
}
 
开发者ID:europeana,项目名称:search,代码行数:31,代码来源:FuzzySet.java


注:本文中的org.apache.lucene.store.DataOutput.writeLong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。