Monday, December 26, 2011

Apache Cassandra into my technology plate


I’m still new to Cassandra and by writing this post I hope to provide a better idea as a small step for a person like me who is new on Cassandra. I’m still in the initial process of understanding Cassandra, but by writing a blog post, my aim is to set up a solid foundation on myself as well as to provide something dependable for others for them to progress well with Cassandra.

Few months back I was looking for a way that I can do something different than doing day today coding I do. So I was searching for different topics and I have been exploring the NoSQL options other than JPA which is one of my favorite areas to explore. Then the topic was moved NoSQL databases. There were number of No SQL databases such as Cassandra, Hbase, MangoDB, Simple DB, Voldemort, etc. But most of these had nothing in common.

Where Cassandra fit into? Why Cassandra ?

Cassandra addresses some of the common issues come across with relational databases with the use of high volume data,

The size of the structured data become massive specially for internet based companies like Google, Amazon and Facebook etc. and vertical scaling of hardware is not a good option with relational databases as well as some of are not capable to vertically scale and achieve the handling of large number of structured data.

With high scalability and availability etc. these companies also wanted to have the high effectiveness on commodity hardware instead of using high end high cost hardware. Google and amazon in parallel came with same like idea to achieving high scalability of mass storage within commodity hardware. Google came up with BigTable and amazon with Dynamo. To get more understanding on general NoSql context I would recommend reading on "Finding the Right Data Solution for Your Application in the DataStorage Haystack"  article.

Cassandra can be identified as a combination of super sets of Bigtable and Dynamo. It combines the shared-nothing architecture of Dynamo, with key-value concept of Bigtable to create the next generation of databases that provides the high scalability and other expected features including the same effectiveness on commodity hardware. To get a better understanding on Cassandra I would recommend reading on Cassandra White Paper  published by Datastax.


Furthermore without reading much if you want to get a quick overview about Cassandra, the below video from DataStax is the point to start.

Saturday, November 5, 2011

Celebrating 10 years of Eclipse














10 years back another visionary decision was taken by IBM , by donating its $40 million worth of source code from Websphere Studio Workbench and forming the Eclipse Consortium. This initiation was actually taken by IBM in November 2001 with the goals of creating a “commercial industry standard , full featured, highly integrable architecture” IDE.

In January 2004, the Eclipse Foundation was started as an non profit organization to have a vendor neutral, transparent and open community. Furthermore in June 2004 Eclipse Foundation announced general availability of the royalty-free 3.0 release of the Eclipse Platform. This became a fantastic achievement of open source community as well as the java language itself. In September 30, 2004 J2SE 5.0 was released which is much powerful with much more features and I strongly believe that the release of eclipse 3.0 helped indirectly as another fact to its success story.


Why Eclipse so popular ?


  • Architecture of Eclipse IDE is easily and massively extensible, so any number of development features and functionality can be included for the requirement.
    • instead of hard coding applications functionality eclipse uses an implementation of OSGi that employs plugins to provide the functionality.
    • Wide range of plugins also available which run on top its runtime system as well as inside the runtime system.
  • Using, modifying distributing of Eclipse doesn't need to be paid. Eclipse releases under Eclipse Public License so it allows to do any of the above.
  • Eclipse IDE available for many operating systems
  • Eclipse IDE is advance as much as or more than any other commercial IDEs available in the market.
    • Many features has integrated to it
    • Frequent updates and research on going for new features and functionality
    • available not just for java also other languages like C/C++, cobol, php, pearl, python etc.


Where Eclipse stands today ?


After 10 years time Eclipse has achieved a major improvement and market share. Accomplishments that eclipse has gained is incredible and the community will be proud of them self silently. In terms of market share eclipse has achieved approximate figure of 65% considering all the java developers.

Eclipse foundation itself is a large community which consist more than 200 open source projects and more than 1000 committers. Also a considerable number of partner companies existing including featured partners like IBM, Nokia, SAP etc.

Wednesday, November 2, 2011

Galaxy Nexus, is it calling all possibilities ?

Google announced its new, long awaited Nexus phone, which is Galaxy Nexus instead of Nexus Prime as we heard once. New Galaxy Nexus is also coming with Google’s a new version of Android named, Ice Cream Sandwich. As per the Google official blog “Ice Cream Sandwich makes Android simple and beautiful, and takes the smartphone to beyond smart”.



But is it (Galaxy Nexus) really beyond smart with its new Android 4.0 (Ice Cream Sandwich) ?

 Yes it is, Its a smart move and more of a sweetest move (All of their OS names came with name of sweets ) this time with ice cream sandwich with lot of eye candy. With the overall major UI change in google they have decided to reflect that also on Andriod too which is impressive. This simple UI and elegant design theories new will make Andriod a more beauty that tends to attract more stake holders to its market share.

Screen size is notable improvement with another smart move which is replacing physical buttons with software buttons that will be again screen area. Also quite a good improvement in terms of resolution 720 x 1280 pixels in 4.65 inch area provides a avg. of 316 ppi pixel density. Compare to Samsung galaxy SII its massive (~217 ppi pixel density) .

Allowing users to unlock their phones using face recognition (google says its smile recognition but it should have more depth in it as I believe) is the smartest among the Android 4.0’s new features.

New improved Voice recognition, voice command and interaction features also smart enough.

Ice Cream Sandwich also brings some much-needed improvements to Google's photography software, Also panorama brings its Camera Features to next level of rich photography. 


Is it really calling all possibilities ?





With Android Ice cream Sandwich Galaxy Nexus is smart enough, but I don’t believe its calling all possibilities as they mentioned in their combined product launch of Galaxy Nexus. Because comparing to some of other android phones (Galaxy S II, DROID BIONIC, Sensation XE) is way beyond the Galaxy Nexus or equal in terms of hardware and some other features as per below. Also most of them are released months back so its not suitable to say Galaxy Nexus calling all possibilities.



Significant Disadvantages of GALAXY Nexus compare to other competitive phones

  • No new processor has introduced
    • The processor is 1.2GHz Cortex-A9 ? Why not the 1.5 Exynos 4212?
    • 1.5 Exynos is 30% more power efficient, capable of delivering 50% faster 3D graphics rendering, as well as the usual 1080p HD video recording/playback and HDMI 1.4 support.
  • Screen is Super AMOLED, not Super AMOLED plus
  • Slightly lower resolution photos (5 MP vs 8 MP)
    • Megapixels of a photograph is not just matter when it comes to picture quality, but still its slightly low in resolution
  • Has no assisted GPS
  • Has no memory card slot for external memory such as Micro SD, Micro SDHC
  • Video no video output: Micro HDMI


    Here's the video of the Google | Samsung joined product launch of Galaxy Nexus, shared on YouTube by androiddevelopers



Wednesday, October 19, 2011

Cognos Executed Report's Report view finally on the <iframe>


The requirement was to view the executed report to the user using the cognos viewer inside an iframe which is already in an application (which is totally outside the cognos application domain). Imagine the below report view is loaded to the iframe through the cognos viewer in a SaaS application.

 
Sounds simple right? Yes it is, but it was not that easy to implement even though the executed reports view is already available. To implement this simple requirement with an additional syntax, it took couple of hours due to insufficient information. However there were few sources  which has a quite similar approach but there where some drawbacks experienced when applying them. In each approach no one has indicated such implementation to view the executed report using cognosLaunch SDK js method, so I believed it is good to share this with the community.

Without just adding the simple syntax necessary for the above requirement, I would also like to provide some additional details that can be helpful for another audience.

SDK includes a JavaScript method (cognosLaunch method) that is useful for executing reports with multiple parameters.

Can we run a report directly through the cognosLaunch, js method?

  • Yes, report can be directly run through the cognosLaunch js method with multiple parameters (in terms of cognos, multiple prompts) but some browsers have limitations in the HTML request URL length.
  • Therefore, if there is a high probability in request URL exceeding the browser limitation, this method can be a failure.
  • In order to avoid the issue of request URL, can use of report prompts to get the necessary parameter values. Since avoiding report prompts is a requirement so we cant make use of report prompts


Why do we need to execute report and have a report view?

There is a requirement, once user select parameters and execute the report, results should exist as long as user wishes and user should be able to view the executed report instantly.
(If user runs the report through the cognosLaunch, report will be executed and can be viewed each time the user runs the report, but output will not be saved.)

This will cause two more issues,
  1. First issue will be the execution time, when data capacity is much bigger, the execution time will be considerably high. Then user will not be able to get the report instantly.
  2. Next issue will be when executing the report in a different time, might give conflicting results based on updated data set for the selected parameters. (if data set has changed)

When considering above matters and requirements now its obvious that reports needs to be executed once  and report outputs need to be saved as report views. Finally recall them using cognosLaunch js method. The bellow image will provide a high level picture of the scenario.





How to make a report to run and create a report view using Cognos SDK ?

We need to specify the report to run, the spec path of the new location for the report output and the name of the new report view.

The following are the simple steps need to follow to in order to create a new report view using the cognos SDK

  1. Connect to Cognos service.
  2. Assign appropriate values as run options.
  3. Execute the SDK run method


package chamantha.blog.cognos.sdk.development;
 
//NOTE : does not exists all the import statements
//high level indication of imports
import com.cognos.developer.schemas.bibus.*;
 
public class CognosReportExecution {
 
    /**
     * Execute the report using the Cognos SDK and
     * returns the report view spec path
     */
    public String executeReport() throws Exception {
 
    try {
        String reportSpecPath =
        "/content/folder[@name='Report Folder']/report[@name='My Report']";
 
        // Initiate the Cognos connection
        //This will be utility class that will help user to connect to -
        // -cognos using that is utilizing again cognos SDK
        CognosUtil cognos = new CognosUtil();
 
        // get Cognos SDK report service
        ReportService_PortType reportServicePortType =
               cognos.getreportServicePortType();
 
        // Initiate cognos search path for given report spec path
        SearchPathSingleObject searchPathSingleObj = new SearchPathSingleObject();
        searchPathSingleObj.set_value(reportSpecPath);
 
 
        ParameterValue[] paramValues = new ParameterValue[1];
        paramValues[0] = new ParameterValue();
 
        paramValues[0].setName("ForcastingYear");
        String year = "2011";
        SimpleParmValueItem valueItem = new SimpleParmValueItem();
        valueItem.setUse(year);
        valueItem.setDisplay(year);
        valueItem.setInclusive(true);
 
        ParmValueItem parmValueItems[] = new ParmValueItem[1];
        parmValueItems[0] = valueItem;
 
        paramValues[0].setValue(parmValueItems);
 
 
        // Speficify neccesary cognos SDK options
        Option[] options = new Option[3];
 
        // Indicate the prompt avaiability
        RunOptionBoolean promptAcceptence = new RunOptionBoolean();
        promptAcceptence.setName(RunOptionEnum.prompt);
        promptAcceptence.setValue(false);
        options[0] = promptAcceptence;
 
        // Format of the out put this can be multiple output formats too
        RunOptionStringArray runOptionsFormats = new RunOptionStringArray();
        runOptionsFormats.setName(RunOptionEnum.outputFormat);
        runOptionsFormats.setValue(new String[]{"HTML"});
        options[1] = runOptionsFormats;
 
 
        // Set Report view  name and the Locale
        MultilingualToken[] multilingualToken = new MultilingualToken[2];
        multilingualToken[0] = new MultilingualToken();
        multilingualToken[0].setLocale("en-us");
        multilingualToken[0].setValue(newReportName);
 
        // Where and how new report will be saved
        RunOptionSaveAs runOptSaveAs = new RunOptionSaveAs();
        runOptSaveAs.setName(RunOptionEnum.saveAs);
        runOptSaveAs.setObjectClass(ReportSaveAsEnum.reportView);
        runOptSaveAs.setObjectName(multilingualToken);
        runOptSaveAs.setParentSearchPath(newPathToSaveReportView);
 
        options[2] = runOptSaveAs;
 
 
        AsynchReply asynchReply =
        reportServicePortType.run(searchPathSingleObj,paramValues, options);
 
        AsynchDetail[] asynchDetails = asynchReply.getDetails();
 
        // A utility method to get the report spec path from asynchDetails
        String reportViewSpecPath = getReportViewSpecPath(asynchDetails);
 
        return reportViewSpecPath;
 
        } catch (Exception exception) {
            // Log the error and throw expected exception
            throw new Exception();
        }
    }
    /*
     * more methods providing utility.
     */
}




The above code snippet will return report spec path which is similar to bellow

/content/folder[@name='ReportView']/reportView[@name='Report view Name']

How to launch the report in an iframe using the cognosLaunch js method provided by the cognos SDK ?

The cognos launch method will take the parameters as shown bellow, which is mandatory to get the report view



What was the missing syntax ?

Specifying the report view spec path like “defaultOutput( REPORT_VIEW_SPEC_PATH )” is the missing syntax or the mechanism which was not known. This syntax was needed to run the report view which already saved in the cognos CMS. This was only able to identify by analyzing the default URL in the cognos IDE. The below image will show how I have identified syntax.


Then again what above simple syntax actually accessing the default, report version which is created for the respective report view.

Sunday, September 18, 2011

A Thought about SOA






This is my first blog post and I wanted to make this so simple and short. I'm still very new to the SOA (Service Oriented Architecture ) and web services and I thought of giving my idea as a fresher will benefit me to get the border picture of  SOA.  When I was reading some of  the articles on very first days, I realized SOA as a very hard concept because,
  • Some articles introduced SOA as a black box component architecture which hides the complexity when ever possible, which is absolutely correct but most haven't cover up the technology layer of SOA implementation but has only discribed business aspect of it.
  • Some of the articles had the idea of dividing functions in to distinct services that can be combine and use the required applications. Which I had an impression of having more complexity on the interconnection. Because stick in to loosely coupling can be impossible or less practical in a legacy system.

But when it comes to implementation, actually when I consider the technology layer I realized that its other way round. SOA is a simple, flexible set of design principles but lot of effort need to spend implementation to have a well managed SOA environment. So just for the sake of using SOA is like developing a just a web application which is not multi modular distributed application using EJB, which is an over kill.

SOA is getting matured, but still doubt whether it's precision in the way that SOA used in most of applications. SOA requires loose coupling and its main intention is to abstract the system complexity and represent a simple interface, so that the external parties can access the system services without the knowledge of the service's platform implementation.  However using SOA on correct business requirement is a step ahead on business perspective. Because SOA increases business flexibility, that helps the business profitability and performance which is actual end business objective.