public DiskStoreFactory setDiskDirsAndSizes(File[] diskDirs,int[] diskDirSizes) { if (diskDirSizes.length != diskDirs.length) { throw new IllegalArgumentException(LocalizedStrings.AttributesFactory_NUMBER_OF_DISKSIZES_IS_0_WHICH_IS_NOT_EQUAL_TO_NUMBER_OF_DISK_DIRS_WHICH_IS_1.toLocalizedString(new Object[] {Integer.valueOf(diskDirSizes.length), Integer.valueOf(diskDirs.length)})); } verifyNonNegativeDirSize(diskDirSizes); checkIfDirectoriesExist(diskDirs); this.attrs.diskDirs = new File[diskDirs.length]; System.arraycopy(diskDirs, 0, this.attrs.diskDirs, 0, diskDirs.length); this.attrs.diskDirSizes = new int[diskDirSizes.length]; System.arraycopy(diskDirSizes, 0, this.attrs.diskDirSizes, 0, diskDirSizes.length); return this; }
public DiskStoreFactory setDiskDirsAndSizes(File[] diskDirs,int[] diskDirSizes) { checkIfDirectoriesExist(diskDirs); if (diskDirSizes.length != diskDirs.length) { throw new IllegalArgumentException(LocalizedStrings.AttributesFactory_NUMBER_OF_DISKSIZES_IS_0_WHICH_IS_NOT_EQUAL_TO_NUMBER_OF_DISK_DIRS_WHICH_IS_1.toLocalizedString(new Object[] {Integer.valueOf(diskDirSizes.length), Integer.valueOf(diskDirs.length)})); } checkIfDirectoriesExist(diskDirs); verifyNonNegativeDirSize(diskDirSizes); this.attrs.diskDirs = new File[diskDirs.length]; System.arraycopy(diskDirs, 0, this.attrs.diskDirs, 0, diskDirs.length); this.attrs.diskDirSizes = new int[diskDirSizes.length]; System.arraycopy(diskDirSizes, 0, this.attrs.diskDirSizes, 0, diskDirSizes.length); return this; }
/** * Sets the directories to which the region's data is written and also set their sizes in megabytes * * @throws IllegalArgumentException if a dir does not exist or the length of the size array * does not match to the length of the dir array or the given length is not a valid positive number * * @since 5.1 * @deprecated as of 6.5 use {@link DiskStoreFactory#setDiskDirsAndSizes} instead */ @Deprecated public void setDiskDirsAndSizes(File[] diskDirs,int[] diskSizes) { if (this.regionAttributes.getDiskStoreName() != null) { throw new IllegalStateException(LocalizedStrings.DiskStore_Deprecated_API_0_Cannot_Mix_With_DiskStore_1 .toLocalizedString(new Object[] {"setDiskDirsAndSizes", this.regionAttributes.getDiskStoreName()})); } DiskStoreFactoryImpl.checkIfDirectoriesExist(diskDirs); this.regionAttributes.diskDirs = diskDirs; if(diskSizes.length != this.regionAttributes.diskDirs.length) { throw new IllegalArgumentException(LocalizedStrings.AttributesFactory_NUMBER_OF_DISKSIZES_IS_0_WHICH_IS_NOT_EQUAL_TO_NUMBER_OF_DISK_DIRS_WHICH_IS_1.toLocalizedString(new Object[] {Integer.valueOf(diskSizes.length), Integer.valueOf(diskDirs.length)})); } DiskStoreFactoryImpl.verifyNonNegativeDirSize(diskSizes); this.regionAttributes.diskSizes = diskSizes; if (!this.regionAttributes.hasDiskWriteAttributes() && !this.regionAttributes.hasDiskSynchronous()) { // switch to the old default this.regionAttributes.diskSynchronous = false; this.regionAttributes.diskWriteAttributes = DiskWriteAttributesImpl.getDefaultAsyncInstance(); } this.regionAttributes.setHasDiskDirs(true); }
/** * Sets the directories to which the region's data is written and also set their sizes in megabytes * * @throws IllegalArgumentException if a dir does not exist or the length of the size array * does not match to the length of the dir array or the given length is not a valid positive number * * @since 5.1 * @deprecated as of 6.5 use {@link DiskStoreFactory#setDiskDirsAndSizes} instead */ @Deprecated public void setDiskDirsAndSizes(File[] diskDirs,int[] diskSizes) { if (this.regionAttributes.getDiskStoreName() != null) { throw new IllegalStateException(LocalizedStrings.DiskStore_Deprecated_API_0_Cannot_Mix_With_DiskStore_1 .toLocalizedString(new Object[] {"setDiskDirsAndSizes", this.regionAttributes.getDiskStoreName()})); } DiskStoreFactoryImpl.checkIfDirectoriesExist(diskDirs); this.regionAttributes.diskDirs = diskDirs; if(diskSizes.length != this.regionAttributes.diskDirs.length) { throw new IllegalArgumentException(LocalizedStrings.AttributesFactory_NUMBER_OF_DISKSIZES_IS_0_WHICH_IS_NOT_EQUAL_TO_NUMBER_OF_DISK_DIRS_WHICH_IS_1.toLocalizedString(new Object[] {Integer.valueOf(diskSizes.length), Integer.valueOf(diskDirs.length)})); } DiskStoreFactoryImpl.verifyNonNegativeDirSize(diskSizes); this.regionAttributes.diskSizes = diskSizes; if (!this.regionAttributes.hasDiskWriteAttributes() && !this.regionAttributes.hasDiskSynchronous()) { // switch to the old default this.regionAttributes.diskSynchronous = false; this.regionAttributes.diskWriteAttributes = DiskWriteAttributesImpl.getDefaultAsyncInstance(); } this.regionAttributes.setHasDiskDirs(true); }