public static <K, V> PartitionedRegionBridge<K, V> getInstance(Region<K, V> region) { if (region.getAttributes().getDataPolicy().withHDFS()) { PartitionedRegionBridge<K, V> bridge = new HDFSRegionBridge<K, V>(region); return bridge; } else { return new PartitionedRegionBridge<K, V> (region); } }
public static <K, V> PartitionedRegionBridge<K, V> getInstance(Region<K, V> region) { if (region.getAttributes().getDataPolicy().withHDFS()) { PartitionedRegionBridge<K, V> bridge = new HDFSRegionBridge<K, V>(region); return bridge; } else { return new PartitionedRegionBridge<K, V> (region); } }
public boolean isCustomEvictionEnabled() { return getRegion().getDataPolicy().withHDFS() && (getRegion().getAttributes().getCustomEvictionAttributes() != null); }
public boolean isCustomEvictionEnabled() { return getRegion().getDataPolicy().withHDFS() && (getRegion().getAttributes().getCustomEvictionAttributes() != null); }
public boolean isCustomEvictionEnabled() { return getRegion().getDataPolicy().withHDFS() && (getRegion().getAttributes().getCustomEvictionAttributes() != null); }
protected String getHDFSEventQueueName() { if (!this.getDataPolicy().withHDFS()) return null; String colocatedWith = this.getPartitionAttributes().getColocatedWith(); String eventQueueName; if (colocatedWith != null) { PartitionedRegion leader = ColocationHelper.getLeaderRegionName(this); eventQueueName = HDFSStoreFactoryImpl.getEventQueueName(leader .getFullPath()); } else { eventQueueName = HDFSStoreFactoryImpl.getEventQueueName(getFullPath()); } return eventQueueName; }
protected String getHDFSEventQueueName() { if (!this.getDataPolicy().withHDFS()) return null; String colocatedWith = this.getPartitionAttributes().getColocatedWith(); String eventQueueName; if (colocatedWith != null) { PartitionedRegion leader = ColocationHelper.getLeaderRegionName(this); eventQueueName = HDFSStoreFactoryImpl.getEventQueueName(leader .getFullPath()); } else { eventQueueName = HDFSStoreFactoryImpl.getEventQueueName(getFullPath()); } return eventQueueName; }
public static void createAndAddAsyncQueue(String regionPath, RegionAttributes regionAttributes, Cache cache) { if (!regionAttributes.getDataPolicy().withHDFS()) { return; } String leaderRegionPath = getLeaderRegionPath(regionPath, regionAttributes, cache); String defaultAsyncQueueName = HDFSStoreFactoryImpl.getEventQueueName(leaderRegionPath); if (cache.getAsyncEventQueue(defaultAsyncQueueName) == null) { if (regionAttributes.getHDFSStoreName() != null && regionAttributes.getPartitionAttributes() != null && !(regionAttributes.getPartitionAttributes().getLocalMaxMemory() == 0)) { HDFSStore store = ((GemFireCacheImpl) cache).findHDFSStore(regionAttributes.getHDFSStoreName()); if (store == null) { throw new IllegalStateException( LocalizedStrings.HOPLOG_HDFS_STORE_NOT_FOUND.toLocalizedString(regionAttributes.getHDFSStoreName())); } HDFSIntegrationUtil .createAsyncQueueForHDFS(cache, leaderRegionPath, regionAttributes.getHDFSWriteOnly(), store); } } }
/** Hydra task to validate the PR * */ public static void HydraTask_validatePR() { PdxTest.initClassLoader(); Log.getLogWriter().info(testInstance.aRegion.getFullPath() + " size is " + testInstance.aRegion.size() + " isDataStore " + testInstance.isDataStore); if (testInstance.isDataStore && (testInstance.aRegion.size() == 0)) { // this ensures that recovery did recover something // with HDFS tests we cannot guarantee that we haven't evicted the entire PR if (!testInstance.aRegion.getAttributes().getDataPolicy().withHDFS()) { throw new TestException("Expected " + testInstance.aRegion.getFullPath() + " to have a size > 0, but it has size " + testInstance.aRegion.size()); } } testInstance.verifyFromSnapshot(); }
@Override public void destroyRegion(Object aCallbackArgument) throws CacheWriterException, TimeoutException { //For HDFS regions, we need a data store //to do the global destroy so that it can delete //the data from HDFS as well. if(!isDataStore() && this.dataPolicy.withHDFS()) { if(destroyOnDataStore(aCallbackArgument)) { //If we were able to find a data store to do the destroy, //stop here. //otherwise go ahead and destroy the region from this member return; } } checkForColocatedChildren(); getDataView().checkSupportsRegionDestroy(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()); basicDestroyRegion(event, true); }
if ((aRegion.getAttributes().getDataPolicy().withHDFS()) && withEviction) { writeHDFSRegionSnapshotToBB(); return;
if (diskStoreName == null && attr.getDataPolicy().withHDFS()) { String hdfsStoreName = attr.getHDFSStoreName(); diskStoreName = HDFSStoreHelper.getHDFSStoreDescription(hdfsStoreName).getDiskStoreDescription().getName();
public static void createAndAddAsyncQueue(String regionPath, RegionAttributes regionAttributes, Cache cache) { if(!regionAttributes.getDataPolicy().withHDFS()) { return; } String leaderRegionPath = getLeaderRegionPath(regionPath, regionAttributes, cache); String defaultAsyncQueueName = HDFSStoreFactoryImpl.getEventQueueName(leaderRegionPath); if (cache.getAsyncEventQueue(defaultAsyncQueueName) == null) { if (regionAttributes.getHDFSStoreName() != null && regionAttributes.getPartitionAttributes() != null && !(regionAttributes.getPartitionAttributes().getLocalMaxMemory() == 0)) { HDFSStore store = cache.findHDFSStore(regionAttributes.getHDFSStoreName()); if (store == null) { throw new IllegalStateException( LocalizedStrings.HOPLOG_HDFS_STORE_NOT_FOUND .toLocalizedString(regionAttributes.getHDFSStoreName())); } HDFSEventQueueAttributes queueAttrs = store.getHDFSEventQueueAttributes(); if(queueAttrs == null) { // no async queue is specified for region with a HDFS store. Create a async queue with default // properties and set the bucketsorted=true. HDFSIntegrationUtil.createDefaultAsyncQueueForHDFS(cache, regionAttributes.getHDFSWriteOnly(), leaderRegionPath); } else { HDFSIntegrationUtil.createAsyncQueueForHDFS(cache, leaderRegionPath, regionAttributes.getHDFSWriteOnly(), queueAttrs); } } } }
private boolean isGlobalIndexRequiredForHDFS(TableDescriptor td) throws StandardException { GemFireContainer baseContainer = Misc.getMemStoreBooting().getContainer( ContainerKey.valueOf(ContainerHandle.TABLE_SEGMENT, td.getHeapConglomerateId())); RegionAttributes<?, ?> rattrs = baseContainer.getRegionAttributes(); if (rattrs.getDataPolicy().withHDFS()) { LogWriterI18n log = InternalDistributedSystem.getLoggerI18n(); boolean skip = rattrs.getCustomEvictionAttributes() == null && td.getDistributionDescriptor().getPersistence() && Version.GFXD_13.compareTo(GemFireXDUtils.getCurrentDDLVersion()) < 0; if (log.fineEnabled() && skip) { log.fine("Creating local index instead of global index for table " + td.getName()); } return !skip; } return false; }
private boolean isGlobalIndexRequiredForHDFS(TableDescriptor td) throws StandardException { GemFireContainer baseContainer = Misc.getMemStoreBooting().getContainer( ContainerKey.valueOf(ContainerHandle.TABLE_SEGMENT, td.getHeapConglomerateId())); RegionAttributes<?, ?> rattrs = baseContainer.getRegionAttributes(); if (rattrs.getDataPolicy().withHDFS()) { LogWriterI18n log = InternalDistributedSystem.getLoggerI18n(); boolean skip = rattrs.getCustomEvictionAttributes() == null && td.getDistributionDescriptor().getPersistence() && Version.GFXD_13.compareTo(GemFireXDUtils.getCurrentDDLVersion()) < 0; if (log.fineEnabled() && skip) { log.fine("Creating local index instead of global index for table " + td.getName()); } return !skip; } return false; }
private boolean isGlobalIndexRequiredForHDFS(TableDescriptor td) throws StandardException { GemFireContainer baseContainer = Misc.getMemStoreBooting().getContainer( ContainerKey.valueOf(ContainerHandle.TABLE_SEGMENT, td.getHeapConglomerateId())); RegionAttributes<?, ?> rattrs = baseContainer.getRegionAttributes(); if (rattrs.getDataPolicy().withHDFS()) { LogWriterI18n log = InternalDistributedSystem.getLoggerI18n(); boolean skip = rattrs.getCustomEvictionAttributes() == null && td.getDistributionDescriptor().getPersistence() && Version.GFXD_13.compareTo(GemFireXDUtils.getCurrentDDLVersion()) < 0; if (log.fineEnabled() && skip) { log.fine("Creating local index instead of global index for table " + td.getName()); } return !skip; } return false; }
return ra; if (attrs.getDataPolicy().withHDFS() || attrs.getHDFSStoreName() != null) {
return ra; if (attrs.getDataPolicy().withHDFS() || attrs.getHDFSStoreName() != null) {
if (ra.getDataPolicy().withHDFS()) { LogWriterI18n log = InternalDistributedSystem.getLoggerI18n();
if (ra.getDataPolicy().withHDFS()) { LogWriterI18n log = InternalDistributedSystem.getLoggerI18n();