| reset-user | Index Level | resize-file |
| Syntax | resize file.reference {modulo} {(options} |
| Category | TCL |
| Type | Verb |
| Description |
resizes a file to the desired modulo.
The "resize" command increases or decreases the apparent contiguous portion (or modulo) of the specified file without requiring a file-restore. It either adds or releases the amount of overflow necessary to reach the new modulo, and re-hashes all of the items. The re-hashing is done by groups and the current relative group being re-hashed is displayed on the screen. Unlike previously available resizing utilities, the D3 "resize" command allows a file to be read or modified while the items are being re-hashed. Furthermore, the resizing process does not require a completely new block of overflow with a size equal to the new modulo. Instead, it allocates a new file "segment" which is only as big as the difference between the old and new modulos and maps this segment onto the existing file. The file then appears to have one contiguous block available even though it may really be several blocks internally. Once a resizing command has begun re-hashing a file, the command can be logged-off or interrupted without problems. The resizing process can then be re-started on the same line or on a phantom. If the modulo is not specified, then the "resize" command will resize the file according to the "reallocation" attribute in the file's D-pointer. To see all resizing processes currently active, use the "list-resizing" command. To temporarily stop all resizing processes on the system, use the "kill-resizing" command. To restart all resizing processes (on phantoms), use the "check-resizing" command. This command is executed at coldstart time to restart any resizing commands which were interrupted by a shutdown. After resizing a file, the D-pointer of that file will display a modulo equal to the new modulo. The "reallocation" attribute is also changed to the new modulo. The internal base and modulo of each of the file's segments are displayed in the "segment-base" and "segment-mod" attributes. These attributes cannot be modified. Note that it is currently not possible to resize below the original modulo. |
| Options |
a Allocate new file space only. If this option is used, then the new segment is added, but no items are re-hashed. This is useful for allocating the new file space in the foreground, and then starting another resizing process as a phantom to complete the re-hashing process.
s Suppress output of the relative group counter during re-hashing. u Unconditional resizing. Normally, resizing processes will pause temporarily when some other process is accessing the file in a sequential fashion (like the save, or an Access or FlashBASIC select). This is because items will be in motion during the resizing and sequential processes may find an item twice. The "u" option disables this behavior so that resizing will proceed irrespective of any sequential processes. Also, the "u" option will release extra unused filespace at the end of a resize down irrespective of how many users have that file open. w{n} Wait after every group. If no numeric parameter is specified, then this option will cause the resizing process to wait for approximately 100ms between each group that it re-hashes. If an optional numeric parameter is specified, then the process will sleep for n seconds between each group. This option minimizes the impact on overall system performance during the resizing process and is strongly recommended. z Rehash a small number of groups only. This is used by the check-resizing and kill-resizing commands after a resizing process has been terminated unexpectedly. Under these conditions, the resize command will process enough groups to assure that no duplicate items occur in groups which were previously being re-hashed. |
| See Also | list-resizing resize-file istat modulo d-pointer check-resizing kill-resizing mds file-of-files resizing f-resize |
| Example |
Assume that a file called "mydata" exists with a modulo of 7, and that the "istat" command indicates a suggested modulo of 13.
resize-file mydata 13 Allocating 6 additional frames for primary file space. Rehashing 7 group(s). 7 [188] Resizing complete. The file now exists with a modulo 13. Now, suppose that a large amount of data is removed from this file, and "istat" now reports that the file should be a modulo of 11. The following command will shrink the file: resize-file mydata 11 Rehashing 13 group(s). 13 Releasing 2 frames back to overflow. [188] Resizing complete. |
| Warnings |
Since files may now be made up of multiple segments, it is no longer valid to assume that the base plus the modulo in the file's D-pointer will point to the FCB. To find the FCB, add the base and the modulo of the first segment. This formula is not guaranteed on future releases.
Resizing processes will occasionally pause during the rehashing phase because items may not be moved while another user is accessing the same file in a sequential manner. The message displayed will be: "Pausing for another process doing sequential file access.." Due to their long-running time, and lack of effect on actual data, resizing commands are NOT transfered to the transaction log. It is not possible to resize either the "file-of-files" file or the "mds" file. On a given file, it is not possible to resize to new modulo until the previous resizing (if any) has completed. When resizing downwards, it is sometimes not possible to release the extra file space if another user has that file open. In this case, all users must close the file before the space can be released. When all users have exited the file, re-execute the resize command to give up the space. |
| Compatibility | AP 6.1 |
| reset-user | Index Level | resize-file |