congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
BytesStore.getPosition
Code IndexAdd Tabnine to your IDE (free)

How to use
getPosition
method
in
org.apache.lucene.util.fst.BytesStore

Best Java code snippets using org.apache.lucene.util.fst.BytesStore.getPosition (Showing top 20 results out of 315)

origin: org.apache.lucene/lucene-core

/** Pos must be less than the max position written so far!
 *  Ie, you cannot "grow" the file with this! */
public void truncate(long newLen) {
 assert newLen <= getPosition();
 assert newLen >= 0;
 int blockIndex = (int) (newLen >> blockBits);
 nextWrite = (int) (newLen & blockMask);
 if (nextWrite == 0) {
  blockIndex--;
  nextWrite = blockSize;
 }
 blocks.subList(blockIndex+1, blocks.size()).clear();
 if (newLen == 0) {
  current = null;
 } else {
  current = blocks.get(blockIndex);
 }
 assert newLen == getPosition();
}
origin: org.apache.lucene/lucene-core

assert destPos < getPosition();
origin: org.apache.lucene/lucene-core

void finish(long newStartNode) throws IOException {
 assert newStartNode <= bytes.getPosition();
 if (startNode != -1) {
  throw new IllegalStateException("already finished");
 }
 if (newStartNode == FINAL_END_NODE && emptyOutput != null) {
  newStartNode = 0;
 }
 startNode = newStartNode;
 bytes.finish();
 cacheRootArcs();
}

origin: org.apache.lucene/lucene-core

assert dest + len <= getPosition(): "dest=" + dest + " pos=" + getPosition() + " len=" + len;
origin: org.apache.lucene/lucene-core

private CompiledNode compileNode(UnCompiledNode<T> nodeIn, int tailLength) throws IOException {
 final long node;
 long bytesPosStart = bytes.getPosition();
 if (dedupHash != null && (doShareNonSingletonNodes || nodeIn.numArcs <= 1) && tailLength <= shareMaxTailLength) {
  if (nodeIn.numArcs == 0) {
   node = fst.addNode(this, nodeIn);
   lastFrozenNode = node;
  } else {
   node = dedupHash.add(this, nodeIn);
  }
 } else {
  node = fst.addNode(this, nodeIn);
 }
 assert node != -2;
 long bytesPosEnd = bytes.getPosition();
 if (bytesPosEnd != bytesPosStart) {
  // The FST added a new node:
  assert bytesPosEnd > bytesPosStart;
  lastFrozenNode = node;
 }
 nodeIn.clear();
 final CompiledNode fn = new CompiledNode();
 fn.node = node;
 return fn;
}
origin: org.apache.lucene/lucene-core

final long startAddress = builder.bytes.getPosition();
long lastArcStart = builder.bytes.getPosition();
int maxBytesPerArc = 0;
for(int arcIdx=0;arcIdx<nodeIn.numArcs;arcIdx++) {
  builder.reusedBytesPerArc[arcIdx] = (int) (builder.bytes.getPosition() - lastArcStart);
  lastArcStart = builder.bytes.getPosition();
  maxBytesPerArc = Math.max(maxBytesPerArc, builder.reusedBytesPerArc[arcIdx]);
 long srcPos = builder.bytes.getPosition();
 long destPos = fixedArrayStart + nodeIn.numArcs*maxBytesPerArc;
 assert destPos >= srcPos;
final long thisNodeAddress = builder.bytes.getPosition()-1;
origin: org.apache.lucene/lucene-core

out.writeVLong(startNode);
if (bytes != null) {
 long numBytes = bytes.getPosition();
 out.writeVLong(numBytes);
 bytes.writeTo(out);
origin: org.infinispan/infinispan-embedded-query

/** Pos must be less than the max position written so far!
 *  Ie, you cannot "grow" the file with this! */
public void truncate(long newLen) {
 assert newLen <= getPosition();
 assert newLen >= 0;
 int blockIndex = (int) (newLen >> blockBits);
 nextWrite = (int) (newLen & blockMask);
 if (nextWrite == 0) {
  blockIndex--;
  nextWrite = blockSize;
 }
 blocks.subList(blockIndex+1, blocks.size()).clear();
 if (newLen == 0) {
  current = null;
 } else {
  current = blocks.get(blockIndex);
 }
 assert newLen == getPosition();
}
origin: harbby/presto-connectors

/** Pos must be less than the max position written so far!
 *  Ie, you cannot "grow" the file with this! */
public void truncate(long newLen) {
 assert newLen <= getPosition();
 assert newLen >= 0;
 int blockIndex = (int) (newLen >> blockBits);
 nextWrite = (int) (newLen & blockMask);
 if (nextWrite == 0) {
  blockIndex--;
  nextWrite = blockSize;
 }
 blocks.subList(blockIndex+1, blocks.size()).clear();
 if (newLen == 0) {
  current = null;
 } else {
  current = blocks.get(blockIndex);
 }
 assert newLen == getPosition();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/** Pos must be less than the max position written so far!
 *  Ie, you cannot "grow" the file with this! */
public void truncate(long newLen) {
 assert newLen <= getPosition();
 assert newLen >= 0;
 int blockIndex = (int) (newLen >> blockBits);
 nextWrite = (int) (newLen & blockMask);
 if (nextWrite == 0) {
  blockIndex--;
  nextWrite = blockSize;
 }
 blocks.subList(blockIndex+1, blocks.size()).clear();
 if (newLen == 0) {
  current = null;
 } else {
  current = blocks.get(blockIndex);
 }
 assert newLen == getPosition();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

assert destPos < getPosition();
origin: org.infinispan/infinispan-embedded-query

assert destPos < getPosition();
origin: harbby/presto-connectors

assert destPos < getPosition();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

void finish(long newStartNode) throws IOException {
 assert newStartNode <= bytes.getPosition();
 if (startNode != -1) {
  throw new IllegalStateException("already finished");
 }
 if (newStartNode == FINAL_END_NODE && emptyOutput != null) {
  newStartNode = 0;
 }
 startNode = newStartNode;
 bytes.finish();
 cacheRootArcs();
}

origin: harbby/presto-connectors

void finish(long newStartNode) throws IOException {
 assert newStartNode <= bytes.getPosition();
 if (startNode != -1) {
  throw new IllegalStateException("already finished");
 }
 if (newStartNode == FINAL_END_NODE && emptyOutput != null) {
  newStartNode = 0;
 }
 startNode = newStartNode;
 bytes.finish();
 cacheRootArcs();
}
origin: org.infinispan/infinispan-embedded-query

void finish(long newStartNode) throws IOException {
 assert newStartNode <= bytes.getPosition();
 if (startNode != -1) {
  throw new IllegalStateException("already finished");
 }
 if (newStartNode == FINAL_END_NODE && emptyOutput != null) {
  newStartNode = 0;
 }
 startNode = newStartNode;
 bytes.finish();
 cacheRootArcs();
}
origin: harbby/presto-connectors

private CompiledNode compileNode(UnCompiledNode<T> nodeIn, int tailLength) throws IOException {
 final long node;
 long bytesPosStart = bytes.getPosition();
 if (dedupHash != null && (doShareNonSingletonNodes || nodeIn.numArcs <= 1) && tailLength <= shareMaxTailLength) {
  if (nodeIn.numArcs == 0) {
   node = fst.addNode(this, nodeIn);
   lastFrozenNode = node;
  } else {
   node = dedupHash.add(this, nodeIn);
  }
 } else {
  node = fst.addNode(this, nodeIn);
 }
 assert node != -2;
 long bytesPosEnd = bytes.getPosition();
 if (bytesPosEnd != bytesPosStart) {
  // The FST added a new node:
  assert bytesPosEnd > bytesPosStart;
  lastFrozenNode = node;
 }
 nodeIn.clear();
 final CompiledNode fn = new CompiledNode();
 fn.node = node;
 return fn;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

private CompiledNode compileNode(UnCompiledNode<T> nodeIn, int tailLength) throws IOException {
 final long node;
 long bytesPosStart = bytes.getPosition();
 if (dedupHash != null && (doShareNonSingletonNodes || nodeIn.numArcs <= 1) && tailLength <= shareMaxTailLength) {
  if (nodeIn.numArcs == 0) {
   node = fst.addNode(this, nodeIn);
   lastFrozenNode = node;
  } else {
   node = dedupHash.add(this, nodeIn);
  }
 } else {
  node = fst.addNode(this, nodeIn);
 }
 assert node != -2;
 long bytesPosEnd = bytes.getPosition();
 if (bytesPosEnd != bytesPosStart) {
  // The FST added a new node:
  assert bytesPosEnd > bytesPosStart;
  lastFrozenNode = node;
 }
 nodeIn.clear();
 final CompiledNode fn = new CompiledNode();
 fn.node = node;
 return fn;
}
origin: org.infinispan/infinispan-embedded-query

private CompiledNode compileNode(UnCompiledNode<T> nodeIn, int tailLength) throws IOException {
 final long node;
 long bytesPosStart = bytes.getPosition();
 if (dedupHash != null && (doShareNonSingletonNodes || nodeIn.numArcs <= 1) && tailLength <= shareMaxTailLength) {
  if (nodeIn.numArcs == 0) {
   node = fst.addNode(this, nodeIn);
   lastFrozenNode = node;
  } else {
   node = dedupHash.add(this, nodeIn);
  }
 } else {
  node = fst.addNode(this, nodeIn);
 }
 assert node != -2;
 long bytesPosEnd = bytes.getPosition();
 if (bytesPosEnd != bytesPosStart) {
  // The FST added a new node:
  assert bytesPosEnd > bytesPosStart;
  lastFrozenNode = node;
 }
 nodeIn.clear();
 final CompiledNode fn = new CompiledNode();
 fn.node = node;
 return fn;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

out.writeVLong(startNode);
if (bytes != null) {
 long numBytes = bytes.getPosition();
 out.writeVLong(numBytes);
 bytes.writeTo(out);
org.apache.lucene.util.fstBytesStoregetPosition

Popular methods of BytesStore

  • <init>
    Pulls bytes from the provided IndexInput.
  • copyBytes
  • finish
  • getReverseReader
  • ramBytesUsed
  • reverse
    Reverse from srcPos, inclusive, to destPos, inclusive.
  • skipBytes
  • writeByte
    Absolute write byte; you must ensure dest is < max position written so far.
  • writeBytes
  • writeTo
    Writes all of our bytes to the target DataOutput.
  • writeVLong
  • getBlockBits
  • writeVLong,
  • getBlockBits,
  • getForwardReader,
  • truncate,
  • writeVInt

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Collectors (java.util.stream)
  • JButton (javax.swing)
  • JPanel (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now