Hash and Non hash files

  • dkblay
  • Topic Author
  • Visitor
  • Visitor
13 years 3 months ago #10684 by dkblay
Hash and Non hash files was created by dkblay
Please what is the difference between hash and non hash files. Trying very hard to appreciate it but i wish someone can add his point to it. Thank You

Regards

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #10687 by saahmad
Replied by saahmad on topic Re: Hash and Non hash files
Please refer to link www.jbase.com/r5/knowledgebase/manuals/3...fil2_CREATE_FILE.htm

an excerpt from the above link may guide you about hashing in jbase

HASHMETHOD
The hash method defines how the records are allocated into the file buckets or groups. The hash methods can make slight differences to performance dependent upon the values of the record keys, however the methods can also improve the performance of the Account Restore dependent upon source of file. The numeric parameter can be one of the following:

1 - Uniform hash algorithm
2 - General hashing algorithm
3 - Pick/Reality hash emulation
4 - Sequoia hash emulation
5 - jBASE hashing (provides the best spread for item-ids regardless of whether item-ids are alpha, numeric or a combination)

TYPE
The tname parameter is used to specify the type of file to be created. The following file types are provided as standard.

HASH1 or j1
The HASH1 file format was an early portable file format, which uses read() and write() system calls to perform file I/O. This file type will use jRLA locking when enabled. This file type has been succeeded by later file types, but is kept for backward compatibility. The bucket size of a HASH1 file is 512 bytes.

HASH2 or j2
The HASH2 file type is a memory mapped file type offering 5 times the throughput of the HASH1 file type. This file type will use jRLA locking when enabled. This file type is only available on systems with memory mapping and has since been succeeded by a later type, but is kept for backward compatibility. This file type is not portable across platforms. The bucket size of a HASH2 file is 4096 bytes.

HASH3 or j3
The HASH3 file type is an improved HASH1 file type, which is portable across platforms and is network friendly in that if a network connection is disconnected during the update procedure then file integrity can still be guaranteed. The HASH3 file type does not use the jRLA locking even when enabled but uses the default system locking capability, thus allowing record or item locking with networked applications. The default bucket size of a HASH3 file is 1024 bytes. See JEDI_SECURE_LEVEL for configurable levels of data flushing.

HASH4 or j4
The HASH4 file type is an improved HASH2 file type. It uses memory mapping when available, otherwise defaults to reads and writes and is portable across platforms. The HASH4 file type will use jRLA locking when enabled but can also be configured to use the default system locking method for networking. The default bucket size of a HASH4 file is 4096 bytes. j4 files use 'INT32' for any offsets, in order to provide compatibility with previous versions of jBASE. As such, j4 files should only be used where the file size will not exceed 2Gb.

jPLUS or JP (jBASE 4.1 and 5.2)
jPLUS files provide large file support on 64 bit UNIX and Windows platforms, such that Hash files can extend beyond the normal 2GB operating system limit. In addition, jPLUS files provide configurable levels of data flushing (see JEDI_SECURE_LEVEL) to ensure file integrity in the case of a system failure. Some Operating Systems require large file support to be enabled when the file system is created. Refer to your System Administration Guide for your specific platform.

JR (jBASE 5.2)
JR files are a new file type introduced in jBASE 5.2. They are highly resistant to corruption and also have the ability to auto-resize themselves as the file size increases. Further information on JR files may be found here.

The UD file type specifies NT or UNIX directories and NT or UNIX files are to be used to represent file and records respectively.

TJLOG
Creates a stub file in the current directory that points to the current transaction log set. An additional parameter, SET can be used to specify the log set. For more information see jlogdup.

DISTRIB
Creates a stub file in the current directory that references a distributed file. See distributed files for further information.

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago - 13 years 3 months ago #10690 by durai611
Replied by durai611 on topic Re: Hash and Non hash files
This is a piece of information which I got when I first started to learn and understand HASH files

“Hashing is the transformation of a string of characters into a usually shorter fixed-length value or key that represents the original string. Hashing is used to index and retrieve items in a database because it is faster to find the item using the shorter hashed key than to find it using the original value. It is also used in many encryption algorithms.”

Saahmad has shared the hashing algorithms used within jBASE when you define the type as J1,J2,J3,J4 for a HASH file.
Last edit: 13 years 3 months ago by durai611.

Please Log in or Create an account to join the conversation.

Time to create page: 0.033 seconds