Book Image

Learning Cascading

Book Image

Learning Cascading

Overview of this book

Table of Contents (18 chapters)
Learning Cascading
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
7
Optimizing the Performance of a Cascading Application
Index

Preface

Big data is the new "must have" of this century. Suddenly, everyone wants to manage huge amounts of data and find patterns in it, which they did not see before. The problem, however, is that big data is not one, but a whole slew of technologies, which work together to produce the desired outcome. New technologies are emerging, and existing ones are evolving very quickly. The design and development of big data systems is very complex, with an incredibly steep learning curve and not a whole lot of prior experience and best practices to rely on. This is where Cascading comes in. Cascading sits on top of the core big data frameworks and makes design and development of big data applications intuitive and fun! Cascading significantly simplifies and streamlines application development, job creation, and job scheduling. Cascading is an open source software, and many large organizations prefer to use it to manage their big data systems over more complicated solutions, such as MapReduce.

We discovered Cascading after our applications started to get to the level of complexity when pure MapReduce turned into a blood-pressure-raising nightmare. Needless to say, we fell in love with Cascading. Now, we train other developers on it, and evangelize it every chance we get. So, this is how our book came about. Our vision was to provide a book to the Cascading user community that will help them accelerate the development of complex, workflow-based Cascading applications, while still keeping their sanity intact so that they can enjoy life.

This book will teach you how to quickly develop practical Cascading applications, starting with the basics and gradually progressing into more complex topics. We start with a look "under the hood", how Cascading relates to core big data technologies, such as Hadoop MapReduce, and future emerging technologies, such as Tez, Spark, Storm, and others. Having gained an understanding of underlying technologies, we follow with a comprehensive introduction to the Cascading paradigm and components using well-tested code examples that go beyond the ones in the open domain that exist today. Throughout this book, you will receive expert advice on how to use the portions of a product that are undocumented or have limited documentation. To deepen your knowledge and experience with Cascading, you will work with a real-life case study using Natural Language Processing to perform text analysis and search large volumes of unstructured text. We conclude with a look to the future, and how Cascading will soon run on additional big data fabrics, such as Spark and Tez.

Cascading has rapidly gained popularity, and obtaining development skills in this product is a very marketable feature for a big data professional. With in-depth instructions and hands-on practical approaches, Learning Cascading will ensure your mastery of Cascading.

What this book covers

Chapter 1, The Big Data Core Technology Stack, introduces you to the concepts of big data and the core technologies that comprise it. This knowledge is essential as the foundation of learning Cascading.

Chapter 2, Cascading Basics in Detail, we will begin our exploration of Cascading. We will look at its intended purpose, how it is structured, how to develop programs using it base classes, and how it then manages the execution of these programs.

Chapter 3, Understanding Custom Operations, is based on the newly acquired Cascading knowledge. We will learn more advanced Cascading features that will truly unleash the power of the Cascading API. We will concentrate on an in-depth discussion about operations and their five primary types.

Chapter 4, Creating Custom Operations, will show you how to actually write a custom operation for each type of operation. This is done after we've completely explored and understood the anatomy of operations in the previous chapter.

Chapter 5, Code Reuse and Integration, introduces you to learning how to assemble reusable code, integrating Cascading with external systems, and using the Cascading instrumentation effectively to track and control execution. Specifically, we will discuss how Cascading fits into the overall processing infrastructure.

Chapter 6, Testing a Cascading Application, provides in-depth information on how to efficiently test a Cascading application using many techniques.

Chapter 7, Optimizing the Performance of a Cascading Application, provides in-depth information on how to efficiently optimize a Cascading application and configure the underlying framework (Hadoop) for maximum performance.

Chapter 8, Creating a Real-world Application in Cascading, takes everything we learned and creates a real-world application in Cascading. We will use a practical case study, which could be easily adapted to a functional component of a larger system within your organization.

Chapter 9, Planning for Future Growth, provides information that will allow you to continue to advance your skills.

Appendix, Downloadable Software, provides information that will allow you to download all the code from the book.

What you need for this book

Software:

  • Eclipse 4.x (Kepler, Luna, or beyond) or other Java IDE

  • Java 1.6 or above (1.7 preferred)

  • Cascading 2,2 or above (2.6.2 preferred)

  • Hadoop Virtual Machine is optional, but it'll be nice to have (Cloudera or Hortonworks are preferred)

OS:

  • If you have a Hadoop Virtual Machine: Windows 7 or above

  • If no Hadoop Virtual Machine: Linux (CentOS 6 and above preferred)

  • Hadoop version 2 (YARN) running MapReduce version 1 is preferred. Hadoop MapReduce (0.23 or beyond) will also work

Who this book is for

This book is intended for software developers, system architects, system analysts, big data project managers, and data scientists.

The reader of this book should have a basic understanding of the big data paradigm, Java development skills, and be interested in deploying big data solutions in their organization, specifically using the Cascading open source framework.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "A key script, such as hadoop-env.sh, is needed in instances where environment variables are set."

A block of code is set as follows:

public class NLPUtils
{
  /* Parse text into sentences
   * @param text - document text
   * @return String
   */
  public static String[] getSentences(String text)
  {
    String sentences[]=text.split("[.?!]");
    for (int i=0; i< sentences.length; i++)
    {
      sentences[i]=sentences[i].trim();
    }
    return sentences;
  }
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

Tap docTap = new FileTap (inputScheme, args[0]);
Tap sinkTap = new FileTap(outputScheme, args[1], SinkMode.REPLACE );
Pipe inPipe = new Pipe("InPipe");
Pipe pipeTextProcess = new SubAssemblyExample(inPipe);
Flow flow = new LocalFlowConnector();

Any command-line input or output is written as follows:

hadoop jar myjob.jar com.ai.jobs.MainJob data/input data/output

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Right-click on the project and navigate to DebugAs | DebugConfigurations…."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/8913OS_ImageBundle.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.