Getting Started with Storm
Jonathan Leibiusky, Gabriel Eisbruch,
and Dario Simonassi
Beijing
•
Cambridge
•
Farnham
•
Köln
•
Sebastopol
•
Tokyo
Downloa d f r o m W o w ! e B o o k < w w w.woweb o o k . c o m >
Getting Started with Storm
by Jonathan Leibiusky, Gabriel Eisbruch, and Dario Simonassi
Copyright © 2012 Jonathan Leibiusky, Gabriel Eisbruch, Dario Simonassi. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions
are also available for most titles (http://my.safaribooksonline.com). For more information, contact our
corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com.
Editors: Mike Loukides and Shawn Wallace
Production Editor: Melanie Yarbrough
Cover Designer: Karen Montgomery
Interior Designer: David Futato
Illustrator: Rebecca Demarest
Revision History for the First Edition:
2012-08-30 First release
See http://oreilly.com/catalog/errata.csp?isbn=9781449324018 for release details.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc. Getting Started with Storm, the cover image of a skua, and related trade dress are
trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a
trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors assume
no responsibility for errors or omissions, or for damages resulting from the use of the information con-
tained herein.
ISBN: 978-1-449-32401-8
[LSI]
1346349770
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
1. Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
The Components of Storm 2
The Properties of Storm 3
2. Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Operation Modes 5
Local Mode 5
Remote Mode 6
Hello World Storm 6
Checking Java Installation 7
Creating the Project 7
Creating Our First Topology 9
Spout 9
Bolts 12
The Main Class 16
See It In Action 18
Conclusion 19
3. Topologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Stream Grouping 21
Shuffle Grouping 22
Fields Grouping 22
All Grouping 22
Custom Grouping 23
Direct Grouping 24
Global Grouping 24
None Grouping 25
LocalCluster versus StormSubmitter 25
DRPC Topologies 26
iii
- 1
- 2
- 3
前往页