tcl.resize Verb: Access/TCL


Command tcl.resize Verb: Access/TCL
Applicable release versions: AP 6.1
Category TCL (746)
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 Advanced Pick "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.
Syntax resize file.reference {modulo} {(options}
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 Pick/BASIC 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.
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).

[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).
Releasing 2 frames back to overflow.

[188] Resizing complete.
Related tcl.list-resizing