Wednesday Jan 14, 2015

Java 8 Parallel Streams on SPARC T5

I showed on this previous post how a parallel word search implemented by Java 7 fork/join (based on this article) scales on a T5-4 server. Java 8 new features let the code needed for the same parallelism become much more simple, compact, and readable. Parallel streams and lambda expressions spare us from many helping classes and methods definitions we needed to create before.

Here is how to add Java 8 parallel streams support to the word search example. Looking at the code of the above fork/join article (can be downloaded from here), we can easily avoid all recursive tasks and all fork/join code by replacing (or adding to, to compare) the WordCounter.compute() method with computeWithStreams(). We still keep the same parallel processing:
 // computeWithStreams() performs word counting by parallel streams
 public long computeWithStreams()
 {
    List<Document> docList = Document.getDocList();
    return dlist.parallelStream().
    	   mapToLong(d -> occurrencesCount(d, searchedWord)).
    	   sum();
 }

The parallelStream() method inside the computeWithStreams() method shown above automatically creates the threads parallelism behind the scenes. The current Java 8 implementation of parallel streams uses the fork/join mechanism, so the performance gain remains the same as using fork/join directly. 

The rest of the code here is the helper code for preparing the documents list and call computeWithStreams(). First We need to add this static field and a static getter method to the Document class:

    // Listing all documents statically in Document class. Not necessarily a good practice,
    // but for the sake of showing the main idea here
    List<Document> docList = Document.getDocList();

 Then we populate this list with each of the generated documents (at the end of Document.fromFile() method). Instead of: 

    return new Document(lines);

we add:

    Document Doc = new Document(lines);
    docList.add(doc);
    return doc;

Finally, we just add the code to the main() method (just after the same single and fork/join calls):

    long[] parallelStreamTimes[i] = new long[repeatCount];

    for (int i=0; i<repeatCount; i++) {
        counts = wordCounter.computeWithStreams(args[1]);
        stopTime = System.currentTimeMillis();
    	parallelStreamTimes[i] = (stopTime - startTime);
    	System.out.println(counts + " , parallel streams search took " + parallelStreamTimes[i] + "ms");
    }

My next post will deal with how to observe the parallelism created behind the scenes, and how to troubleshoot parallelism (scalability) problems. Meanwhile, take a look at how to run Java faster on Solaris.

Saturday Jan 03, 2015

Happy New Year 2015!

Wishing everyone around the world all the best in the New Year!

ISV Engineering
Oracle Corp

Tuesday Dec 30, 2014

CloudSigma Public Cloud built on Oracle Solaris

On September 30, 2014 CloudSigma issued a press release announcing a native Oracle Solaris-based Infrastructure-as-a-Service (IaaS) offering for the enterprise.  And following on that press release, Robert Jenkins, CEO of CloudSigma,  demonstrated how CloudSigma is deploying instances of Oracle Solaris in their public cloud in two separate presentations at Oracle OpenWorld 2014:

 - Oracle Solaris Strategy, Engineering Insights, and Roadmap [GEN7808]
 - Kernel Zones: Next-Generation Cloud Platform [CON7842]

This is a significant strategic move by CloudSigma, leveraging Oracle Solaris features to meet their business objective of building high availability cloud servers and cloud hosting in both Europe and the US, and demonstrates Oracle Solaris and SPARC traction and value in the public cloud space.  CloudSigma is a pure-cloud IaaS provider that offers one of the most customizable cloud offerings on the market.  They recognize that Oracle Solaris 11 is a complete, integrated cloud platform that  is engineered for the type of large scale enterprise cloud environments their customers are demanding.  They see the benefits of implementing Oracle Solaris cloud virtualization with zero performance loss and the highest consolidation ratios for large-scale applications.  

As an example, in his presentation at OpenWorld, Mr. Jenkins spoke to the excitement of leveraging "Remote Administration Daemon" (RAD), which is a standard system service that offers secure, remote administrative access to an Oracle Solaris system.  RAD enabled CloudSigma to incorporate Solaris very quickly without the burden of writing the code themselves, as they have done with Linux.

“We’ve been excited to see the recent developments in the Oracle Solaris offering and have worked closely with Oracle to demonstrate the unique power of this platform for the enterprise,” said Robert Jenkins, CloudSigma CEO. “This new service will allow customers to engage with a SPARC – Oracle Solaris environment in new ways, as well as bring the benefits of the cloud paradigm to existing Oracle Solaris based workloads.”

CloudSigma is seeing significant interest in this offering and have customers using it as an ideal testing and development platform ahead of their production deployments.  CloudSigma customers are also deploying Solaris for elastic workloads in a way they previously weren’t able to do for private dedicated hardware-based solutions.



The release of Oracle Solaris 11.2 has transformed it into a complete cloud platform with OS, virtualization and Software Defined Networking (SDN) capabilities as well as a full distribution of OpenStack.  The demand for Oracle Solaris in public clouds is increasing significantly and CloudSigma is just the beginning.

Monday Nov 03, 2014

EMC and Oracle Get Down To Business at Oracle OpenWorld


It should be no surprise to know that EMC Corporation and Oracle have a strong alliance built on a long-term relationship which drive a significant systems business for Oracle.  But what might be news is to see how these two companies have closely collaborated to drive technology integration and best practices around joint solutions for Oracle SPARC systems.  Just a few examples include their joint efforts around LDoms (Oracle VM Server for SPARC), and new feature integration with Oracle Solaris 11.2.  

Watch this short video filmed at Oracle OpenWorld this year to see how this technology collaboration is providing significant advantage to our customers.

About

How open innovation and technology adoption translates to business value, with stories from our developer support work at Oracle's ISV Engineering.

Subscribe

Search

Categories
  • sun
Archives
« May 2015
SunMonTueWedThuFriSat
     
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
      
Today
Feeds