Codota Logo
FileListCacheKey
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
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

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • onCreateOptionsMenu (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now