This document discusses various approaches to accessing the sun.misc.Unsafe class from outside of the JDK/JRE, as it is an internal class not intended for public use. It presents several options for retrieving an Unsafe instance, such as directly calling Unsafe.getUnsafe() (which only works inside JDK/JRE), accessing the "theUnsafe" field via reflection, or constructing a new Unsafe instance using a private constructor. However, it notes that none of these options feel quite right as sun.misc.Unsafe is an internal class, and its use is discouraged outside of the JDK/JRE.
Unsafe Java World - Crossing the Borderline - JokerConf 2014 Saint PetersburgChristoph Engelbert
You never heard of sun.misc.Unsafe? You may be using it without realising it. Are you using Spring or Hibernate? 90% of todays applications use sun.misc.Unsafe directly or indirectly. Unsafe is meant to be an API internal to the JVM but since it turned out to be extremely powerful, more and more frameworks have used it.
This talk will show different usecases of sun.misc.Unsafe and other inherently unsafe possibilities in Java. Some are commonly used in production environments like fast Serialization, Offheap or to build lock-free algorithms, some not suitable for production but fun to play with breaking the rules of what you can do in Java.
After the talk you’ll understand what is possible and what might help you, but not to forget, this talk is given with a big warning: Don’t Try That At Home!
#CSA #Dehradun
XSS Video POC in Yahoo :
https://www.youtube.com/watch?v=I2WKUJn8P7I
Tapjacking bug poc in Android 6.0 Video :
https://www.youtube.com/watch?v=8BcP3Q4ZWXQ
Rugged Software Using Rugged Driven DevelopmentJames Wickett
Security testing is often done at the cadence of auditors and not at the pace of the development team which hurts delivery time in agile teams. Rugged Driven Development (RDD) utilizes security and other stress testing methodologies during the development process to impact the end product so that you create software that is secure, reliable and resilient.
Using the Gauntlt open source framework to help implement RDD you will find it fun to live by the Gauntlt motto, “be mean to your code.” You will be equipped to deliver and release ruggedized software faster as well as span the communication gaps that exist between dev, ops and security teams. This talk will help you implement RDD your projects with plenty of real world examples.
At the end of the workshop, you should:
Be Rugged Driven Dev savvy and ready to ruggedize your next project with some new practices and tooling
Know how to use gauntlt and the security tools it hooks into
Take some of the pre-built gauntlt attacks and modify them to your own project
Write your own gauntlt attacks and put them in practice
This was used in a class for an example of a presentation, I ended up scaring my teacher and the other students into installing VPN and setting up their phones for more privacy. Operation Successful
Unsafe Java World - Crossing the Borderline - JokerConf 2014 Saint PetersburgChristoph Engelbert
You never heard of sun.misc.Unsafe? You may be using it without realising it. Are you using Spring or Hibernate? 90% of todays applications use sun.misc.Unsafe directly or indirectly. Unsafe is meant to be an API internal to the JVM but since it turned out to be extremely powerful, more and more frameworks have used it.
This talk will show different usecases of sun.misc.Unsafe and other inherently unsafe possibilities in Java. Some are commonly used in production environments like fast Serialization, Offheap or to build lock-free algorithms, some not suitable for production but fun to play with breaking the rules of what you can do in Java.
After the talk you’ll understand what is possible and what might help you, but not to forget, this talk is given with a big warning: Don’t Try That At Home!
#CSA #Dehradun
XSS Video POC in Yahoo :
https://www.youtube.com/watch?v=I2WKUJn8P7I
Tapjacking bug poc in Android 6.0 Video :
https://www.youtube.com/watch?v=8BcP3Q4ZWXQ
Rugged Software Using Rugged Driven DevelopmentJames Wickett
Security testing is often done at the cadence of auditors and not at the pace of the development team which hurts delivery time in agile teams. Rugged Driven Development (RDD) utilizes security and other stress testing methodologies during the development process to impact the end product so that you create software that is secure, reliable and resilient.
Using the Gauntlt open source framework to help implement RDD you will find it fun to live by the Gauntlt motto, “be mean to your code.” You will be equipped to deliver and release ruggedized software faster as well as span the communication gaps that exist between dev, ops and security teams. This talk will help you implement RDD your projects with plenty of real world examples.
At the end of the workshop, you should:
Be Rugged Driven Dev savvy and ready to ruggedize your next project with some new practices and tooling
Know how to use gauntlt and the security tools it hooks into
Take some of the pre-built gauntlt attacks and modify them to your own project
Write your own gauntlt attacks and put them in practice
This was used in a class for an example of a presentation, I ended up scaring my teacher and the other students into installing VPN and setting up their phones for more privacy. Operation Successful
Dies sind die Slides von meinem Vortrag auf dem Java Forum Nord 2016 in Hannover. Es geht hierbei stark um die Qualität der Kommunikation und wie jeder einen Anspruch an seine eigene Qualität entwickeln soll.
Reaching critical masses with your application systems becomes harder every day. Caching helps to provide low latency and high availability over slow calculation, networks, databases and any other kind of external resource.
There is hardly a Senior Java developer who has never heard of sun.misc.Unsafe. Though it has always been a private API intended for JDK internal use only, the popularity of Unsafe has grown too fast, and now it is used in many open-source projects. OK.RU is not an exception: its software also heavily relies on Unsafe APIs.
During this session we'll try to understand what is so attractive about Unsafe. Why do people keep using it regardless the warnings of removal from future JDK releases? Are there any safe alternatives to private API or is it absolutely vital? We will review the typical cases when Java developers prefer to go unsafe and discuss major benefits and the drawbacks of it. The report will be supported by the real examples from OK.RU experience.
JHipster is a trendy Yeoman generator that provides the possibility to create an AngularJS + Spring Boot project from the scratch in no time. I would like to share the idea of JHipster and a set of tools that it comprises. I will superficially cover scaffolding and the explicit tool, that makes scaffolding plain and easy to adopt, named Yeoman.
Started in October 2013, JHipster has grown and obtained a developing community, furthermore, it is growing rapidly as for the past year about 150 programmers contributed to it. During the presentation, I want to perform a live demonstration of creating a new project based on the aforementioned core and a few subsidiary technologies. Since JHipster includes a great deal of technologies it’s a good source of common practices.
No Container: a Modern Java Stack with BootiqueAndrus Adamchik
Java containers appeared back in the era of big expensive hardware and monolithic applications, and currently feel like an impediment to Java progress. More and more developers opt out of containers in favor of runnable jars, especially with the advance of microservices architectures. Andrus Adamchik will present a new open source tool called Bootique (https://bootique.io), a pluggable and extensible technology intended for various kinds of container-less Java apps – REST services, webapps, job runners, desktop apps and what not.
What are some of the performance implications of using lambdas and what strategies can be used to address these. When might be want an alternative to using a lambda and how can we design our APIs to be flexible in this regard. What are the principles of writing low latency code in Java? How do we tune and optimize our code for low latency? When don’t we optimize our code? Where does the JVM help and where does it get in our way? How does this apply to lambdas? How can we design our APIs to use lambdas and minimize garbage?
PackedObject is an experimental feature in IBM J9 Virtual Machine. Goal(s) of Feature: Improve serialization and I/O of Java objects Allow direct access to “native” (off-heap) data Allow for explicit source-level representation of compact data-structure Intended Use: Provide an opportunity for feedback and experimentation Not meant for production support Not a committed language change
Was jeder Java-Entwickler über Strings wissen sollteberndmueller
Strings sind wahrscheinlich der am meisten verwendete Datentyp in jeder
Java-Anwendung. Es ist daher nicht überraschend, dass JDK-Ingenieure
versuchen, Strings möglichst gut zu optimieren oder Bücher über
Performanz-Tuning und Testen dem Thema Strings ganze Kapitel widmen.
Jeder Entwickler sollte daher wissen, was Strings sind und wie sie
sinnvoll und effizient eingesetzt werden können.
Dieser Vortrag stellt JDK-Klassen vor, die mit und auf Strings
arbeiten, sowohl auf der API- aber auch auf der
Implementierungsebene. Wir beleuchten internte Strings und die für sie
verwendeten Speicherbereiche, sowie die noch recht unbekannte
"String-Deduplication"-Option des G1-Garbage-Collectors.
Mit Java 9 ändert sich die interne Repräsentation von Strings.
Wir skizzieren diese Änderungen, die nach außen unsichtbar
bleiben.
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2Amazon Web Services
Hear how Turtle Rock launched Evolve, their fast-paced mercenary-vs-monster first-person shooter (FPS), to millions of players using AWS regions around the globe. Turtle Rock provides an in-depth view into Evolve's architecture on AWS, including both their Amazon EC2 and Elastic Load Balancing web API stack, as well as their Crytek-based UDP game servers. Hear how they used Amazon VPC subnets, along with an RDS MySQL based server registration service, to balance players across Availability Zones and regions. Learn about Turtle Rock's innovative game server scaling logic, which maintains a pool of game server capacity while keeping costs in check. Finally, see Evolve’s Graphite and Grafa monitoring setup, which provides player count and server health status across their worldwide fleet.
What are the Cool Kids Doing With Continuous Delivery?CA Technologies
Building a solid application delivery tool chain is no easy task. The popularity of infrastructure configuration management tools like Puppet, Chef, Salt and others are a direct result of the explosion of virtual machines needing to be maintained, configured and provisioned. Learn how you can leverage these trends and combine infrastructure configuration and release automation to build an enterprise class continuous delivery solution for your business.
For more information on DevOps solutions from CA Technologies, please visit: http://bit.ly/1wbjjqX
Pitfalls of migrating projects to JDK 9Pavel Bucek
Java 9 brings revolutionary changes. There is a big difference between their adoption and adoption of similarly revolutionary features of Java 8: lambdas and streams could gradually be included in a project, but Jigsaw requires some significant changes to the existing code. Jersey and Tyrus are popular open source libraries of considerable size and cherish backward compatibility. This session presents lessons learned during a migration to Java 9 and adoption of Jigsaw features. The nature of the projects and their features—such as resource injection or scanning and using user-provided (thus unknown, in standard dependency view) classes—make the migration particularly interesting and informative for future Java 9 adopters.
Technische Schulden in Architekturen erkennen und beseitigenCarola Lilienthal
Beim Entwurf der Softwarearchitektur zu Beginn eines Projekts bringen die Architekten i.d.R. all ihre Erfahrung und ihr Knowhow ein und stellen eine Architektur-Blaupause für die Entwicklung bereit. Aber während der Implementierung weichen die Entwickler ungewollt mehr und mehr von diesen Vorgaben ab: Einerseits macht der Projektdruck Abweichungen notwendig, andererseits entstehen die Abweichungen ungewollt und unbemerkt. Die Architektur des Systems erodiert und es werden Schritt für Schritt technische Schulden aufgebaut. Wartung und Erweiterung der Software werden immer teurer bis zu dem Punkt, an dem jede Änderung zu einer schmerzhaften Anstrengung wird.
In diesem Vortrag berichte ich von meinen Erfahrungen der letzten zehn Jahre mit der Analyse von Softwarearchitekturen in Java (60 Systeme), C# (10 Systeme), C++(6 Systeme): Die Zuhörer wissen nach meinem Vortrag, welche Fehler sie in ihren Softwareprojekten bei der Umsetzung der Architektur nicht machen sollten, welche Prinzipien Sie einhalten sollen, um technische Schulden nicht entstehen zu lassen, welche Tools helfen, technische Schulden aufzuspüren, und wie technische Schulden abgebaut werden können.
Dies sind die Slides von meinem Vortrag auf dem Java Forum Nord 2016 in Hannover. Es geht hierbei stark um die Qualität der Kommunikation und wie jeder einen Anspruch an seine eigene Qualität entwickeln soll.
Reaching critical masses with your application systems becomes harder every day. Caching helps to provide low latency and high availability over slow calculation, networks, databases and any other kind of external resource.
There is hardly a Senior Java developer who has never heard of sun.misc.Unsafe. Though it has always been a private API intended for JDK internal use only, the popularity of Unsafe has grown too fast, and now it is used in many open-source projects. OK.RU is not an exception: its software also heavily relies on Unsafe APIs.
During this session we'll try to understand what is so attractive about Unsafe. Why do people keep using it regardless the warnings of removal from future JDK releases? Are there any safe alternatives to private API or is it absolutely vital? We will review the typical cases when Java developers prefer to go unsafe and discuss major benefits and the drawbacks of it. The report will be supported by the real examples from OK.RU experience.
JHipster is a trendy Yeoman generator that provides the possibility to create an AngularJS + Spring Boot project from the scratch in no time. I would like to share the idea of JHipster and a set of tools that it comprises. I will superficially cover scaffolding and the explicit tool, that makes scaffolding plain and easy to adopt, named Yeoman.
Started in October 2013, JHipster has grown and obtained a developing community, furthermore, it is growing rapidly as for the past year about 150 programmers contributed to it. During the presentation, I want to perform a live demonstration of creating a new project based on the aforementioned core and a few subsidiary technologies. Since JHipster includes a great deal of technologies it’s a good source of common practices.
No Container: a Modern Java Stack with BootiqueAndrus Adamchik
Java containers appeared back in the era of big expensive hardware and monolithic applications, and currently feel like an impediment to Java progress. More and more developers opt out of containers in favor of runnable jars, especially with the advance of microservices architectures. Andrus Adamchik will present a new open source tool called Bootique (https://bootique.io), a pluggable and extensible technology intended for various kinds of container-less Java apps – REST services, webapps, job runners, desktop apps and what not.
What are some of the performance implications of using lambdas and what strategies can be used to address these. When might be want an alternative to using a lambda and how can we design our APIs to be flexible in this regard. What are the principles of writing low latency code in Java? How do we tune and optimize our code for low latency? When don’t we optimize our code? Where does the JVM help and where does it get in our way? How does this apply to lambdas? How can we design our APIs to use lambdas and minimize garbage?
PackedObject is an experimental feature in IBM J9 Virtual Machine. Goal(s) of Feature: Improve serialization and I/O of Java objects Allow direct access to “native” (off-heap) data Allow for explicit source-level representation of compact data-structure Intended Use: Provide an opportunity for feedback and experimentation Not meant for production support Not a committed language change
Was jeder Java-Entwickler über Strings wissen sollteberndmueller
Strings sind wahrscheinlich der am meisten verwendete Datentyp in jeder
Java-Anwendung. Es ist daher nicht überraschend, dass JDK-Ingenieure
versuchen, Strings möglichst gut zu optimieren oder Bücher über
Performanz-Tuning und Testen dem Thema Strings ganze Kapitel widmen.
Jeder Entwickler sollte daher wissen, was Strings sind und wie sie
sinnvoll und effizient eingesetzt werden können.
Dieser Vortrag stellt JDK-Klassen vor, die mit und auf Strings
arbeiten, sowohl auf der API- aber auch auf der
Implementierungsebene. Wir beleuchten internte Strings und die für sie
verwendeten Speicherbereiche, sowie die noch recht unbekannte
"String-Deduplication"-Option des G1-Garbage-Collectors.
Mit Java 9 ändert sich die interne Repräsentation von Strings.
Wir skizzieren diese Änderungen, die nach außen unsichtbar
bleiben.
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2Amazon Web Services
Hear how Turtle Rock launched Evolve, their fast-paced mercenary-vs-monster first-person shooter (FPS), to millions of players using AWS regions around the globe. Turtle Rock provides an in-depth view into Evolve's architecture on AWS, including both their Amazon EC2 and Elastic Load Balancing web API stack, as well as their Crytek-based UDP game servers. Hear how they used Amazon VPC subnets, along with an RDS MySQL based server registration service, to balance players across Availability Zones and regions. Learn about Turtle Rock's innovative game server scaling logic, which maintains a pool of game server capacity while keeping costs in check. Finally, see Evolve’s Graphite and Grafa monitoring setup, which provides player count and server health status across their worldwide fleet.
What are the Cool Kids Doing With Continuous Delivery?CA Technologies
Building a solid application delivery tool chain is no easy task. The popularity of infrastructure configuration management tools like Puppet, Chef, Salt and others are a direct result of the explosion of virtual machines needing to be maintained, configured and provisioned. Learn how you can leverage these trends and combine infrastructure configuration and release automation to build an enterprise class continuous delivery solution for your business.
For more information on DevOps solutions from CA Technologies, please visit: http://bit.ly/1wbjjqX
Pitfalls of migrating projects to JDK 9Pavel Bucek
Java 9 brings revolutionary changes. There is a big difference between their adoption and adoption of similarly revolutionary features of Java 8: lambdas and streams could gradually be included in a project, but Jigsaw requires some significant changes to the existing code. Jersey and Tyrus are popular open source libraries of considerable size and cherish backward compatibility. This session presents lessons learned during a migration to Java 9 and adoption of Jigsaw features. The nature of the projects and their features—such as resource injection or scanning and using user-provided (thus unknown, in standard dependency view) classes—make the migration particularly interesting and informative for future Java 9 adopters.
Technische Schulden in Architekturen erkennen und beseitigenCarola Lilienthal
Beim Entwurf der Softwarearchitektur zu Beginn eines Projekts bringen die Architekten i.d.R. all ihre Erfahrung und ihr Knowhow ein und stellen eine Architektur-Blaupause für die Entwicklung bereit. Aber während der Implementierung weichen die Entwickler ungewollt mehr und mehr von diesen Vorgaben ab: Einerseits macht der Projektdruck Abweichungen notwendig, andererseits entstehen die Abweichungen ungewollt und unbemerkt. Die Architektur des Systems erodiert und es werden Schritt für Schritt technische Schulden aufgebaut. Wartung und Erweiterung der Software werden immer teurer bis zu dem Punkt, an dem jede Änderung zu einer schmerzhaften Anstrengung wird.
In diesem Vortrag berichte ich von meinen Erfahrungen der letzten zehn Jahre mit der Analyse von Softwarearchitekturen in Java (60 Systeme), C# (10 Systeme), C++(6 Systeme): Die Zuhörer wissen nach meinem Vortrag, welche Fehler sie in ihren Softwareprojekten bei der Umsetzung der Architektur nicht machen sollten, welche Prinzipien Sie einhalten sollen, um technische Schulden nicht entstehen zu lassen, welche Tools helfen, technische Schulden aufzuspüren, und wie technische Schulden abgebaut werden können.
You say SCADA, I say … mainframes. There are some remarkable - and scary - parallels between the worlds of SCADA ICS and mainframes. Each system is critical to our lives. Their worlds are insular, proprietary, and seemingly shut-off to everyone else. Except for when they aren’t. Extrapolate the future of security for mainframes based on the challenges and failures of SCADA ICS as it has evolved from sequestered to connected. SCADA serves as a cautionary tale for securing mainframes against acts of God, nature and man in this scenario of a Stuxnet for Mainframes.
Teaching Elephants to Dance (Federal Audience): A Developer's Journey to Digi...Burr Sutter
We can be brilliant developers, but we won’t succeed—and won’t lead our organizations to succeed—without a new perspective (if you will) and new assumptions about the components of the “technology ecosystem” that are fundamentally critical to our success. This includes the operators, QA team, DBAs, security folks, and even the pure business contingent—in most cases, each of these individuals and groups plays a critical role in the success of what we create and give birth to as developers. What we do in isolation might be genius, but if we insulate ourselves—especially with arrogance—from these colleagues, neither our code nor our organizations will realize their full potential, and most will fail. The bottom line is that our old ways are no longer viable, and as the elite within our industry, we will be the leaders and heroes who discard old assumptions and adopt a new perspective in this exciting journey to digital transformation—where the impossible can become reality.
Mistakes I Made Building Netflix for the iPhonekentbrew
Slides for the talk by the same name I gave at SxSW 2011. You can view the demo app at http://iflx.com, and fork the source from https://github.com/kentbrew/iflx.
For the last two decades, the amount of data we store, process, and analyze is ever growing. The last decade shows a higher focus on immediate feedback loop data pipeline, using technologies such as Complex Event Processing (CEP), Stream Processing, and Change Data Capture (CDC). Services such as Kafka or NATS are to be found in almost every new system (at least to some extent).
To build a data pipeline, the number of technologies, frameworks, and platforms are endless. Getting the initial grasp of it all is much harder than expected, but together we can tackle it!
Messages sind heutzutage überall. Egal ob JavaScript Frontends in Form von Events, oder Backends mit Kafka oder NATS Message Queues, wir wollen zwei Ziele erreichen, Separation of Concerns (unabhängige Einheiten) und Skalierbarkeit (oder in Frontends Freigabe von Resourcen).
Da heute alles Responsive sein muss, brauchen wir Event-basierte Systeme. Also lasst uns gemeinsam die darunterliegenden Systeme erforschen, verstehen und Einsatzbereiche erarbeiten.
Farms are simple. A farm, a building or two, maybe a barn. Done. You’d wish.
Monitoring farms and barns is a tedious task. No farm looks like the other and water distribution, next to other elements, has grown generically. A little bit like the good old legacy systems we all love. With the additional complication of keeping track of topology changes, typical building automation systems are out of the scope.
See how clevabit integrated neo4j, PostgreSQL and TimescaleDB to bring observability to farms and what I learned along the way. And there were a lot of “this time it works” moments.
What I learned about IoT Security ... and why it's so hard!Christoph Engelbert
Smart devices taking over our living rooms, our bed rooms, and, in general, our life. It has never been more important to build secure devices, but most companies seem to fail, and they fail hard. We (only) build systems for farms and barns, and still, I wanted security for Cow-stumers.
Building a mostly secure system is fairly simple. There is a good set of low-hanging fruits. Building a really locked down system is tough, though. Much harder than expected. Here is what I learned.
Time-series data, or data being associated with its respective time of occurrence, is everywhere. From the obvious cases, such as metrics, observability, IoT data, all the way to logs, invoicing, or payment records. While storing some of these in relational databases is standard practice, people often reach for specific time-series databases when volume gets high. But imagine if you could have all of them in the same database: PostgreSQL.
With Instana the "Classic" Observability is not the end of the line. Find out what Observability means and how it can help DevOps, Developers, SREs day-by-day.
Building, deploying and operating application systems for high scale and failure tolerance is the supreme field of software engineering. While Continuous Integration (CI) and oftentimes also Continuous Delivery (CD) have become a part of commonly used build pipelines, monitoring and observability is still often an afterthought or manually configured. To keep up with containers being started and stopped for version upgrades, scaling up and down or to mitigate failure situations, monitoring needs to automate all the tasks to react to infrastructure changes and find issues before users being impacted. People today expect “Oops-Less Operation”, or do you want your bank to be offline?
Continuous Integration, Continuous Delivery, Continuous Monitoring!
These days CI and CD are commonly used mechanics to achieve fast turn-around times for high-demand applications. Microservices architectures and highly dynamic envrionments (based on Kubernetes, Docker, …), however, come with a whole different set of problems.
Systems, that not only appear and disappear dynamically (e.g. autoscaling), but most commonly tend to be written using multiple different programming languages, are hard to monitor from the point of view that matters: User Requests and User Experience. but the answer is simple; Continuous Monitoring (CM).
Let's build a polyglot microservices infrastructure. A way to monitor and trace multi-service requests will be demonstrated using Instana’s automatic discovery system.
As we all know Java is the best language in the world, except there is Go. Go is just so much more, isn’t it? The syntax is so concise and meaningful, the compiler is so much more helpful and the rules are all over it.
We will uncovering the bitter truth, the 5 reasons, that every Java developer should know about Go. We’ll present why Go is just the better programming language and why the hype around Go is all real.
Let your eyes be to opened and your brain to explode. Sarcasm included.
Everyone knows there isn't just one way of doing things. This is also true for web-administrated Embedded Devices and a lot of different ways to attack the implementation were taken before the combination of Golang and Typescript manifested. Plenty of the tries started by missing knowledge, inability, the hate of some programming languages or just plainly on size requirements. Over Java and C/C++ to Go+Lua, Go+JavaScript and the final decision on Go and Typescript, we follow the adventure of an embedded framework and the arising problems. Pros and Cons but also the feeling for a Java developer and new horizons are given.
JSON, by now, became a regular part of most applications and services. Do we, how ever, really want to transfer human readable information or are we looking for a binary protocol to be as debuggable as JSON? CBOR the Concise Binary Object Representation offers the best of JSON + an extremely efficient, binary representation.
http://www.cbor.io
The days of JNI is counted, Project Panama is on the rise to tear down the walls between Java and C/C++ forever. FFI (Foreign Function Interface) technology finally arrives into the Java world.
The way from monolithic to micro service architectures can hard. Overall micro services are not the all holy grail to just solve all your issues. You need to be aware that you need the right developers and the right toolset. Oh and not to forget, moving state to authorization systems doesn't mean your application is really stateless :)
Anyhow micro services are a great architecture and this deck is a short introduction on why we need to change our application architectures and what pitfalls you you have when introducing the idea of micro services.
In-Memory Computing - Distributed Systems - Devoxx UK 2015Christoph Engelbert
Today’s amounts of collected data are showing a nearly exponential growth. More than 75% of all the data have been collected in the past 5 years. To store this data and process it in an appropriate time you need to partition the data and parallelize the processing of reports and analytics. This talk will demonstrate how to parallelize data processing using Hazelcast and it’s underlying distributed data structures. With a quick introduction into the different terms and some short live coding examples we will make the journey into the distributed computing.
JCache - Caching Introduction - What is the idea, where are we coming from and where we want to go in the future. Why we need caching and why do we want to cache?
Nowadays collected amounts of data growing exponentially. More than 75% of all stored data were collected in the last 5 to 6 years. To store and analyze those always fast growing pile of data we have to go new ways. The Scale-Up approach starts to break apart. Partitioning data and parallelize processing and analyzing are the new way.
Hey guys, lemme tell ya a story.
Once upon a time, we’re talking about the year 2001, a few people had an amazing idea. They were thinking about something that would change the world. It would make the world easy and give programmers almost unlimited power! It was simply referred to as JSR 107, one of the least things to change in the upcoming future. But those pals were way ahead of their time and nothing really happend. So time passed by and by and by and over the years it was buried in the deep catacombs of the JCP. Eventually, in 2011, two brave knights took on the fight and worked themselves through all the pathlessness, to finalize it in 2014. Lads you know what I’m talking about, they called it the “Java Caching API” or in short “JCache”. Yes you heard me, a Java standard for Caching!
Hey lads, lemme tell ya a story.
Once upon a time, we're talking about the year 2001, a few people had an amazing idea. They were thinking about something that would change the world. It would make the world easy and give programmers almost unlimited power! It was simply referred to as JSR 107, one of the least things to change in the upcoming future. But those pals were way ahead of their time and nothing really happend. So time passed by and by and by and over the years it was buried in the deep catacombs of the JCP. Eventually, in 2011, two brave knights took on the fight and worked themselves through all the pathlessness, to finalize it in 2014. Lads you know what I'm talking about, they called it the "Java Caching API" or in short "JCache". Yes you heard me, a Java standard for Caching!
A software system cannot possibly imagined without Caching today and it was time for a standard. No matter if you want to cache database queries, generated HTML or results of long running calculations, new systems have to reach a critical mass to be successful. Therefore caching becomes a First-Class-Citizen of application landscape, the principle of Caching First. JCache has grown for 13 years to it's final success and had an amazing Co-Spec-Lead, Greg Luck - the inventor of EHcache.
Today’s amounts of collected data are showing nearly exponential growth. More than 75 percent of all collected data has been collected in the past five years. To store that data and process it within an appropriate time, you need to partition the data and parallelize the processing of reports and analytics. This session demonstrates how to quickly and easily parallelize data processing with Hazelcast and its underlying distributed data structures. By giving a few quick introductions to different terms and some short live coding sessions, the presentation takes you on a journey through distributed computing.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. It’s here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfJay Das
With the advent of artificial intelligence or AI tools, project management processes are undergoing a transformative shift. By using tools like ChatGPT, and Bard organizations can empower their leaders and managers to plan, execute, and monitor projects more effectively.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
11. www.hazelcast.com@noctarius2k
Used inside and outside the JDK / JRE
custom (64-bit)
memory allocation
fast
memory access
fast
(de)serialization
minimizegc overhead
custom
memory fences
efficientmemory layout
(array element)
volatile semantics
12. www.hazelcast.com@noctarius2k
Used inside and outside the JDK / JRE
// Unsafe mechanics
private static final sun.misc.Unsafe U;
private static final long QBASE;
private static final long QLOCK;
private static final int ABASE;
private static final int ASHIFT;
static {
try {
U = sun.misc.Unsafe.getUnsafe();
Class<?> k = WorkQueue.class;
Class<?> ak = ForkJoinTask[].class;
QBASE = U.objectFieldOffset
(k.getDeclaredField("base"));
QLOCK = U.objectFieldOffset
(k.getDeclaredField("qlock"));
ABASE = U.arrayBaseOffset(ak);
int scale = U.arrayIndexScale(ak);
if ((scale & (scale - 1)) != 0)
throw new Error("data type scale not a power of two");
ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
} catch (Exception e) {
throw new Error(e);
}
}
}
example:
java.util.concurrent.ForkJoinPool
17. www.hazelcast.com@noctarius2k
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000001067314b5, pid=25244, tid=5891
#
# JRE version: Java(TM) SE Runtime Environment (8.0_05-b13) (build 1.8.0_05-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V [libjvm.dylib+0x5314b5] Unsafe_SetNativeAddress+0x36
#
# An error report file with more information is saved as:
# /Users/noctarius/git/hazelcast-only.idea/hs_err_pid25244.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
30. www.hazelcast.com@noctarius2k
Close ;-)
Language URL sun.misc.Unsafe
Avian C++ https://github.com/ReadyTalk/avian Yes
BicaVM JavaScript https://github.com/nurv/BicaVM No
Cacao C http://www.cacaojvm.org Yes
Excelsior JVM C / C++ ? http://www.excelsiorjet.com Yes
Dalvik / ART / Android C / C++ https://source.android.com/source/index.html Yes
Graal mainly Java http://openjdk.java.net/projects/graal Yes
GCJ C / C++ https://gcc.gnu.org/java Yes
HaikuVM C http://haiku-vm.sourceforge.net No
IBM J9 C / C++ ? http://www.ibm.com/developerworks/java/jdk/index.html Yes
IcedTea C / C++ http://icedtea.classpath.org/wiki/Main_Page Yes
IKVM.NET C# http://www.ikvm.net Yes
Jamiga C https://sourceforge.net/projects/jamiga2 No
JamVM C http://jamvm.sourceforge.net Yes
JatoVM C http://jatovm.org Yes
JikesRVM C microkernel, Java http://www.jikesrvm.org Yes
JNode C microkernel, Java http://www.jnode.org Yes
JVM.go Go https://github.com/zxh0/jvm.go Yes
JX C http://www4.cs.fau.de/Projects/JX/index.html No
Kaffe C https://github.com/kaffe/kaffe Yes
NanoVM C http://harbaum.org/till/nanovm/index.shtml No
OpenJDK / Oracle / Zulu C / C++ http://openjdk.java.net Yes
RoboVM C / C++ / ObjC https://robovm.com Yes
SAPJVM C / C++ ? http://help.sap.com/saphelp_nwce10/helpdata/en/47/
dc90b4ef17452289f9128b8c2bbd77/content.htm
Yes
Waratek Multitenant JVM C / C++ ? http://www.waratek.com Yes
Zing JVM C / C++ ? https://www.azul.com/products/zing Yes
33. www.hazelcast.com@noctarius2k
http://mail.openjdk.java.net/pipermail/openjfx-dev/2015-April/017028.html
Let me be blunt -- sun.misc.Unsafe must die in a fire. It is -- wait
for it -- Unsafe. It must go. Ignore any kind of theoretical rope and
start the path to righteousness _*/now/*_. It is still years until the
end of public updates to JDK 8, so we have /*years */to work this out
properly. But sticking our heads in the collective sands and hoping for
trivial work arounds to Unsafe is not going to work. If you're using
Unsafe, this is the year to explain where the API is broken and get it
straight....
Please help us kill Unsafe, kill Unsafe dead, kill Unsafe right, and do
so as quickly as possible to the ultimate benefit of everyone.
Wed Apr 8 19:15:42 UTC 2015, OpenJFX Mailinglist, Donald Smith, Oracle
34. www.hazelcast.com@noctarius2k
http://mail.openjdk.java.net/pipermail/openjfx-dev/2015-April/017028.html
Let me be blunt -- sun.misc.Unsafe must die in a fire. It is -- wait
for it -- Unsafe. It must go. Ignore any kind of theoretical rope and
start the path to righteousness _*/now/*_. It is still years until the
end of public updates to JDK 8, so we have /*years */to work this out
properly. But sticking our heads in the collective sands and hoping for
trivial work arounds to Unsafe is not going to work. If you're using
Unsafe, this is the year to explain where the API is broken and get it
straight....
Please help us kill Unsafe, kill Unsafe dead, kill Unsafe right, and do
so as quickly as possible to the ultimate benefit of everyone.
Wed Apr 8 19:15:42 UTC 2015, OpenJFX Mailinglist, Donald Smith, Oracle
37. www.hazelcast.com@noctarius2k
http://mail.openjdk.java.net/pipermail/openjfx-dev/2015-April/017028.html
Let me be blunt -- sun.misc.Unsafe must die in a fire. It is -- wait
for it -- Unsafe. It must go. Ignore any kind of theoretical rope and
start the path to righteousness _*/now/*_. It is still years until the
end of public updates to JDK 8, so we have /*years */to work this out
properly. But sticking our heads in the collective sands and hoping for
trivial work arounds to Unsafe is not going to work. If you're using
Unsafe, this is the year to explain where the API is broken and get it
straight....
Please help us kill Unsafe, kill Unsafe dead, kill Unsafe right, and do
so as quickly as possible to the ultimate benefit of everyone.
Wed Apr 8 19:15:42 UTC 2015, OpenJFX Mailinglist, Donald Smith, Oracle
46. www.hazelcast.com@noctarius2k
Problem 1: Get Access
private static final Unsafe UNSAFE;
static {
try {
Field theUnsafeField = Unsafe.class.getDeclaredField("theUnsafe");
theUnsafeField.setAccessible(true);
UNSAFE = (Unsafe) theUnsafeField.get(Unsafe.class);
} catch (Exception e) {
// We need you! =(
throw new Error(e);
}
}
The Ugly One
47. www.hazelcast.com@noctarius2k
Problem 1: Get Accessprivate static Unsafe findUnsafe() {
try {
return Unsafe.getUnsafe();
} catch (SecurityException se) {
return AccessController.doPrivileged(new PrivilegedAction<Unsafe>() {
@Override
public Unsafe run() {
try {
Class<Unsafe> type = Unsafe.class;
try {
Field field = type.getDeclaredField("theUnsafe");
field.setAccessible(true);
return type.cast(field.get(type));
} catch (Exception e) {
for (Field field : type.getDeclaredFields()) {
if (type.isAssignableFrom(field.getType())) {
field.setAccessible(true);
return type.cast(field.get(type));
}
}
}
} catch (Exception e) {
throw new RuntimeException("Unsafe unavailable", e);
}
throw new RuntimeException("Unsafe unavailable");
}
});
}
}
The Hazelcast One
(also working in most other JVMs)
48. www.hazelcast.com@noctarius2k
Problem 1: Get Access
The Tricky One
private static final Unsafe UNSAFE;
static {
try {
Constructor<Unsafe> constructor =
Unsafe.class.getDeclaredConstructor();
constructor.setAccessible(true);
UNSAFE = constructor.newInstance();
} catch (Exception e) {
// We need you! =(
throw new Error(e);
}
}
49. www.hazelcast.com@noctarius2k
Problem 1: Get Access
The Tricky One
private static final Unsafe UNSAFE;
static {
try {
Constructor<Unsafe> constructor =
Unsafe.class.getDeclaredConstructor();
constructor.setAccessible(true);
UNSAFE = constructor.newInstance();
} catch (Exception e) {
// We need you! =(
throw new Error(e);
}
}
55. www.hazelcast.com@noctarius2k
Problem 2: Atomic Updates
private static final Unsafe UNSAFE = findUnsafe();
private static long VERSION_OFFSET = findVersionOffset();
// Updated through Unsafe only!
private volatile long version = 0;
public long increment() {
while(true) {
long version = this.version;
long newVersion = version + 1;
if (UNSAFE.compareAndSwapLong(
this, VERSION_OFFSET, version, newVersion)) {
return newVersion;
}
}
}
Going Unsafe
57. www.hazelcast.com@noctarius2k
Problem 2: Atomic Updates
private final AtomicLong version = new AtomicLong(0);
public long increment() {
return version.incrementAndGet();
}
We can do better! There’s an API already!
But one AtomicLong instance per version
59. www.hazelcast.com@noctarius2k
Problem 2: Atomic Updates
We can still do better! There’s yet another API already!
private static final AtomicLongFieldUpdater<Record> VERSION =
AtomicLongFieldUpdater.newUpdater(Record, "version");
// Updated through atomic field updater only!
private volatile long version = 0;
public long increment() {
return VERSION.incrementAndGet(this);
}
60. www.hazelcast.com@noctarius2k
Solution 2: Atomic Updates
We can still do better! There’s yet another API already!
private static final AtomicLongFieldUpdater<Record> VERSION =
AtomicLongFieldUpdater.newUpdater(Record, "version");
// Updated through atomic field updater only!
private volatile long version = 0;
public long increment() {
return VERSION.incrementAndGet(this);
}
You guessed it, __ uses it ;-)
61. www.hazelcast.com@noctarius2k
Solution 2: Atomic Updates
private static final VarHandle VERSION = findVersionVarHandle();
// Updated through VarHandle only!
private volatile long version = 0;
public long increment() {
return (long) VERSION.addAndGet(this, 1);
}
JVM can inline those calls
63. www.hazelcast.com@noctarius2k
Problem 3: Memory Management
public long memory() {
long address = UNSAFE.allocateMemory(8);
UNSAFE.putLong(address, Long.MAX_VALUE);
return UNSAFE.getLong(address);
}
Keyword: Off-Heap
64. www.hazelcast.com@noctarius2k
Problem 3: Memory Management
ByteBuffer possible; API is 32bit though
public long memory() {
ByteBuffer byteBuffer = ByteBuffer.allocateDirect(8);
byteBuffer.putLong(0, Long.MAX_VALUE);
return byteBuffer.getLong(0);
}
70. www.hazelcast.com@noctarius2k
Problem 5: Native Interoperability
extern c {
JNIEXPORT int JNICALL
Java_ProcessIdentifier_getProcessId(JNIEnv *, jobject);
}
JNIEXPORT int JNICALL
Java_ProcessIdentifier_getProcessId(JNIEnv *env, jobject thisObj) {
return getpid();
}
public class ProcessIdentifier {
static {
System.loadLibrary("processidentifier");
}
public native void getProcessId();
}
71. www.hazelcast.com@noctarius2k
Problem 5: Native Interoperability
extern c {
JNIEXPORT int JNICALL
Java_ProcessIdentifier_getProcessId(JNIEnv *, jobject);
}
JNIEXPORT int JNICALL
Java_ProcessIdentifier_getProcessId(JNIEnv *env, jobject thisObj) {
return getpid();
}
public class ProcessIdentifier {
static {
System.loadLibrary("processidentifier");
}
public native void getProcessId();
}
Fortunately we don’t deal with it, but who loves it anyways ;-)
72. www.hazelcast.com@noctarius2k
Solution 5: Native Interoperability (for now)
interface LibC {
void getpid();
}
public int call() {
LibC c = LibraryLoader.create(LibC.class).load("c");
return c.getpid();
}
JNR, but guess what it uses internally ;-)
73. www.hazelcast.com@noctarius2k
Solution 5: Native Interoperability
public void call() {
MethodType intType = MethodType.methodType(int.class);
MethodHandle handle = MethodHandles
.findNative(null, “getpid”, intType);
return (int) handle.invokeExact();
}
They inline … just fine.
76. www.hazelcast.com@noctarius2k
Solution 6: Immutable Types
int[] values = new int[2];
int x = values[0];
int y = values[1];
Looks like
value class Point {
final int x;
final int y;
}
// Create a Point instance
Point point = makeValue(1, 2);
Value Types
77. www.hazelcast.com@noctarius2k
Solution 6: Immutable Types
value class Point {
final int x;
final int y;
}
// Create a Point instance
Point point = makeValue(1, 2);
Value Types
int[] values = new int[2];
int x = values[0];
int y = values[1];
Stack
var X
var Y
Looks like
Stack Allocation!
93. www.hazelcast.com@noctarius2k
Cleaner API
public class AutoCleaning implements AutoCloseable {
// A cleaner, preferably one shared within a library
private static final Cleaner cleaner = ...;
static class State
implements Runnable {
State(...) {/* initialize State needed for cleaning action */}
public void run() {/*cleanup action accessing State, executed at most once*/}
}
private final State state;
private final Cleaner.Cleanable cleanable;
public AutoCleaning() {
this.state = new State(...);
this.cleanable = cleaner.register(this, state);
}
public void close() {
cleanable.clean();
}
}