Joda-Time provides a quality replacement for the Java date and time classes. At last Java 8 is coming up with completely re-designed Date and Time features. Even though we will check the features of Joda Time which provides a quality replacement for the Java date and time classes:

  • Easy to Use. Calendar makes accessing 'normal' dates difficult, due to the lack of simple methods. Joda-Time has straightforward field accessors such as getYear() orgetDayOfWeek().
  • Easy to Extend. The JDK supports multiple calendar systems via subclasses of Calendar. This is clunky, and in practice it is very difficult to write another calendar system. Joda-Time supports multiple calendar systems via a pluggable system based on the Chronology class.
  • Comprehensive Feature Set. The library is intended to provide all the functionality that is required for date-time calculations. It already provides out-of-the-box features, such as support for oddball date formats, which are difficult to replicate with the JDK.
  • Up-to-date Time Zone calculations. The time zone implementation is based on the public tz database, which is updated several times a year. New Joda-Time releases incorporate all changes made to this database. Should the changes be needed earlier, manually updating the zone data is easy.
  • Calendar support. The library currently provides 8 calendar systems. More will be added in the future.
  • Easy interoperability. The library internally uses a millisecond instant which is identical to the JDK and similar to other common time representations. This makes interoperability easy, and Joda-Time comes with out-of-the-box JDK interoperability.
  • Better Performance Characteristics. Calendar has strange performance characteristics as it recalculates fields at unexpected moments. Joda-Time does only the minimal calculation for the field that is being accessed.
  • Good Test Coverage. Joda-Time has a comprehensive set of developer tests, providing assurance of the library's quality.
  • Complete Documentation. There is a full User Guide which provides an overview and covers common usage scenarios. The javadoc is extremely detailed and covers the rest of the API.
  • Maturity. The library has been under active development since 2002. Although it continues to be improved with the addition of new features and bug-fixes, it is a mature and reliable code base. A number of related projects are now available.
  • Open Source. Joda-Time is licenced under the business friendly Apache License Version 2.0.

Courtesy: Joda.
Java 8 is having some really exciting features at both the JVM and language level.


Below are the full features coming in Java 8.
  • Java Programming Language
    • Lambda Expressions, a new language feature, has been introduced in this release. They enable you to treat functionality as a method argument, or code as data. Lambda expressions let you express instances of single-method interfaces (referred to as functional interfaces) more compactly.
    • Method references provide easy-to-read lambda expressions for methods that already have a name.
    • Default methods enable new functionality to be added to the interfaces of libraries and ensure binary compatibility with code written for older versions of those interfaces.
    • Repeating Annotations provide the ability to apply the same annotation type more than once to the same declaration or type use.
    • Type Annotations provide the ability to apply an annotation anywhere a type is used, not just on a declaration. Used with a pluggable type system, this feature enables improved type checking of your code.
    • Improved type inference.
    • Method parameter reflection.
  • Collections
    • Classes in the new java.util.stream package provide a Stream API to support functional-style operations on streams of elements. The Stream API is integrated into the Collections API, which enables bulk operations on collections, such as sequential or parallel map-reduce transformations.
    • Performance Improvement for HashMaps with Key Collisions
  • Compact Profiles contain predefined subsets of the Java SE platform and enable applications that do not require the entire Platform to be deployed and run on small devices.
  • Security
    • Client-side TLS 1.2 enabled by default
    • New variant of AccessController.doPrivileged that enables code to assert a subset of its privileges, without preventing the full traversal of the stack to check for other permissions
    • Stronger algorithms for password-based encryption
    • SSL/TLS Server Name Indication (SNI) Extension support in JSSE Server
    • Support for AEAD algorithms: The SunJCE provider is enhanced to support AES/GCM/NoPadding cipher implementation as well as GCM algorithm parameters. And the SunJSSE provider is enhanced to support AEAD mode based cipher suites. See Oracle Providers Documentation, JEP 115.
    • KeyStore enhancements, including the new Domain KeyStore type java.security.DomainLoadStoreParameter, and the new command option -importpassword for the keytool utility
    • SHA-224 Message Digests
    • Enhanced Support for NSA Suite B Cryptography
    • Better Support for High Entropy Random Number Generation
    • New java.security.cert.PKIXRevocationChecker class for configuring revocation checking of X.509 certificates
    • 64-bit PKCS11 for Windows
    • New rcache Types in Kerberos 5 Replay Caching
    • Support for Kerberos 5 Protocol Transition and Constrained Delegation
    • Kerberos 5 weak encryption types disabled by default
    • Unbound SASL for the GSS-API/Kerberos 5 mechanism
    • SASL service for multiple host names
    • JNI bridge to native JGSS on Mac OS X
    • Support for stronger strength ephemeral DH keys in the SunJSSE provider
    • Support for server-side cipher suites preference customization in JSSE
  • JavaFX
    • The new Modena theme has been implemented in this release. For more information, see the blog at fxexperience.com.
    • The new SwingNode class enables developers to embed Swing content into JavaFX applications. See the SwingNode javadoc andEmbedding Swing Content in JavaFX Applications.
    • The new UI Controls include the DatePicker and the TreeTableView controls.
    • The javafx.print package provides the public classes for the JavaFX Printing API. See the javadoc for more information.
    • The 3D Graphics features now include 3D shapes, camera, lights, subscene, material, picking, and antialiasing. The new Shape3D(Box, Cylinder, MeshView, and Sphere subclasses), SubScene, Material, PickResult, LightBase (AmbientLight andPointLight subclasses) , and SceneAntialiasing API classes have been added to the JavaFX 3D Graphics library. The Camera API class has also been updated in this release. See the corresponding class javadoc for javafx.scene.shape.Shape3D,javafx.scene.SubScene, javafx.scene.paint.Material, javafx.scene.input.PickResult,javafx.scene.SceneAntialiasing, and the Getting Started with JavaFX 3D Graphics document.
    • The WebView class provides new features and improvements. Review Supported Features of HTML5 for more information about additional HTML5 features including Web Sockets, Web Workers, and Web Fonts.
    • Enhanced text support including bi-directional text and complex text scripts such as Thai and Hindi in controls, and multi-line, multi-style text in text nodes.
    • Support for Hi-DPI displays has been added in this release.
    • The CSS Styleable* classes became public API. See the javafx.css javadoc for more information.
    • The new ScheduledService class allows to automatically restart the service.
    • JavaFX is now available for ARM platforms. JDK for ARM includes the base, graphics and controls components of JavaFX.
  • Tools
    • The jjs command is provided to invoke the Nashorn engine.
    • The java command launches JavaFX applications.
    • The java man page has been reworked.
    • The jdeps command-line tool is provided for analyzing class files.
    • Java Management Extensions (JMX) provide remote access to diagnostic commands.
    • The jarsigner tool has an option for requesting a signed time stamp from a Time Stamping Authority (TSA).
    • Javac tool
      • The -parameters option of the javac command can be used to store formal parameter names and enable the Reflection API to retrieve formal parameter names.
      • The type rules for equality operators in the Java Language Specification (JLS) Section 15.21 are now correctly enforced by thejavac command.
      • The javac tool now has support for checking the content of javadoc comments for issues that could lead to various problems, such as invalid HTML or accessibility issues, in the files that are generated when javadoc is run. The feature is enabled by the new -Xdoclint option. For more details, see the output from running "javac -X". This feature is also available in the javadoctool, and is enabled there by default.
      • The javac tool now provides the ability to generate native headers, as needed. This removes the need to run the javah tool as a separate step in the build pipeline. The feature is enabled in javac by using the new -h option, which is used to specify a directory in which the header files should be written. Header files will be generated for any class which has either native methods, or constant fields annotated with a new annotation of type java.lang.annotation.Native.
    • Javadoc tool
      • The javadoc tool supports the new DocTree API that enables you to traverse Javadoc comments as abstract syntax trees.
      • The javadoc tool supports the new Javadoc Access API that enables you to invoke the Javadoc tool directly from a Java application, without executing a new process. See the javadoc what's new page for more information.
      • The javadoc tool now has support for checking the content of javadoc comments for issues that could lead to various problems, such as invalid HTML or accessibility issues, in the files that are generated when javadoc is run. The feature is enabled by default, and can also be controlled by the new -Xdoclint option. For more details, see the output from running "javadoc -X". This feature is also available in the javac tool, although it is not enabled by default there.
  • Internationalization
    • Unicode Enhancements, including support for Unicode 6.2.0
    • Adoption of Unicode CLDR Data and the java.locale.providers System Property
    • New Calendar and Locale APIs
    • Ability to Install a Custom Resource Bundle as an Extension
  • Deployment
    • For sandbox applets and Java Web Start applications, URLPermission is now used to allow connections back to the server from which they were started. SocketPermission is no longer granted.
    • The Permissions attribute is required in the JAR file manifest of the main JAR file at all security levels.
  • Date-Time Package - a new set of packages that provide a comprehensive date-time model.
  • Scripting
  • Pack200
    • Pack200 Support for Constant Pool Entries and New Bytecodes Introduced by JSR 292
    • JDK8 support for class files changes specified by JSR-292, JSR-308 and JSR-335
  • IO and NIO
    • New SelectorProvider implementation for Solaris based on the Solaris event port mechanism. To use, run with the system propertyjava.nio.channels.spi.Selector set to the value sun.nio.ch.EventPortSelectorProvider.
    • Decrease in the size of the <JDK_HOME>/jre/lib/charsets.jar file
    • Performance improvement for the java.lang.String(byte[], *) constructor and the java.lang.String.getBytes() method.
  • java.lang and java.util Packages
    • Parallel Array Sorting
    • Standard Encoding and Decoding Base64
    • Unsigned Arithmetic Support
  • JDBC
    • The JDBC-ODBC Bridge has been removed.
    • JDBC 4.2 introduces new features.
  • Java DB
    • JDK 8 includes Java DB 10.10.
  • Networking
    • The class java.net.URLPermission has been added.
    • In the class java.net.HttpURLConnection, if a security manager is installed, calls that request to open a connection require permission.
  • Concurrency
    • Classes and interfaces have been added to the java.util.concurrent package.
    • Methods have been added to the java.util.concurrent.ConcurrentHashMap class to support aggregate operations based on the newly added streams facility and lambda expressions.
    • Classes have been added to the java.util.concurrent.atomic package to support scalable updatable variables.
    • Methods have been added to the java.util.concurrent.ForkJoinPool class to support a common pool.
    • The java.util.concurrent.locks.StampedLock class has been added to provide a capability-based lock with three modes for controlling read/write access.
  • Java XML - JAXP
  • HotSpot
    • Hardware intrinsics were added to use Advanced Encryption Standard (AES). The UseAES and UseAESIntrinsics flags are available to enable the hardware-based AES intrinsics for Intel hardware. The hardware must be 2010 or newer Westmere hardware. For example, to enable hardware AES, use the following flags:
      -XX:+UseAES -XX:+UseAESIntrinsics

      To disable hardware AES use the following flags:
      -XX:-UseAES -XX:-UseAESIntrinsics

    • Removal of PermGen.

    • Default Methods in the Java Programming Language are supported by the byte code instructions for method invocation.


  • Java Mission Control 5.3 Release Notes


    • JDK 8 includes Java Mission Control 5.3.

















Information Courtesy : Oracle Java Release Features
Spring XD is a unified, distributed, and extensible system for data ingestion, real time analytics, batch processing, and data export.

Much of the complexity in building real-world big data applications is related to integrating many disparate systems into one cohesive solution across a range of use-cases. Common use-cases encountered in creating a comprehensive big data solution are
  • High throughput distributed data ingestion from a variety of input sources into big data store such as HDFS or Splunk
  • Real-time analytics at ingestion time, e.g. gathering metrics and counting values.
  • Workflow management via batch jobs. The jobs combine interactions with standard enterprise systems (e.g. RDBMS) as well as Hadoop operations (e.g. MapReduce, HDFS, Pig, Hive or Cascading).
  • High throughput data export, e.g. from HDFS to a RDBMS or NoSQL database.
The Spring XD project aims to provide a one stop shop solution for these use-cases.

Features of Spring XD.  

  • Unified platform - Stream Processing and Batch Jobs
    • Off-Hadoop Batch Jobs
    • Hadoop Batch workflow orchestration
    • NoSQL Analytics
    • Scoring of Machine Learning algorithms
  • Runtime that provides critical non-functional requirements
    • Scalable, distributed, Fault-Tolerant
    • Portable. On prem DIY cluster, YARN, EC2.
  • Easy to use
  • Easy to extend and integrate other technologies
Minimum requirements: System should have a minimum Java JDK 6 or newer installed. Java JDK 7 is recommended.
To download the current release, you can download the distribution spring-xd-1.0.0.RELEASE-dist.zip.

What is Apache Spark? Why there is a serious buzz going-on about this? If you are into BigData analytics business then, should you really care about Spark? Hope this post will help to answer some of these questions which might have coming to your mind these days.
Apache Spark is a powerful open source processing engine for Hadoop data built around speed, easy to use, and sophisticated analytics. It was originally developed in UC Berkeley’s AMPLab and later-on it moved to Apache. Apache Spark is basically a parallel data processing framework that can work with Apache Hadoop to make it extremely easy to develop fast, Big Data applications combining batch, streaming, and interactive analytics on all your data.
Lets go through some of its features which are really highlighting it in the Bigdata world!
  1. Lighting Fast Processing
When comes to BigData processing speed always matters. We always look for processing our huge data as fast as possible. Spark enables applications in Hadoop clusters to run up to 100x faster in memory, and 10x faster even when running on disk. Spark makes it possible by reducing number of read/write to disc. It stores this intermediate processing data in-memory. It uses the concept of an Resilient Distributed Dataset (RDD), which allows it to transparently store data on memory and persist it to disc only it’s needed. This helps to reduce most of the disc read and write –  the main time consuming factors – of data processing.

(Spark Performance over Hadoop. Image Courtesy: Cloudera. Visit this link to see how Jai & Matei explains the delightful experience giving by Spark to its developers.)
  1. Ease of Use as it supports multiple languages
Spark lets you quickly write applications in Java, Scala, or Python. This helps developers to create and run their applications on their familiar programming languages. It comes with a built-in set of over 80 high-level operators.We can use it interactively to query data within the shell too.
  1. Support for Sophisticated Analytics
In addition to simple “map” and “reduce” operations, Spark supports SQL queries, streaming data, and complex analytics such as machine learning and graph algorithms out-of-the-box. Not only that, users can combine all these capabilities seamlessly in a single workflow.
  1. Real time stream processing
Spark can handle real time streaming. Map-reduce mainly handles and process the data stored already. However Spark can also manipulate data in real time using Spark Streaming. Not ignoring that there are other frameworks with their integration we can handle streaming in Hadoop.
Here is what Cloudera says about Sparks Streaming abilities:
  • Easy: Built on Spark’s lightweight yet powerful APIs, Spark Streaming lets you rapidly develop streaming applications
  • Fault tolerant: Unlike other streaming solutions (e.g. Storm), Spark Streaming recovers lost work and delivers exactly-once semantics out of the box with no extra code or configuration
  • Integrated: Reuse the same code for batch and stream processing, even joining streaming data to historical data

(Streaming Performance over Storm. Image Courtesy:Cloudera.com)
  1. Ability to integrate with Hadoop and existing HadoopData
Spark can run independently. Apart from that it can run on Hadoop 2’s YARN cluster manager, and can read any existing Hadoop data. That’s a BIG advantage! It can read from any Hadoop data sources for example HBase, HDFS etc. This feature of Spark makes it suitable for migration of existing pure Hadoop applications, if that application use-case is really suiting Spark. As Spark is using immutability more all scenarios might not be suitable for migration.
  1. Active and expanding Community
Apache Spark is built by a wide set of developers from over 50 companies. The project started in 2009 and as of now more than 250 developers have contributed to Spark already! It has active mailing lists and JIRA for issue tracking.
Below are some useful links to start with:














A Hibernate Session is a transaction-level cache of persistent data. We can configure a cluster or JVM-level (SessionFactory-level) cache on a class-by-class and collection-by-collection basis. We can also plug in a clustered cache into Hibernate. At the time of providing cache we need to understand that when we are updating the persistence DB it will not automatically reflect on Cache.
Configuring CACHE in Hibernate
We need to tell Hibernate that which caching implementation we need to  use. This we can accomplish by specifying the name of a class that implements org.hibernate.cache.CacheProvider using the property hibernate.cache.provider_class. Hibernate comes bundled with a number of built-in integrations with open-source cache providers; additionally, we could implement your own and plug it in as outlined above. Prior to 3.2 Hibernate is defaulted to use EhCache as the default cache provider.
To find the CACHE PROVIDERS please check this post <Click Here>
Cache mappings
The <cache> element of a class or collection mapping has the following form:
<cache 
    usage="transactional|read-write|nonstrict-read-write|read-only"  (1)
    region="RegionName"                                              (2)
    include="all|non-lazy"                                           (3)
/>


(1)


usage (required) specifies the caching strategy: transactional, read-write, nonstrict-read-write or read-only


(2)


region (optional, defaults to the class or collection role name) specifies the name of the second level cache region


(3)


include (optional, defaults to all) non-lazy specifies that properties of the entity mapped with lazy="true" may not be cached when attribute-level lazy fetching is enabled


Strategy: read only



  • Useful for data that is read frequently but never updated.


  • It is Simple .


  • Best performer among the all.


If application needs to read but never modify instances of a persistent class, a read-only cache may be used. This is the simplest and best performing strategy. It's even perfectly safe for use in a cluster.


<class name="eg.Immutable" mutable="false">
    <cache usage="read-only"/>
    ....
</class>


Strategy: read/write



  • Used when our data needs to be updated.


  • It’s having more overhead than read-only caches.


  • When Session.close() or Session.disconnect() is called the transaction should be completed in an environment where JTA is no used.


  • It is never used if serializable transaction isolation level is required.


  • In a JTA environment, for obtaining the JTA TransactionManager we must specify the propertyhibernate.transaction.manager_lookup_class.


  • To use it in a cluster the cache implementation must support locking.


If the application needs to update data, a read-write cache might be appropriate. This cache strategy should never be used if serializable transaction isolation level is required. If the cache is used in a JTA environment, you must specify the property hibernate.transaction.manager_lookup_class, naming a strategy for obtaining the JTA TransactionManager. In other environments, you should ensure that the transaction is completed when Session.close() or Session.disconnect() is called. If you wish to use this strategy in a cluster, you should ensure that the underlying cache implementation supports locking. The built-in cache providers do not.


<class name="eg.Cat" .... >
    <cache usage="read-write"/>
    ....
    <set name="kittens" ... >
        <cache usage="read-write"/>
        ....
    </set>
</class>


 


Strategy: nonstrict read/write



  • Needed if the application needs to update data rarely.


  • we must specify hibernate.transaction.manager_lookup_class to use this in a JTA environment .


  • The transaction is completed when Session.close() or Session.disconnect() is called In other environments (except JTA) .


If the application only occasionally needs to update data (ie. if it is extremely unlikely that two transactions would try to update the same item simultaneously) and strict transaction isolation is not required, a nonstrict-read-write cache might be appropriate. If the cache is used in a JTA environment, you must specify hibernate.transaction.manager_lookup_class. In other environments, you should ensure that the transaction is completed when Session.close() or Session.disconnect() is called.


Strategy: transactional



  • It supports only transactional cache providers such as JBoss TreeCache.


  • only used in JTA environment.


The transactional cache strategy provides support for fully transactional cache providers such as JBoss TreeCache. Such a cache may only be used in a JTA environment and you must specify hibernate.transaction.manager_lookup_class.

Here in this port you can find the list of Cache providers and their Concurrency support details. (Exerted from Official Hibernate Tutorial)
EHCache (Easy Hibernate Cache)
(org.hibernate.cache.EhCacheProvider)
  • It is fast.
  • lightweight.
  • Easy-to-use.
  • Supports read-only and read/write caching.
  • Supports memory-based and disk-based caching.
  • Does not support clustering.
OSCache (Open Symphony Cache)
(org.hibernate.cache.OSCacheProvider)
  • It is a powerful .
  • flexible package
  • supports read-only and read/write caching.
  • Supports memory- based and disk-based caching.
  • Provides basic support for clustering via either JavaGroups or JMS.
SwarmCache (org.hibernate.cache.SwarmCacheProvider)
  • is a cluster-based caching.
  • supports read-only or nonstrict read/write caching .
  • appropriate for applications those have more read operations than write operations.
JBoss TreeCache (org.hibernate.cache.TreeCacheProvider)
  • is a powerful replicated and transactional cache.
  • useful when we need a true transaction-capable caching architecture .
Cache providers.
Cache Provider class Type Cluster Safe Query Cache Supported
Hashtable (not intended for production use) org.hibernate.cache.
HashtableCache
Provider
memory yes
EHCache org.hibernate.cache.
EhCacheProvider
memory, disk yes
OSCache org.hibernate.cache.
OSCacheProvider
memory, disk yes
SwarmCache org.hibernate.cache.
SwarmCacheProvider
clustered (ip multicast) yes (clustered invalidation) yes (clock sync req.)
JBoss Cache 1.x org.hibernate.cache.
TreeCacheProvider
clustered (ip multicast), transactional yes (replication) yes (clock sync req.)
JBoss Cache 2 org.hibernate.cache.
jbc2.JBossCache
RegionFactory
clustered (ip multicast), transactional yes (replication or invalidation) yes (clock sync req.)
Cache Concurrency Strategy Support
Cache read-only nonstrict-read-write read-write transactional
Hashtable (not intended for production use) yes yes yes
EHCache yes yes yes
OSCache yes yes yes
SwarmCache yes yes
JBoss Cache 1.x yes yes
JBoss Cache 2 yes yes
+