Posts

Showing posts with the label IdentityHashMap

Observability Done Right: Best Practices and Anti-Patterns for Effective System Monitoring

Image
  WHAT Observability is a concept that refers to the ability to gain insights into the behavior and performance of complex systems. In the context of software engineering, observability involves the collection, analysis, and visualization of data from software applications, infrastructure, and other components of a system. In the animal kingdom, observability plays a critical role in survival, allowing animals to monitor their surroundings, detect threats, and find food. Dolphins use echolocation to observe their surroundings. They emit high-frequency sounds that bounce off objects, allowing them to create a 3D map of their environment. Thanks for reading Knowledge Cafe! Subscribe for free to receive new posts and support my work. Subscribed WHY In today's era, architectures are becoming increasingly large, complex, and fast-paced due to the faster development and deployment of software by distributed teams with the help of DevOps, continuous delivery, and agile development methodo...

IdentityHashMap in java

Image
IdentityHashMap class implements the  Map  interface with a hash table, using reference-equality in place of object-equality when comparing keys (and values). In other words, in an  IdentityHashMap , two keys  k1  and  k2  are considered equal if and only if  (k1==k2) . (In normal  Map  implementations (like  HashMap ) two keys  k1  and  k2  are considered equal if and only if  (k1==null ? k2==null : k1.equals(k2)) .) This class is  not  a general-purpose  Map  implementation! While this class implements the  Map  interface, it intentionally violates  Map's  general contract, which mandates the use of the  equals  method when comparing objects. This class is designed for use only in the rare cases wherein reference-equality semantics are required. Difference between  IdentityHashMap  and HashMap Though both HashMap and IdentityHashMap implements Map...