public void setDiskDirsAndSize(File[] diskDirs, int[] sizes) { checkIfDirectoriesExist(diskDirs); this.diskDirs = diskDirs; if(sizes.length != this.diskDirs.length) { throw new IllegalArgumentException(LocalizedStrings.DiskStoreAttributesCreation_NUMBER_OF_DISKSIZES_IS_0_WHICH_IS_NOT_EQUAL_TO_NUMBER_OF_DISK_DIRS_WHICH_IS_1.toLocalizedString(new Object[] {Integer.valueOf(sizes.length), Integer.valueOf(diskDirs.length)})); } verifyNonNegativeDirSize(sizes); this.diskDirSizes = sizes; this.setHasDiskDirs(true); }
boolean found = false; for (int j = 0; j < array2.length; j++) { if (equal(array1[i].getAbsoluteFile(), array2[j].getAbsoluteFile())) { found = true;
protected void createDiskStore(DiskStoreAttributesCreation creation, GemFireCacheImpl cache) { // Don't let the DiskStoreAttributesCreation escape to the user DiskStoreFactory factory = cache.createDiskStoreFactory(creation); factory.create(creation.getName()); }
public void setDiskDirs(File[] diskDirs) { checkIfDirectoriesExist(diskDirs); this.diskDirs = diskDirs; this.diskDirSizes = new int[diskDirs.length]; for (int i = 0; i < diskDirs.length; i++) { this.diskDirSizes[i] = DiskStoreFactory.DEFAULT_DISK_DIR_SIZE; } setHasDiskDirs(true); }
DiskStoreAttributesCreation attrs = new DiskStoreAttributesCreation(); String name = atts.getValue(NAME); if (name == null) { attrs.setName(name); attrs.setAutoCompact(Boolean.valueOf(autoCompact).booleanValue()); attrs.setCompactionThreshold(parseInt(compactionThreshold)); attrs.setAllowForceCompaction(Boolean.valueOf(allowForceCompaction).booleanValue()); attrs.setMaxOplogSize(parseInt(maxOplogSize)); attrs.setTimeInterval(parseInt(timeInterval)); attrs.setWriteBufferSize(parseInt(writeBufferSize)); attrs.setQueueSize(parseInt(queueSize));
((DiskStoreAttributesCreation) ds).hasAutoCompact())) { if (generateDefaults() || ds.getAutoCompact() != DiskStoreFactory.DEFAULT_AUTO_COMPACT) atts.addAttribute("", "", AUTO_COMPACT, "", ((DiskStoreAttributesCreation) ds).hasAllowForceCompaction())) { if (generateDefaults() || ds.getAllowForceCompaction() != DiskStoreFactory.DEFAULT_ALLOW_FORCE_COMPACTION) atts.addAttribute("", "", ALLOW_FORCE_COMPACTION, "", ((DiskStoreAttributesCreation) ds).hasCompactionThreshold())) { if (generateDefaults() || ds.getCompactionThreshold() != DiskStoreFactory.DEFAULT_COMPACTION_THRESHOLD) atts.addAttribute("", "", COMPACTION_THRESHOLD, "", ((DiskStoreAttributesCreation) ds).hasMaxOplogSize())) { if (generateDefaults() || ds.getMaxOplogSize() != DiskStoreFactory.DEFAULT_MAX_OPLOG_SIZE) atts.addAttribute("", "", MAX_OPLOG_SIZE, "", ((DiskStoreAttributesCreation) ds).hasTimeInterval())) { if (generateDefaults() || ds.getTimeInterval() != DiskStoreFactory.DEFAULT_TIME_INTERVAL) atts.addAttribute("", "", TIME_INTERVAL, "", ((DiskStoreAttributesCreation) ds).hasWriteBufferSize())) { if (generateDefaults() || ds.getWriteBufferSize() != DiskStoreFactory.DEFAULT_WRITE_BUFFER_SIZE) atts.addAttribute("", "", WRITE_BUFFER_SIZE, "", ((DiskStoreAttributesCreation) ds).hasQueueSize())) { if (generateDefaults() || ds.getQueueSize() != DiskStoreFactory.DEFAULT_QUEUE_SIZE) atts.addAttribute("", "", QUEUE_SIZE, "", ((DiskStoreAttributesCreation) ds).hasDiskDirs())) {
String name = dsac.getName(); DiskStore ds = other.findDiskStore(name); if (ds == null) { throw new RuntimeException(LocalizedStrings.CacheCreation_DISKSTORE_NOTFOUND_0.toLocalizedString(name)); } else { if (!dsac.sameAs(ds)) { getLogger().fine("Attributes for disk store " + name + " do not match"); throw new RuntimeException(LocalizedStrings.CacheCreation_ATTRIBUTES_FOR_DISKSTORE_0_DO_NOT_MATCH.toLocalizedString(name));
throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_QUEUESIZE_OF_0_IS_NOT_THE_SAME_THIS_1_OTHER_2.toLocalizedString(new Object[] {name, this.queueSize, other.getQueueSize()})); if (! equal(this.diskDirs, other.getDiskDirs())) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_DISK_DIRS_OF_0_ARE_NOT_THE_SAME.toLocalizedString(name)); if (! equal(this.diskDirSizes, other.getDiskDirSizes())) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_DISK_DIR_SIZES_OF_0_ARE_NOT_THE_SAME.toLocalizedString(name)); if (! equal(getDiskUsageWarningPercentage(), other.getDiskUsageWarningPercentage())) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_DISK_USAGE_WARN_ARE_NOT_THE_SAME.toLocalizedString(name)); if (! equal(getDiskUsageCriticalPercentage(), other.getDiskUsageCriticalPercentage())) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_DISK_USAGE_CRITICAL_ARE_NOT_THE_SAME.toLocalizedString(name));
throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_ALLOWFORCECOMPACTION_OF_0_IS_NOT_THE_SAME_THIS_1_OTHER_2.toLocalizedString(new Object[] {name, this.allowForceCompaction, other.getAllowForceCompaction()})); if (this.getMaxOplogSizeInBytes() != other.getMaxOplogSize()*1024*1024) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_MAXOPLOGSIZE_OF_0_IS_NOT_THE_SAME_THIS_1_OTHER_2.toLocalizedString(new Object[] {name, getMaxOplogSizeInBytes()/(1024*1024), other.getMaxOplogSize()})); throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_QUEUESIZE_OF_0_IS_NOT_THE_SAME_THIS_1_OTHER_2.toLocalizedString(new Object[] {name, this.queueSize, other.getQueueSize()})); if (! equal(this.diskDirs, other.getDiskDirs())) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_DISK_DIRS_OF_0_ARE_NOT_THE_SAME.toLocalizedString(name)); if (! equal(this.diskDirSizes, other.getDiskDirSizes())) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_DISK_DIR_SIZES_OF_0_ARE_NOT_THE_SAME.toLocalizedString(name));
result = new DiskStoreAttributesCreation(this.attrs); creation.addDiskStore(result);
DiskStoreAttributesCreation attrs = new DiskStoreAttributesCreation(); String name = atts.getValue(NAME); if (name == null) { attrs.setName(name); attrs.setAutoCompact(Boolean.valueOf(autoCompact).booleanValue()); attrs.setCompactionThreshold(parseInt(compactionThreshold)); attrs.setAllowForceCompaction(Boolean.valueOf(allowForceCompaction).booleanValue()); attrs.setMaxOplogSize(parseInt(maxOplogSize)); attrs.setTimeInterval(parseInt(timeInterval)); attrs.setWriteBufferSize(parseInt(writeBufferSize)); attrs.setQueueSize(parseInt(queueSize)); attrs.setDiskUsageWarningPercentage(parseFloat(warnPct)); attrs.setDiskUsageCriticalPercentage(parseFloat(criticalPct));
((DiskStoreAttributesCreation) ds).hasAutoCompact())) { if (generateDefaults() || ds.getAutoCompact() != DiskStoreFactory.DEFAULT_AUTO_COMPACT) atts.addAttribute("", "", AUTO_COMPACT, "", ((DiskStoreAttributesCreation) ds).hasAllowForceCompaction())) { if (generateDefaults() || ds.getAllowForceCompaction() != DiskStoreFactory.DEFAULT_ALLOW_FORCE_COMPACTION) atts.addAttribute("", "", ALLOW_FORCE_COMPACTION, "", ((DiskStoreAttributesCreation) ds).hasCompactionThreshold())) { if (generateDefaults() || ds.getCompactionThreshold() != DiskStoreFactory.DEFAULT_COMPACTION_THRESHOLD) atts.addAttribute("", "", COMPACTION_THRESHOLD, "", ((DiskStoreAttributesCreation) ds).hasMaxOplogSize())) { if (generateDefaults() || ds.getMaxOplogSize() != DiskStoreFactory.DEFAULT_MAX_OPLOG_SIZE) atts.addAttribute("", "", MAX_OPLOG_SIZE, "", ((DiskStoreAttributesCreation) ds).hasTimeInterval())) { if (generateDefaults() || ds.getTimeInterval() != DiskStoreFactory.DEFAULT_TIME_INTERVAL) atts.addAttribute("", "", TIME_INTERVAL, "", ((DiskStoreAttributesCreation) ds).hasWriteBufferSize())) { if (generateDefaults() || ds.getWriteBufferSize() != DiskStoreFactory.DEFAULT_WRITE_BUFFER_SIZE) atts.addAttribute("", "", WRITE_BUFFER_SIZE, "", ((DiskStoreAttributesCreation) ds).hasQueueSize())) { if (generateDefaults() || ds.getQueueSize() != DiskStoreFactory.DEFAULT_QUEUE_SIZE) atts.addAttribute("", "", QUEUE_SIZE, "", ((DiskStoreAttributesCreation) ds).hasDiskUsageWarningPercentage())) {
public void setDiskDirs(File[] diskDirs) { checkIfDirectoriesExist(diskDirs); this.diskDirs = diskDirs; this.diskDirSizes = new int[diskDirs.length]; for (int i = 0; i < diskDirs.length; i++) { this.diskDirSizes[i] = DiskStoreFactory.DEFAULT_DISK_DIR_SIZE; } setHasDiskDirs(true); }
String name = dsac.getName(); DiskStore ds = other.findDiskStore(name); if (ds == null) { throw new RuntimeException(LocalizedStrings.CacheCreation_DISKSTORE_NOTFOUND_0.toLocalizedString(name)); } else { if (!dsac.sameAs(ds)) { getLogger().fine("Attributes for disk store " + name + " do not match"); throw new RuntimeException(LocalizedStrings.CacheCreation_ATTRIBUTES_FOR_DISKSTORE_0_DO_NOT_MATCH.toLocalizedString(name));
result = new DiskStoreAttributesCreation(this.attrs); creation.addDiskStore(result);
public void setDiskDirsAndSize(File[] diskDirs, int[] sizes) { checkIfDirectoriesExist(diskDirs); this.diskDirs = diskDirs; if(sizes.length != this.diskDirs.length) { throw new IllegalArgumentException(LocalizedStrings.DiskStoreAttributesCreation_NUMBER_OF_DISKSIZES_IS_0_WHICH_IS_NOT_EQUAL_TO_NUMBER_OF_DISK_DIRS_WHICH_IS_1.toLocalizedString(new Object[] {Integer.valueOf(sizes.length), Integer.valueOf(diskDirs.length)})); } verifyNonNegativeDirSize(sizes); this.diskDirSizes = sizes; this.setHasDiskDirs(true); }
protected void createDiskStore(DiskStoreAttributesCreation creation, GemFireCacheImpl cache) { // Don't let the DiskStoreAttributesCreation escape to the user DiskStoreFactory factory = cache.createDiskStoreFactory(creation); factory.create(creation.getName()); }
boolean found = false; for (int j = 0; j < array2.length; j++) { if (equal(array1[i].getAbsoluteFile(), array2[j].getAbsoluteFile())) { found = true;
/** * After popping the current <code>DiskStoreAttributesCreation</code> off the * stack, we add it to the <code>DiskStoreAttionCreation</code> that should be on the * top of the stack. */ private void endDiskStore() { DiskStoreAttributesCreation dsac = (DiskStoreAttributesCreation) stack.pop(); CacheCreation cache; Object top = stack.peek(); if (top instanceof CacheCreation) { cache = (CacheCreation) top; } else { String s = "Did not expected a " + top.getClass().getName() + " on top of the stack."; Assert.assertTrue(false, s); cache = null; // Dead code } String name = dsac.getName(); if (name != null) { cache.setDiskStore(name, dsac); } }
/** * After popping the current <code>DiskStoreAttributesCreation</code> off the * stack, we add it to the <code>DiskStoreAttionCreation</code> that should be on the * top of the stack. */ private void endDiskStore() { DiskStoreAttributesCreation dsac = (DiskStoreAttributesCreation) stack.pop(); CacheCreation cache; Object top = stack.peek(); if (top instanceof CacheCreation) { cache = (CacheCreation) top; } else { String s = "Did not expected a " + top.getClass().getName() + " on top of the stack."; Assert.assertTrue(false, s); cache = null; // Dead code } String name = dsac.getName(); if (name != null) { cache.setDiskStore(name, dsac); } }