I think the comment is correct, but what that test is doing is weird. I see
it's setting this property, which leads be to believe that there is some
code that changes the units based on this property.

DirectoryHolder.SET_DIRECTORY_SIZE_IN_BYTES_FOR_TESTING_PURPOSES = true;

Maybe a better change would be to add another setDiskDirsAndSizes
method that actually takes a unit and remove this static property?


On Tue, Jun 18, 2019 at 8:32 AM Alberto Bustamante Reyes
<[email protected]> wrote:

> Hi all,
>
>
> I have observed that in the javadoc comments of setDiskDirsAndSizes method
> in DiskStoreFactory class, it is stated that dir sizes are expected to be
> in megabytes:
>
>   /**
>    * Sets the directories to which this disk store's data is written and
> also set the sizes in
>    * megabytes of each directory.
>    *
>    * @param diskDirs directories to put the oplog files.
>    * @param diskDirSizes sizes of disk directories in megabytes
>    * @return a reference to <code>this</code>
>    *
>    * @throws IllegalArgumentException if length of the size array does not
> match to the length of
>    *         the dir array
>    */
>   DiskStoreFactory setDiskDirsAndSizes(File[] diskDirs, int[]
> diskDirSizes);
>
>
> But I was taking a look at DiskRegionJUnitTest, and I have seen that the
> values introduced to create the dirs in the tests, are treated as bytes.
> Check "testDiskFullExcep()", for example.
>
> Also, the comment in the default disk dir size in the DiskStoreFactory
> class, talks also about megabytes:
>
>   /**
>    * The default disk directory size in megabytes.
>    * <p>
>    * Current value: <code>2,147,483,647</code> which is two petabytes.
>    */
>   int DEFAULT_DISK_DIR_SIZE = Integer.MAX_VALUE; // unlimited for bug 41863
>
> I supose these comments about "megabytes" are wrong and they should be
> changed to "bytes". Could someone confirm that? In that case I can change
> it.
>
> Thanks in advance!
>
> Alberto B.
>
>
>

Reply via email to