congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DirectoryLoaderAdaptor.figureChunksNumber
Code IndexAdd Tabnine to your IDE (free)

How to use
figureChunksNumber
method
in
org.infinispan.lucene.cacheloader.DirectoryLoaderAdaptor

Best Java code snippets using org.infinispan.lucene.cacheloader.DirectoryLoaderAdaptor.figureChunksNumber (Showing top 10 results out of 315)

origin: org.infinispan/infinispan-embedded-query

/**
* Guess in how many chunks we should split this file. Should return the same value consistently
* for the same file (segments are immutable) so that a full segment can be rebuilt from the upper
* layers without anyone actually specifying the chunks numbers.
*/
private int figureChunksNumber(String fileName) throws IOException {
 long fileLength = directory.fileLength(fileName);
 return figureChunksNumber(fileName, fileLength, autoChunkSize);
}
origin: org.infinispan/infinispan-lucene-v3

/**
* Guess in how many chunks we should split this file. Should return the same value consistently
* for the same file (segments are immutable) so that a full segment can be rebuilt from the upper
* layers without anyone actually specifying the chunks numbers.
*/
private int figureChunksNumber(String fileName) throws IOException {
 long fileLength = directory.fileLength(fileName);
 return figureChunksNumber(fileName, fileLength, autoChunkSize);
}
origin: org.infinispan/infinispan-lucene-directory

/**
* Guess in how many chunks we should split this file. Should return the same value consistently
* for the same file (segments are immutable) so that a full segment can be rebuilt from the upper
* layers without anyone actually specifying the chunks numbers.
*/
private int figureChunksNumber(String fileName) throws IOException {
 long fileLength = directory.fileLength(fileName);
 return figureChunksNumber(fileName, fileLength, autoChunkSize);
}
origin: org.infinispan/infinispan-embedded-query

/**
* Index segment files might be larger than 2GB; so it's possible to have an autoChunksize
* which is too low to contain all bytes in a single array (overkill anyway).
* In this case we ramp up and try splitting with larger chunkSize values.
*/
public static int figureChunksNumber(final String fileName, final long fileLength, int chunkSize) {
 if (chunkSize < 0) {
   throw new IllegalStateException("Overflow in rescaling chunkSize. File way too large?");
 }
 final long numChunks = (fileLength % chunkSize == 0) ? (fileLength / chunkSize) : (fileLength / chunkSize) + 1;
 if (numChunks > Integer.MAX_VALUE) {
   log.rescalingChunksize(fileName, fileLength, chunkSize);
   chunkSize = 32 * chunkSize;
   return figureChunksNumber(fileName, fileLength, chunkSize);
 }
 else {
   return (int)numChunks;
 }
}
origin: org.infinispan/infinispan-lucene-v3

/**
* Index segment files might be larger than 2GB; so it's possible to have an autoChunksize
* which is too low to contain all bytes in a single array (overkill anyway).
* In this case we ramp up and try splitting with larger chunkSize values.
*/
private static int figureChunksNumber(final String fileName, final long fileLength, int chunkSize) {
 if (chunkSize < 0) {
   throw new IllegalStateException("Overflow in rescaling chunkSize. File way too large?");
 }
 final long numChunks = (fileLength / chunkSize);
 if (numChunks > Integer.MAX_VALUE) {
   log.rescalingChunksize(fileName, fileLength, chunkSize);
   chunkSize = 32 * chunkSize;
   return figureChunksNumber(fileName, fileLength, chunkSize);
 }
 else {
   return (int)numChunks;
 }
}
origin: org.infinispan/infinispan-lucene-directory

/**
* Index segment files might be larger than 2GB; so it's possible to have an autoChunksize
* which is too low to contain all bytes in a single array (overkill anyway).
* In this case we ramp up and try splitting with larger chunkSize values.
*/
public static int figureChunksNumber(final String fileName, final long fileLength, int chunkSize) {
 if (chunkSize < 0) {
   throw new IllegalStateException("Overflow in rescaling chunkSize. File way too large?");
 }
 final long numChunks = (fileLength % chunkSize == 0) ? (fileLength / chunkSize) : (fileLength / chunkSize) + 1;
 if (numChunks > Integer.MAX_VALUE) {
   log.rescalingChunksize(fileName, fileLength, chunkSize);
   chunkSize = 32 * chunkSize;
   return figureChunksNumber(fileName, fileLength, chunkSize);
 }
 else {
   return (int)numChunks;
 }
}
origin: org.infinispan/infinispan-lucene-directory

@Test
public void testRescalingMath() {
 Assert.assertEquals(DirectoryLoaderAdaptor.figureChunksNumber("", 0, 1), 0);
 Assert.assertEquals(DirectoryLoaderAdaptor.figureChunksNumber("", 1, 1), 1);
 Assert.assertEquals(DirectoryLoaderAdaptor.figureChunksNumber("", 2, 1), 2);
 int MB = 1024*1024;
 Assert.assertEquals(DirectoryLoaderAdaptor.figureChunksNumber("", 0, MB), 0);
 Assert.assertEquals(DirectoryLoaderAdaptor.figureChunksNumber("", 1, MB), 1);
 Assert.assertEquals(DirectoryLoaderAdaptor.figureChunksNumber("", 2, MB), 1);
 Assert.assertEquals(DirectoryLoaderAdaptor.figureChunksNumber("", MB, MB), 1);
 Assert.assertEquals(DirectoryLoaderAdaptor.figureChunksNumber("", MB+1, MB), 2);
 Assert.assertEquals(DirectoryLoaderAdaptor.figureChunksNumber("", MB+MB, MB), 2);
 Assert.assertEquals(DirectoryLoaderAdaptor.figureChunksNumber("", MB+MB+1, MB), 3);
}
origin: org.infinispan/infinispan-embedded-query

int numChunksInt = figureChunksNumber(fileName);
for (int i = 0; i < numChunksInt; i++) {
origin: org.infinispan/infinispan-lucene-directory

int numChunksInt = figureChunksNumber(fileName);
for (int i = 0; i < numChunksInt; i++) {
origin: org.infinispan/infinispan-lucene-v3

int numChunksInt = figureChunksNumber(fileName);
for (int i = 0; i < numChunksInt; i++) {
org.infinispan.lucene.cacheloaderDirectoryLoaderAdaptorfigureChunksNumber

Javadoc

Guess in how many chunks we should split this file. Should return the same value consistently for the same file (segments are immutable) so that a full segment can be rebuilt from the upper layers without anyone actually specifying the chunks numbers.

Popular methods of DirectoryLoaderAdaptor

  • <init>
    Create a new DirectoryLoaderAdaptor.
  • load
    Load the value for a specific key
  • close
    Closes the underlying Directory. After it's closed, no other invocations are expected on this Adapte
  • containsKey
  • containsKeyIntern
    ContainsKey implementation for chunk elements
  • loadAllEntries
    Loads all "entries" from the CacheLoader; considering this is actually a Lucene index, that's going
  • loadSomeKeys
    Load some keys in the collector, excluding some and to a maximum number of collected (non-excluded)

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • startActivity (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Runner (org.openjdk.jmh.runner)
  • Top 17 PhpStorm Plugins
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