private String getLockName(final BucketRegion fileAndChunkBucket) { return FILE_REGION_LOCK_FOR_BUCKET_ID + fileAndChunkBucket.getFullPath(); }
@Override public String toString() { return new StringBuilder().append("BucketRegion").append("[path='").append(getFullPath()) .append(";serial=").append(getSerialNumber()).append(";primary=") .append(getBucketAdvisor().getProxyBucketRegion().isPrimary()).append("]").toString(); }
Map usedIndexes = indexObserver.getUsedIndexes(bucket.getFullPath()); StringBuilder sb = new StringBuilder(); sb.append(" indexesUsed(");
@Override public void checkReadiness() { super.checkReadiness(); if (isDestroyed()) { throw new RegionDestroyedException(toString(), getFullPath()); } }
protected BucketRegion setUpMockBucket(int id) throws BucketNotFoundException { BucketRegion mockBucket = Mockito.mock(BucketRegion.class); BucketRegion fileAndChunkBucket = Mockito.mock(BucketRegion.class); // Allowing the fileAndChunkBucket to behave like a map so that the IndexWriter operations don't // fail Fakes.addMapBehavior(fileAndChunkBucket); when(fileAndChunkBucket.getFullPath()).thenReturn("File" + id); when(mockBucket.getId()).thenReturn(id); when(userRegion.getBucketRegion(eq(id), eq(null))).thenReturn(mockBucket); when(userDataStore.getLocalBucketById(eq(id))).thenReturn(mockBucket); when(userRegion.getBucketRegion(eq(id + 113), eq(null))).thenReturn(mockBucket); when(userDataStore.getLocalBucketById(eq(id + 113))).thenReturn(mockBucket); when(fileDataStore.getLocalBucketById(eq(id))).thenReturn(fileAndChunkBucket); fileAndChunkBuckets.put(id, fileAndChunkBucket); dataBuckets.put(id, mockBucket); BucketAdvisor mockBucketAdvisor = Mockito.mock(BucketAdvisor.class); when(fileAndChunkBucket.getBucketAdvisor()).thenReturn(mockBucketAdvisor); when(mockBucketAdvisor.isPrimary()).thenReturn(true); return mockBucket; } }
this.cache.getRegion(this.bukRgn.getFullPath()), false);
logger.debug("cleanup: Locally destroyed bucket {}", buk.getFullPath());
if (logger.isDebugEnabled()) { logger.debug("sendReply: acquireDestroyLock failed due to cache closure, region = {}", map.getFullPath());
} catch (IOException e) { logger.info("Exception thrown while constructing Lucene Index for bucket:" + bucketId + " for file region:" + fileAndChunkBucket.getFullPath()); throw e; } catch (CacheClosedException e) { logger.info("CacheClosedException thrown while constructing Lucene Index for bucket:" + bucketId + " for file region:" + fileAndChunkBucket.getFullPath()); throw e; } finally {
/** * Returns the index for the bucket. */ public static AbstractIndex getBucketIndex(PartitionedRegion pr, String indexName, Integer bId) throws QueryInvocationTargetException { try { pr.checkReadiness(); } catch (Exception ex) { throw new QueryInvocationTargetException(ex.getMessage()); } PartitionedRegionDataStore prds = pr.getDataStore(); BucketRegion bukRegion; bukRegion = (BucketRegion) prds.getLocalBucketById(bId); if (bukRegion == null) { throw new BucketMovedException("Bucket not found for the id :" + bId); } AbstractIndex index = null; if (bukRegion.getIndexManager() != null) { index = (AbstractIndex) (bukRegion.getIndexManager().getIndex(indexName)); } else { if (pr.getCache().getLogger().fineEnabled()) { pr.getCache().getLogger().fine("Index Manager not found for the bucket region " + bukRegion.getFullPath() + " unable to fetch the index " + indexName); } throw new QueryInvocationTargetException( "Index Manager not found, " + " unable to fetch the index " + indexName); } return index; }
if (store != null) { for (BucketRegion bucket : store.getAllLocalBucketRegions()) { RegionLogger.logDestroy(bucket.getFullPath(), getMyId(), bucket.getPersistentID(), true);
.fine("Verifying index presence on bucket region. " + " Found index " + this.indexName + " not present on the bucket region " + bukRegion.getFullPath() + ", index will be created on this region.");