Browse Prior Art Database

Hashcode for java objects refering to the same underlying data

IP.com Disclosure Number: IPCOM000234084D
Publication Date: 2014-Jan-10
Document File: 6 page(s) / 178K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is an algorithm to assign and fetch an identity hashcode for distinct objects referring to the same data payload.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 33% of the total text.

Page 01 of 6

Hashcode for java objects refering to the same underlying data

The novel contribution is an algorithm to assign and fetch an identity hashcode for distinct objects referring to the same data payload.

Each object is an independent instance of the associated class . While several references can exist for an object, each object carries individual associated data.

The object identity hashcode is a distinct value associated with a given object. This value is immutable throughout an object's lifetime. While it is permitted for several distinct objects to have the same identity hashcode value, the best performance is achieved with well-distributed values. The conventional approach is to calculate the identity hash value based on the object's memory address.

For example, in a Java* Virtual Machine (JVM) system where many-to-one object to data mapping exists, the Java extension encompasses the concept of multiple distinct Java objects pointing to the same underlying data block or subsets thereof . The following terms are used for any further examples mentioned in this document :


• OnHeap: refers to a Packed object where the data block follows the object header and is fully contained within the bounds of the object . This resembles the standard object model.


• Derived: refers to a Packed object where the data block is fully contained

within another object. The Derived object is a header specifying the OnHeap object, which contains the data block and an offset value into the data block . For example, accessing an element of a packed array results in a Derived object. This references the packed array object and provides an offset into the associated data corresponding to the index of accessed element .

• OffHeap: refers to a Packed object where the data block resides outside of the Java heap

Figure 1: Illustration of terms

1


Page 02 of 6

An identity hashcode is primarily used to identify unique objects. This new approach maintains that an identity hashcode is really used to identify unique data blocks . Therefore, the desired properties of a good identity hashcode in a many-to-one object to data model include representing uniquely identifiable data blocks , being

well distributed, and being immutable.

For example, with PackedObject, the identity hashcode can achieve a state wherein any two objects of the same type that represent the same data must return the same hash code; for example:


• An Onheap object and a derived object into it with the same type and the same offset


• Two derived objects referencing the same OnHeap object with the same type and the same offset


• Two OffHeap objects that represent the same data

A state can also be achieved wherein two objects referring to adjacent data blocks ideally have non-adjacent hashcodes.

Current practice assumes objects and data exist in a one-to-one mapping model. However, if multiple objects are allowed to map to a common block of data , which

can occur when using PackedObject tech...