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

How to use
FileListCacheKey
in
org.infinispan.lucene

Best Java code snippets using org.infinispan.lucene.FileListCacheKey (Showing top 20 results out of 315)

origin: org.infinispan/infinispan-lucene-v3

@Override
public FileListCacheKey readObject(final ObjectInput input) throws IOException {
  String indexName = input.readUTF();
  return new FileListCacheKey(indexName);
}
origin: org.infinispan/infinispan-lucene-directory

public FileListCacheKey(String indexName, final int affinitySegmentId) {
 this.indexName = indexName;
 this.affinitySegmentId = affinitySegmentId;
 this.hashCode = generatedHashCode();
}
origin: org.infinispan/infinispan-lucene-directory

@Test
public void testFileListCacheKeyComparison() {
 AssertJUnit.assertFalse("The instance of FileListCacheKey should not be equal to null.", new FileListCacheKey("index-A", -1).equals(null));
 AssertJUnit.assertFalse("The instance of FileListCacheKey should not be equal to FileCacheKey instance.", new FileListCacheKey("index-A", -1).equals(new FileCacheKey("index-A", "test.txt", -1)));
}
origin: org.infinispan/infinispan-lucene-directory

@Override
public FileListCacheKey readObject(final ObjectInput input) throws IOException {
  final String indexName = input.readUTF();
  final int affinitySegmentId = UnsignedNumeric.readUnsignedInt(input);
  return new FileListCacheKey(indexName, affinitySegmentId);
}
origin: org.infinispan/infinispan-embedded-query

public FileListCacheKey(String indexName, final int affinitySegmentId) {
 this.indexName = indexName;
 this.affinitySegmentId = affinitySegmentId;
 this.hashCode = generatedHashCode();
}
origin: org.infinispan/infinispan-embedded-query

@Override
public FileListCacheKey readObject(final ObjectInput input) throws IOException {
  final String indexName = input.readUTF();
  final int affinitySegmentId = UnsignedNumeric.readUnsignedInt(input);
  return new FileListCacheKey(indexName, affinitySegmentId);
}
origin: org.infinispan/infinispan-lucene-v3

public FileListCacheKey(String indexName) {
 this.indexName = indexName;
 this.hashCode = generatedHashCode();
}
origin: org.infinispan/infinispan-lucene-directory

@SuppressWarnings("unchecked")
public FileListOperations(AdvancedCache<?, ?> cache, String indexName, boolean writeAsync, int affinitySegmentId) {
 this.writeAsync = writeAsync;
 this.affinitySegmentId = affinitySegmentId;
 this.cache = (AdvancedCache<FileListCacheKey, Object>) cache;
 this.cacheNoRetrieve = (AdvancedCache<FileListCacheKey, FileListCacheValue>) cache.withFlags(Flag.IGNORE_RETURN_VALUES);
 this.indexName = indexName;
 this.fileListCacheKey = new FileListCacheKey(indexName, affinitySegmentId);
 ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
 readLock = lock.readLock();
 writeLock = lock.writeLock();
}
origin: org.infinispan/infinispan-embedded-query

@SuppressWarnings("unchecked")
public FileListOperations(AdvancedCache<?, ?> cache, String indexName, boolean writeAsync, int affinitySegmentId) {
 this.writeAsync = writeAsync;
 this.affinitySegmentId = affinitySegmentId;
 this.cache = (AdvancedCache<FileListCacheKey, Object>) cache;
 this.cacheNoRetrieve = (AdvancedCache<FileListCacheKey, FileListCacheValue>) cache.withFlags(Flag.IGNORE_RETURN_VALUES);
 this.indexName = indexName;
 this.fileListCacheKey = new FileListCacheKey(indexName, affinitySegmentId);
 ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
 readLock = lock.readLock();
 writeLock = lock.writeLock();
}
origin: org.infinispan/infinispan-lucene-v3

public FileListOperations(AdvancedCache<?, ?> cache, String indexName){
 this.cache = (AdvancedCache<FileListCacheKey, Object>) cache;
 this.cacheNoRetrieve = (AdvancedCache<FileListCacheKey, Set<String>>) cache.withFlags(Flag.IGNORE_RETURN_VALUES);
 this.indexName = indexName;
 this.fileListCacheKey = new FileListCacheKey(indexName);
}
origin: org.infinispan/infinispan-lucene-directory

@Test
public void testFileListCacheKeyExternalizer() throws IOException {
 FileListCacheKey key = new FileListCacheKey("myIndex", 7);
 verifyExternalizerForType(key, FileListCacheKey.Externalizer.class);
}
origin: org.infinispan/infinispan-lucene-directory

FileListCacheKey rootKey = new FileListCacheKey(indexName, affinitySegmentId);
if (keysToExclude == null || !keysToExclude.contains(rootKey)) { //unless it was excluded
  if (keysCollector.add(rootKey)) { //unless it was already collected
origin: org.infinispan/infinispan-lucene-v3

FileListCacheKey rootKey = new FileListCacheKey(indexName);
if (keysToExclude==null || ! keysToExclude.contains(rootKey)) { //unless it was excluded
  if (keysCollector.add(rootKey) ) { //unless it was already collected
origin: org.infinispan/infinispan-embedded-query

FileListCacheKey rootKey = new FileListCacheKey(indexName, affinitySegmentId);
if (keysToExclude == null || !keysToExclude.contains(rootKey)) { //unless it was excluded
  if (keysCollector.add(rootKey)) { //unless it was already collected
origin: org.infinispan/infinispan-lucene-directory

@Test
public void loadFileListCacheKey() {
 AssertJUnit.assertEquals(new FileListCacheKey("", -1), mapper.getKeyMapping("*||-1"));
 AssertJUnit.assertEquals(new FileListCacheKey("the leaves of Amazonia", -1), mapper.getKeyMapping("*|the leaves of Amazonia|-1"));
}
origin: org.infinispan/infinispan-lucene-v3

return new FileListCacheKey(key.substring(2));
origin: org.infinispan/infinispan-lucene-directory

public void testLoadAllKeysWithExclusionOfRootKey() throws Exception {
 TestHelper.createIndex(rootDir, indexName, elementCount, true);
 LuceneCacheLoader cacheLoader = (LuceneCacheLoader) TestingUtil.getFirstLoader(cacheManager.getCache());
 Set keySet = PersistenceUtil.toKeySet(cacheLoader, null);
 int initialCount = keySet.size();
 HashSet exclusionSet = new HashSet();
 exclusionSet.add(new FileListCacheKey(indexName, segmentId));
 keySet = PersistenceUtil.toKeySet(cacheLoader, k -> !exclusionSet.contains(k));
 String[] fileNamesArr = TestHelper.getFileNamesFromDir(rootDir, indexName);
 AssertJUnit.assertEquals((initialCount - 1), keySet.size());
 Iterator it = keySet.iterator();
 while (it.hasNext()) {
   assert !(it.next() instanceof FileListCacheKey);
 }
}
origin: org.infinispan/infinispan-lucene-directory

final String indexName = split[1];
final int affinitySegmentId = toInt(split[2], key);
return new FileListCacheKey(indexName, affinitySegmentId);
origin: org.infinispan/infinispan-embedded-query

final String indexName = split[1];
final int affinitySegmentId = toInt(split[2], key);
return new FileListCacheKey(indexName, affinitySegmentId);
origin: org.infinispan/infinispan-lucene-directory

public static void assertFileNotExists(Cache cache, String indexName, String fileName, long maxWaitForCondition, int affinitySegmentId) throws InterruptedException {
 FileListCacheValue fileList = (FileListCacheValue) cache.get(new FileListCacheKey(indexName, affinitySegmentId));
 AssertJUnit.assertNotNull(fileList);
 AssertJUnit.assertFalse(fileList.contains(fileName)); //check is in sync: no waiting allowed in this case
 boolean allok = false;
 while (maxWaitForCondition >= 0 && !allok) {
   Thread.sleep(10);
   maxWaitForCondition -= 10;
   allok=true;
   FileMetadata metadata = (FileMetadata) cache.get(new FileCacheKey(indexName, fileName, affinitySegmentId));
   if (metadata!=null) allok=false;
   for (int i = 0; i < 100; i++) {
    //bufferSize set to 0 as metadata might not be available, and it's not part of equals/hashcode anyway.
    ChunkCacheKey key = new ChunkCacheKey(indexName, fileName, i, 0, affinitySegmentId);
    if (cache.get(key)!=null) allok=false;
   }
 }
 assertTrue(allok);
}
org.infinispan.luceneFileListCacheKey

Javadoc

Cache key for a list with current files in cache

Most used methods

  • <init>
  • generatedHashCode
  • equals

Popular in Java

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Collectors (java.util.stream)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top 12 Jupyter Notebook Extensions
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