Updating a file using sync directories
AssigneeVMware, Inc.
InventorJonathan Clark
Life of this patent
Estimating the term…
Abstract
A method for updating and formatting a local file is described. An update file, having a newer version of the local file, is accessed from a server over a network and a list of new hash values corresponding to data blocks of the update file is retrieved. Divisions between the data blocks are located when a value of a rolling checksum reaches a particular value, the data blocks being of variable size. New hash values of the update file are compared with local hash values of the local file. For each of the new hash values not having a matching local hash value, the corresponding data block is downloaded from the server and written to a new file. For each of the new hash values having a matching local hash value, the corresponding block is copied from the local file to the new file.
Claims21
A method comprising:
- generating a sync directory for a file, wherein generating the sync directory comprises:
- sequentially, for each data unit of the file:
- reading a next data unit from the file;
- and
- calculating a rolling checksum based on the value of the next data unit and a specified amount of prior data from one or more prior data units of the file;
- based on the rolling checksum value calculated for each data unit, determining whether a specified block size has been reached;
- for each instance in which a determination is made that the specified block size has been reached:
- calculating a hash value for a current block, the current block extending from an end of a last block or the beginning of the file if there is no last block to the current data unit;
- and
- writing an offset value and the calculated hash value to the sync directory for that block;
- and
- in response to an update operation, using the sync directory for the file and a new sync directory for an updated version of the file to generate a new version of the file.
A system comprising:
- one or more computers including one or more processors and one or more storage devices storing instructions that, when executed by the one or more computers, cause the system to perform operations comprising:
- generating a sync directory for a file, wherein generating the sync directory comprises:
- sequentially, for each data unit of the file:
- reading a next data unit from the file;
- and
- calculating a rolling checksum based on the value of the next data unit and a specified amount of prior data from one or more prior data units of the file;
- based on the rolling checksum value calculated for each data unit, determining whether a specified block size has been reached;
- for each instance in which a determination is made that the specified block size has been reached:
- calculating a hash value for a current block, the current block extending from an end of a last block or the beginning of the file if there is no last block to the current data unit;
- and
- writing an offset value and the calculated hash value to the sync directory for that block;
- and
- in response to an update operation, using the sync directory for the file and a new sync directory for an updated version of the file to generate a new version of the file.
One or more non-transitory computer readable storage media containing one or more computer programs that when executed by a computer system perform operations comprising:
- generating a sync directory for a file, wherein generating the sync directory comprises:
- sequentially, for each data unit of the file:
- reading a next data unit from the file;
- and
- calculating a rolling checksum based on the value of the next data unit and a specified amount of prior data from one or more prior data units of the file;
- based on the rolling checksum value calculated for each data unit, determining whether a specified block size has been reached;
- for each instance in which a determination is made that the specified block size has been reached:
- calculating a hash value for a current block, the current block extending from an end of a last block or the beginning of the file if there is no last block to the current data unit;
- and
- writing an offset value and the calculated hash value to the sync directory for that block;
- and
- in response to an update operation, using the sync directory for the file and a new sync directory for an updated version of the file to generate a new version of the file.
Dependencies are inferred from the claim text.