congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Finding current android device location
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • putExtra (Intent)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Option (scala)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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